-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat - admin api 추가 #172
feat - admin api 추가 #172
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인터셉터로 슬랙 회원가입 시 메시지 전송하게 하는 분들도 있길래 들어봤는데 여기서도 들어보네요 허허
return ResponseEntity | ||
.noContent() | ||
.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀👍
int challengePeriod = dailyChallenges.size(); | ||
for (int i = 0; i < challengePeriod; i++) { | ||
dailyChallenges.get(i).changeStatus(statuses.get(i)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q. int 변수로 선언한 이유가 궁금해요 반복문을 위해서만 사용되는 변수라면 for문 안에 써줘도 가독성도 해치지 않고 메모리에 변수 공간을 차지 안할 것 같아서용! 뒤의 changeChllangeDateOfDailyChallenges메소드도 같은 방식이여서 같이 여쭤봅니당
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음... 좀더 명시적으로 써놓은 거긴한데 들어보니까 굳이인 것 같긴하네요!
private void changeStatusOfDailyChallenges(List<DailyChallenge> dailyChallenges, List<Status> statuses) { | ||
int challengePeriod = dailyChallenges.size(); | ||
for (int i = 0; i < challengePeriod; i++) { | ||
dailyChallenges.get(i).changeStatus(statuses.get(i)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P5. 날짜가 나중에 365일 이렇게 길어지면 바꿀 챌린지 날짜의 정보만 바꿔주는 로직도 좋을 것 같아요..물론 admin이 자주 쓰이면 안되긴 하겠지만
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵넵 그것도 나중에 필요성이 느껴지면 추가하면 좋을 것 같아요!
|
||
public void withdrawImmediately(Long userId) { | ||
userRepository.deleteById(userId); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1. 즉시 삭제할 때 ExpiredUserDeleteScheduler의 deleteExpiredUser메소드 안에 있던 challengeService.deleteChallengeRelatedByUserId(expiredUserList);이 코드도 실행해주어야 챌린지(+일별챌린지, 앱 등)도 삭제될 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와 아주 좋은 지적 감사합니다~!
Related issue 🚀
Work Description 💚
Admin login api
application.yml에 있는 값인 admin-auth-code값을 이용하여 jwt의 subject 값이 "ADMIN"인 토큰을 발급합니다.
이 토큰은 spring interceptor를 이용해
api/v1/admin
으로 시작되는 모든 api를 검증됩니다. (api/v1/admin/login
)은 제외됩니다.Admin 유저 정보 변경 api
admin jwt를 이용해 유저의 이름 및 포인트를 변경할 수 있도록 합니다.
Admin 일별 챌린지 상태 변경 api
admin jwt를 이용해 dailyChallenge의 상태 및 챌린지 날짜를 변경할 수 있도록 합니다.
request로 보낸 statuses가 기존 dailyChallenge의 period와 맞지 않으면 에러를 발생시킵니다.
Admin 회원 탈퇴 api
admin jwt를 이용해 특정 id의 회원을 탈퇴 시킵니다.
특정 id의 회원이 없다면 탈퇴시키지 않습니다.