Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
요약 (Summary)
🔑 변경 사항 (Key Changes)
BaseExceptionResponseStatus 추가 작성
: 크루 탈퇴 관련한 예외를 추가 작성했습니다.CrewService.cancelCrew 작성
: 크루 탈퇴하기 서비스를 작성했습니다.CrewController.deleteCrew 작성
: 크루 탈퇴하기 컨트롤러를 작성했습니다.📝 리뷰 요구사항 (To Reviewers)
확인 방법
코드를 실행시키고,mysql workbench에서 다음 쿼리문을 실행시켜주세요.
첫번째 member를 리뷰자의 정보로 수정해야합니다.
그 다음 카카오 소셜 로그인을 해주세요.
https://kauth.kakao.com/oauth/authorize?client_id=220ac935aaf5aa43884ee21823d82237&redirect_uri=http://localhost:8080/auth/kakao/callback&response_type=code
엑세스토큰을 postman에 넣고 테스트 해주세요
다음 주소로 PATCH 요청 보내주세요
http://localhost:8080/crew/cancel?crewId=1
crewId값을 변경해 가면서 변경사항을 확인하시면 됩니다!
크루 탈퇴전 멤버크루의 데이터베이스 상태입니다.
크루아이디2 CREW 권한을 가진 멤버아이디1이 크루2 탈퇴를 했을때 정상적으로 상태값이 DELETE로 변경되는것을 확인할 수 있습니다!
반면 크루아이디1의 CAPTAIN 권한을 가진 멤버아이디1이 크루1 탈퇴를 하려고하면 위와같은 예외처리가 되어야 성공입니다!
크루아이디3에 참여하고 있지않은 멤버아이디1이 크루3 탈퇴를 하려고했을때
위와같은 메세지가 뜨면 성공입니다!
크루아이디4 이상부터는 존재하지않는 크루에대한 예외처리 메세지가 뜨면 성공입니다!
크루아이디1 - > 크루탈퇴 불가 (CAPTAIN이라서)
크루아이디2 - > 크루탈퇴
크루아이디3 - > 크루에 참여하지 못한 상태라 삭제 불가
크루아이디4 이상 -> 존재하지 않는 크루에대한 예외처리