-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: 팀원 삭제 시 teamRole도 삭제하는 로직 추가 * test: 팀원 삭제 후 재초대 시 팀원 조회가 불가한 상황에 대한 테스트 추가 * fix: 팀장 삭제 시 팀장 본인은 삭제 불가하도록 변경 * fix: 참여자 삭제 시 참여자 본인은 삭제하지 못하도록 변경 * fix: 스터디장으로 임명된 팀원은 삭제 불가하도록 변경, 팀원 삭제 시 스터디원 & 권한도 모두 삭제 * fix: 참여자(스터디원) 삭제는 스터디장과 팀장이 가능하도록 변경 - 참여자 삭제 시 권한도 삭제되도록 변경 - 참여자 탈퇴 시 권한도 삭제되도록 변경 * feat: 팀장이 스터디장을 삭제하는 경우 팀장이 스터디장 권한을 위임받는 것으로 수정 - 팀장이 스터디장을 삭제하는 경우 스터디장 부재가 되므로 스터디를 정상적으로 운영할 수 없게 되는 현상 방지 * fix: 예외처리 이름이 동일하여 의미가 잘 전달되지 않던 부분 수정 * fix: 스터디 구성원이 아니거나 팀 구성원이 아니면 예외 처리를 하던 것을 false를 반환하는 것으로 변경 * chore: 권한 로직을 먼저 수행하도록 변경 * test: 추가로 개발된 사항에 대한 테스트 개발
- Loading branch information
Showing
20 changed files
with
370 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/doore/member/exception/MemberTeamException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package doore.member.exception; | ||
|
||
import doore.base.BaseException; | ||
import doore.base.BaseExceptionType; | ||
|
||
public class MemberTeamException extends BaseException { | ||
private final MemberTeamExceptionType exceptionType; | ||
|
||
public MemberTeamException(final MemberTeamExceptionType exceptionType) { | ||
super(exceptionType.errorMessage()); | ||
this.exceptionType = exceptionType; | ||
} | ||
|
||
@Override | ||
public BaseExceptionType exceptionType() { | ||
return exceptionType; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/doore/member/exception/MemberTeamExceptionType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package doore.member.exception; | ||
|
||
import doore.base.BaseExceptionType; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public enum MemberTeamExceptionType implements BaseExceptionType { | ||
|
||
CANNOT_DELETE_TEAM_LEADER_SELF(HttpStatus.BAD_REQUEST, "팀장 본인은 팀을 탈퇴할 수 없습니다."), | ||
; | ||
|
||
private final HttpStatus httpStatus; | ||
private final String errorMessage; | ||
|
||
MemberTeamExceptionType(final HttpStatus httpStatus, final String errorMessage) { | ||
this.httpStatus = httpStatus; | ||
this.errorMessage = errorMessage; | ||
} | ||
|
||
@Override | ||
public HttpStatus httpStatus() { | ||
return httpStatus; | ||
} | ||
|
||
@Override | ||
public String errorMessage() { | ||
return errorMessage; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/doore/member/exception/ParticipantException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package doore.member.exception; | ||
|
||
import doore.base.BaseException; | ||
import doore.base.BaseExceptionType; | ||
|
||
public class ParticipantException extends BaseException { | ||
|
||
private final ParticipantExceptionType exceptionType; | ||
|
||
public ParticipantException(final ParticipantExceptionType exceptionType) { | ||
super(exceptionType.errorMessage()); | ||
this.exceptionType = exceptionType; | ||
} | ||
|
||
@Override | ||
public BaseExceptionType exceptionType() { | ||
return exceptionType; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/doore/member/exception/ParticipantExceptionType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package doore.member.exception; | ||
|
||
import doore.base.BaseExceptionType; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public enum ParticipantExceptionType implements BaseExceptionType { | ||
|
||
CANNOT_DELETE_STUDY_LEADER_SELF(HttpStatus.BAD_REQUEST, "스터디장 본인은 팀을 탈퇴할 수 없습니다."), | ||
; | ||
|
||
private final HttpStatus httpStatus; | ||
private final String errorMessage; | ||
|
||
ParticipantExceptionType(final HttpStatus httpStatus, final String errorMessage) { | ||
this.httpStatus = httpStatus; | ||
this.errorMessage = errorMessage; | ||
} | ||
|
||
@Override | ||
public HttpStatus httpStatus() { | ||
return httpStatus; | ||
} | ||
|
||
@Override | ||
public String errorMessage() { | ||
return errorMessage; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.