-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from Gongjakso/fix/team
fix: Team API 업데이트 및 오류 수정
- Loading branch information
Showing
8 changed files
with
87 additions
and
21 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
22 changes: 20 additions & 2 deletions
22
src/main/java/com/gongjakso/server/domain/team/enumerate/TeamStatus.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 |
---|---|---|
@@ -1,20 +1,38 @@ | ||
package com.gongjakso.server.domain.team.enumerate; | ||
|
||
import com.gongjakso.server.global.exception.ApplicationException; | ||
import com.gongjakso.server.global.exception.ErrorCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString | ||
public enum TeamStatus { | ||
|
||
ACTIVE("모집 중"), | ||
RECRUITING("모집 중"), | ||
EXTENSION("모집 연장"), | ||
CANCELED("모집 취소"), | ||
CLOSED("모집 마감"),; | ||
CLOSED("모집 마감"), | ||
ACTIVE("활동 중"), | ||
FINISHED("활동 종료"); | ||
|
||
private final String description; | ||
|
||
TeamStatus(String description) { | ||
this.description = description; | ||
} | ||
|
||
/** | ||
* 활동 중 또는 활동 종료를 업데이트할 때 유효성 검사하는 메소드 | ||
* @param status 입력받은 활동 문자열 (한국어) | ||
* @return 해당 문자열에 해당하는 ENUM 값 | ||
*/ | ||
public static TeamStatus checkActiveORFinished(String status) { | ||
if(status.equals(ACTIVE.getDescription())) { | ||
return ACTIVE; | ||
} else if(status.equals(FINISHED.getDescription())) { | ||
return FINISHED; | ||
} | ||
throw new ApplicationException(ErrorCode.INVALID_TEAM_STATUS_EXCEPTION); | ||
} | ||
} |
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