-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/create letter(wr9-22) #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ณ๊ฑฐ๋ ์๋์ง๋ง.. ๋ฉ์๋๋ช ์ ๋จ์๋ก ๋ฐ๊ฟ๋ณด์๋๊ฑด ์ด๋จ๊น์??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ต ๊ณ ์น๊ฒ ์ต๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BaseTimeEntity๊ฐ ์๋๋ฐ ์์์ ์ ๋ฐ์ ์ด์ ๊ฐ ์์ผ์ค๊น์?
createdAt์ด๋ updatedAt ํ๋๊ฐ ์ค๋ณต ์ ์ธ๋ ๊ฒ ๊ฐ์์ ๋ณด๊ฐ ์ฐจ ์ง๋ฌธ๋๋ฆฝ๋๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ LetterMatching ์ด๋ LetterMatchingTimeout์ ๋ผ๋๋ง ์ก๊ณ ์์ง ๊ตฌํ์ ์ํ์ต๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฉ์๋๋ช write()๋ฅผ createLetter()์ ๊ฐ์ด ํต์ผํ๋ ๊ฑด ์ด๋จ๊น์?
ํ์ฌ Letter.builder() ํธ์ถ์ด if-else๋ก ๋๋์ด ์์ด์ ๊ณตํต ๋ถ๋ถ๋ ์ค๋ณต์ผ๋ก ์์ฑ๋ ๊ฒ ๊ฐ์์.
๊ณตํต๋๋ ํ๋ ์ค์ ์ ๋จผ์ ํ ๋ฒ๋ง ์์ฑํ๊ณ ,
๋ฌ๋ผ์ง๋ ๋ถ๋ถ๋ง if-else๋ก ์ฒ๋ฆฌํ๋ฉด ์ด๋จ๊น ํ๋๊ฒ ์ ์๊ฐ์
๋๋ค..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ ๊น๋ํด์ง๊ฑฐ ๊ฐ์ต๋๋ค ๊ณ ์น๊ฒ ์ต๋๋ค~
public interface LetterControllerDocs { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ์ธํฐํ์ด์ค๋ ๋ฌด์จ ์ญํ ์ ํ๋ ํ์ผ์ผ๊น์?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ปจํธ๋กค๋ฌ์ Swagger ์ด๋ ธํ ์ด์ ์ด ์ฌ๊ธฐ์ ๊ธฐ ๋ถ์ด ์๋ ๊ฒ์ ํผํ๊ธฐ ์ํด์ ์ผ๋จ ๋ง๋ค์ด ๋์ต๋๋ค
* } | ||
*/ | ||
@Getter | ||
public class LetterResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํธ์ง๋ฅผ ๋ณด๋ธ ํ์ Response๋ผ๋ฉด ์ข ๋ ๊ฐ์ฒด๋ช ์ ๋ช ํํ๊ฒ ํํํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์!(ex. CreateLetterResponse)
ํธ์ง ์กฐํ ์์ฑ ์์ ๋ฑ์์ ๊ณตํต์ผ๋ก ์ฌ์ฉํ์ค ๊ฒ์ด๋ผ๋ฉด ๋ ๋ฌ๋ ์๊ด ์์ ๊ฒ ๊ฐ์ต๋๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํธ์ง๋ฅผ ๋ณด๋ธ ํ์ Response๋ผ์ ๊ฐ์ฒด๋ช ๋ณ๊ฒฝํ๊ฒ ์ต๋๋ค~
@Builder | ||
public LetterResponse(Long letterId, Long writerId, Long receiverId, Long parentLetterId, String title, String content, Category category, PaperType paperType, FontType font, DeliveryStatus deliveryStatus, LocalDateTime deliveryStartedAt, LocalDateTime deliveryCompletedAt) { | ||
this.letterId = letterId; | ||
this.writerId = writerId; | ||
this.receiverId = receiverId; | ||
this.parentLetterId = parentLetterId; | ||
this.title = title; | ||
this.content = content; | ||
this.category = category; | ||
this.paperType = paperType; | ||
this.font = font; | ||
this.deliveryStatus = deliveryStatus; | ||
this.deliveryStartedAt = deliveryStartedAt; | ||
this.deliveryCompletedAt = deliveryCompletedAt; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ชจ๋ ํ๋๋ฅผ ๊ธฐ์ค์ผ๋ก ์์ฑ์๋ฅผ ๋ง๋ค์ด์ ๋น๋ํจํด์ ์ ์ฉ์ํค๋ ค๊ณ ํ๊ณ ์๊ตฐ์!
์ด๋ด ๊ฒฝ์ฐ์๋ ํด๋์ค ์์ฒด์ @builder๋ฅผ ์ ์ฉ์ํค๋ฉด ์ด ๋ถ๋ถ์ ์๋ต๋์ด๋ ๋ ๊ฒ ๊ฐ์์.
๋ค๋ง ์ฌ๊ธฐ์ ์๊ฐํด๋ด์ผํ ๊ฒ์ ์๋ง ์์ฑ์์ ์ญํ ์ ํธ์ง ์ํฐํฐ๋ฅผ Response๋ก ๋ณํํด์ฃผ๊ธฐ ์ํด ์ฌ์ฉํ๋ ๋๋์ผ๋ก ๋ง๋์ ๊ฒ ๊ฐ์์!(์์ง ์ ์ฒด์ ์ธ ์ฝ๋๋ฅผ ์์ง ๋ณด์ง ์์์ต๋๋ค)
์ ์ ์์์ด ๋ง๋ค๋ฉด ์ ์ ํฉํ ๋ฆฌ ๋ฉ์๋ ํจํด public static LetterResponse from(Letter letter) { ... } ์ด๋ฐ์์ผ๋ก ๋ง๋ค ๊ฒ ๊ฐ์์(from์ด๋ผ๋ ๋ช ์นญ์ ์ผ๋ฐ์ ์ผ๋ก ๋ง์ด ์ฌ์ฉ๋๊ณ ์๋ ๋ฉ์๋ ๋ช ์ด๋ผ์ ์ ๋ ๊ฒ ์ ์ด๋ดค์ต๋๋ค.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ์ต๊ด์ฒ๋ผ ๋ง๋ค์ด ๋ฒ๋ ธ๋ค์ ๊ณ ์น๊ฒ ์ต๋๋ค~
public static LetterResponse fromEntity(Letter letter) { | ||
return LetterResponse.builder() | ||
.letterId(letter.getId()) | ||
.writerId(letter.getWriterId()) | ||
.receiverId(letter.getReceiverId()) | ||
.parentLetterId(letter.getParentLetterId()) | ||
.title(letter.getTitle()) | ||
.content(letter.getContent()) | ||
.category(letter.getCategory()) | ||
.paperType(letter.getPaperType()) | ||
.font(letter.getFontType()) | ||
.deliveryStatus(letter.getDeliveryStatus()) | ||
.deliveryStartedAt(letter.getDeliveryStartedAt()) | ||
.deliveryCompletedAt(letter.getDeliveryCompletedAt()) | ||
.build(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ๋ฐ์ ์ด๋ ๊ฒ ์ ์ด์ฃผ์
จ๊ตฌ๋.... ์ด๋ฏธ ์ ์ฌ์ฉํ๊ณ ๊ณ์
จ๊ตฐ์...
๊ทธ๋ผ ์์ฑ์ ๋ถ๋ถ์ ์ง์ฐ๊ณ ์ฐจ๋ผ๋ฆฌ ํด๋์ค์์ฒด์ @builder ๋ผ๋ ์ด๋
ธํ
์ด์
์ ์ ์ฉ์ํค๋ฉด ์์ฑ์ ๋ถ๋ถ์ ์์ ์ญ์ ์ํฌ ์ ์์ต๋๋ค~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ต ํ์ธํ์ต๋๋ค
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PUBLIC) | ||
@Table(name = "letter_matchings") | ||
public class LetterMatching { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BaseTimeEntity ๋๋ฝ ๋์ด์๋ค์ฌ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ต ํ์ธํ์ต๋๋ค ๊ฐ์ฌํฉ๋๋ค
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERD ๊ธฐ์ค์ผ๋ก ์์ง ํ๋๋ค์ด ๋ค ์ค์ ์๋์ด์๋ ๊ฒ ๊ฐ๋ค์!
์ถํ์ ํด๋น ๊ธฐ๋ฅ ๋ง๋์ค๋ ํ๋ ค๊ณ ํ์ ๊ฑฐ๊ฒ ์ฃ ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ต LetterMatching ์ด๋ LetterMatchingTimeout์ ๋ผ๋๋ง ์ก๊ณ ์์ง ๊ตฌํ์ ์ํ์ต๋๋ค
# Conflicts: # src/main/java/io/crops/warmletter/global/config/SecurityConfig.java
Pull Request Template
๐ PR ์ค๋ช
๐ ์ฃผ์ ๋ณ๊ฒฝ์ฌํญ
๐ธ ์คํฌ๋ฆฐ์ท (์ ํ์ฌํญ)
๐งช ํ ์คํธ
โ ์ฒดํฌ๋ฆฌ์คํธ
๐ค ๊ด๋ จ ์ด์