-
Notifications
You must be signed in to change notification settings - Fork 3
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
…ion-suggestion 미션 제안하기
- Loading branch information
Showing
14 changed files
with
865 additions
and
6 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
11 changes: 11 additions & 0 deletions
11
...rver/src/main/java/swm/hkcc/LGTM/app/modules/suggestion/dto/DeleteSuggestionResponse.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,11 @@ | ||
package swm.hkcc.LGTM.app.modules.suggestion.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class DeleteSuggestionResponse { | ||
private Long suggestionId; | ||
private Boolean success; | ||
} |
42 changes: 42 additions & 0 deletions
42
API-Server/src/main/java/swm/hkcc/LGTM/app/modules/suggestion/dto/SuggestionDto.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,42 @@ | ||
package swm.hkcc.LGTM.app.modules.suggestion.dto; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import swm.hkcc.LGTM.app.modules.suggestion.domain.Suggestion; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
public class SuggestionDto { | ||
private static final String LIKE_BIG_NUMBER = "999+"; | ||
@NotNull | ||
private Long suggestionId; | ||
@NotNull | ||
private String title; | ||
@NotNull | ||
private String description; | ||
@NotNull | ||
private LocalDateTime date; | ||
@NotNull | ||
private String likeNum; | ||
@NotNull | ||
private Boolean isLiked; | ||
@NotNull | ||
private Boolean isMyPost; | ||
|
||
public static SuggestionDto from(Suggestion suggestion, Integer likeNum, Boolean isLiked, Boolean isMyPost) { | ||
return SuggestionDto.builder() | ||
.suggestionId(suggestion.getSuggestionId()) | ||
.title(suggestion.getTitle()) | ||
.description(suggestion.getDescription()) | ||
.date(suggestion.getCreatedAt()) | ||
.likeNum(likeNum < 1000 ? likeNum.toString() : LIKE_BIG_NUMBER) | ||
.isLiked(isLiked) | ||
.isMyPost(isMyPost) | ||
.build(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
API-Server/src/main/java/swm/hkcc/LGTM/app/modules/suggestion/dto/SuggestionListDto.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,20 @@ | ||
package swm.hkcc.LGTM.app.modules.suggestion.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
public class SuggestionListDto { | ||
private final String infoTitle = "\uD83D\uDC4B 어떤 미션이 필요한지 알려주세요!"; | ||
private final String infoDescription = "여러분을 위한 미션이 무엇인지 의견을 남겨주세요.\n리뷰어들이 미션을 제작하는데 큰 도움이 됩니다."; | ||
private List<SuggestionDto> suggestions; | ||
|
||
public static SuggestionListDto from(List<SuggestionDto> suggestions) { | ||
return SuggestionListDto.builder() | ||
.suggestions(suggestions) | ||
.build(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...rver/src/main/java/swm/hkcc/LGTM/app/modules/suggestion/exception/NotExistSuggestion.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,10 @@ | ||
package swm.hkcc.LGTM.app.modules.suggestion.exception; | ||
|
||
import swm.hkcc.LGTM.app.global.constant.ResponseCode; | ||
import swm.hkcc.LGTM.app.global.exception.GeneralException; | ||
|
||
public class NotExistSuggestion extends GeneralException { | ||
public NotExistSuggestion() { | ||
super(ResponseCode.NOT_EXIST_SUGGESTION); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
API-Server/src/main/java/swm/hkcc/LGTM/app/modules/suggestion/exception/NotMySuggestion.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,10 @@ | ||
package swm.hkcc.LGTM.app.modules.suggestion.exception; | ||
|
||
import swm.hkcc.LGTM.app.global.constant.ResponseCode; | ||
import swm.hkcc.LGTM.app.global.exception.GeneralException; | ||
|
||
public class NotMySuggestion extends GeneralException { | ||
public NotMySuggestion() { | ||
super(ResponseCode.NOT_MY_SUGGESTION); | ||
} | ||
} |
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.