-
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 #168 from prgrms-web-devcourse-final-project/refac…
- Loading branch information
Showing
20 changed files
with
196 additions
and
45 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
29 changes: 29 additions & 0 deletions
29
src/main/java/postman/bottler/letter/dto/LetterDeleteDTO.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,29 @@ | ||
package postman.bottler.letter.dto; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import postman.bottler.letter.domain.BoxType; | ||
import postman.bottler.letter.domain.LetterType; | ||
import postman.bottler.letter.dto.request.LetterDeleteRequestDTO; | ||
import postman.bottler.letter.dto.request.ReplyLetterDeleteRequestDTO; | ||
|
||
public record LetterDeleteDTO( | ||
@NotNull(message = "Letter ID는 필수입니다.") Long letterId, | ||
@NotNull(message = "Letter Type은 필수입니다.") LetterType letterType, | ||
@NotNull(message = "Box Type은 필수입니다.") BoxType boxType | ||
) { | ||
public static LetterDeleteDTO fromLetter(LetterDeleteRequestDTO letterDeleteRequestDTO) { | ||
return new LetterDeleteDTO( | ||
letterDeleteRequestDTO.letterId(), | ||
LetterType.LETTER, | ||
letterDeleteRequestDTO.boxType() | ||
); | ||
} | ||
|
||
public static LetterDeleteDTO fromReplyLetter(ReplyLetterDeleteRequestDTO replyLetterDeleteRequestDTO) { | ||
return new LetterDeleteDTO( | ||
replyLetterDeleteRequestDTO.letterId(), | ||
LetterType.REPLY_LETTER, | ||
replyLetterDeleteRequestDTO.boxType() | ||
); | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/main/java/postman/bottler/letter/dto/request/ReplyLetterDeleteRequestDTO.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,16 @@ | ||
package postman.bottler.letter.dto.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import postman.bottler.letter.domain.BoxType; | ||
|
||
public record ReplyLetterDeleteRequestDTO( | ||
@NotNull(message = "Letter ID는 필수입니다.") Long letterId, | ||
@NotNull(message = "Box Type은 필수입니다.") BoxType boxType | ||
) { | ||
public static ReplyLetterDeleteRequestDTO of(Long letterId, BoxType boxType) { | ||
return new ReplyLetterDeleteRequestDTO( | ||
letterId, | ||
boxType | ||
); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/postman/bottler/letter/exception/LetterAuthorMismatchException.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,7 @@ | ||
package postman.bottler.letter.exception; | ||
|
||
public class LetterAuthorMismatchException extends RuntimeException { | ||
public LetterAuthorMismatchException(String message) { | ||
super(message); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
src/main/java/postman/bottler/letter/exception/UnauthorizedLetterAccessException.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,7 @@ | ||
package postman.bottler.letter.exception; | ||
|
||
public class UnauthorizedLetterAccessException extends RuntimeException { | ||
public UnauthorizedLetterAccessException(String message) { | ||
super(message); | ||
} | ||
} |
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.