Skip to content
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

Merged
merged 23 commits into from
Feb 19, 2025
Merged

Conversation

Kojinyoung7220
Copy link
Collaborator

@Kojinyoung7220 Kojinyoung7220 commented Feb 19, 2025

Pull Request Template

๐Ÿ“ PR ์„ค๋ช…

  • Letter ์—”ํ‹ฐํ‹ฐ ์„ค๊ณ„, enum ๊ฐ’ ์„ค์ •, LetterController , LetterService ๋กœ์ง ๊ตฌํ˜„
  • CreateLetterRequest, LetterResponse DTO ๊ตฌํ˜„,
  • LettersControllerTest, LetterServiceTest ํ…Œ์ŠคํŠธ ๊ตฌํ˜„
  • local ํ™˜๊ฒฝ, test ํ™˜๊ฒฝ ๊ฐ๊ฐ mysql, h2๋กœ db ๋ถ„๋ฆฌ

๐Ÿ” ์ฃผ์š” ๋ณ€๊ฒฝ์‚ฌํ•ญ

  • application.yml ํŒŒ์ผ on-profile: test ๋ถ€๋ถ„ ์ œ๊ฑฐ
  • application-test.yml ์ถ”๊ฐ€ ํ›„ ์ธ๋ฉ”๋ชจ๋ฆฌ h2 db ์„ธํŒ…, ํ…Œ์ŠคํŠธ ์ฝ”๋“œ์— ์–ด๋…ธํ…Œ์ด์…˜ ์ถ”๊ฐ€

๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท (์„ ํƒ์‚ฌํ•ญ)

  • UI ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์žˆ๋‹ค๋ฉด ์Šคํฌ๋ฆฐ์ƒท์„ ์ฒจ๋ถ€ํ•ด์ฃผ์„ธ์š”.

๐Ÿงช ํ…Œ์ŠคํŠธ

  • ๋‹จ์œ„ ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€/์ˆ˜์ •
  • ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ ํ™•์ธ
  • ์†Œ๋‚˜ํด๋ผ์šฐ๋“œ ํ’ˆ์งˆ ๊ฒŒ์ดํŠธ ํ†ต๊ณผ

โœ… ์ฒดํฌ๋ฆฌ์ŠคํŠธ

  • ์ฝ”๋“œ ์ปจ๋ฒค์…˜์„ ์ค€์ˆ˜ํ–ˆ๋‚˜์š”?
  • ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ๋‚˜ ์ฃผ์„์ด ์—†๋‚˜์š”?
  • ๋ธŒ๋žœ์น˜ ๋„ค์ด๋ฐ ์ปจ๋ฒค์…˜์„ ๋”ฐ๋ž๋‚˜์š”?
  • ๊ด€๋ จ ๋ฌธ์„œ๋ฅผ ์—…๋ฐ์ดํŠธํ–ˆ๋‚˜์š”?

๐Ÿค ๊ด€๋ จ ์ด์Šˆ

  • closes #์ด์Šˆ๋ฒˆํ˜ธ

@Kojinyoung7220 Kojinyoung7220 added โš™ Setting ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ธํŒ… โœจ Feature ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ โœ… Test test ๊ด€๋ จ(storybook, jest...) labels Feb 19, 2025
@Kojinyoung7220 Kojinyoung7220 self-assigned this Feb 19, 2025
@Kojinyoung7220 Kojinyoung7220 linked an issue Feb 19, 2025 that may be closed by this pull request
10 tasks
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ณ„๊ฑฐ๋Š” ์•„๋‹ˆ์ง€๋งŒ.. ๋ฉ”์„œ๋“œ๋ช…์„ ๋‹จ์ˆ˜๋กœ ๋ฐ”๊ฟ”๋ณด์‹œ๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„ต ๊ณ ์น˜๊ฒ ์Šต๋‹ˆ๋‹ค

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BaseTimeEntity๊ฐ€ ์žˆ๋Š”๋ฐ ์ƒ์†์„ ์•ˆ ๋ฐ›์€ ์ด์œ ๊ฐ€ ์žˆ์œผ์‹ค๊นŒ์š”?
createdAt์ด๋ž‘ updatedAt ํ•„๋“œ๊ฐ€ ์ค‘๋ณต ์„ ์–ธ๋œ ๊ฒƒ ๊ฐ™์•„์„œ ๋ณด๊ฐ• ์ฐจ ์งˆ๋ฌธ๋“œ๋ฆฝ๋‹ˆ๋‹ค!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„ LetterMatching ์ด๋ž‘ LetterMatchingTimeout์€ ๋ผˆ๋Œ€๋งŒ ์žก๊ณ  ์•„์ง ๊ตฌํ˜„์€ ์•ˆํ–ˆ์Šต๋‹ˆ๋‹ค

Copy link
Collaborator

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๋กœ ์ฒ˜๋ฆฌํ•˜๋ฉด ์–ด๋–จ๊นŒ ํ•˜๋Š”๊ฒŒ ์ œ์ƒ๊ฐ์ž…๋‹ˆ๋‹ค..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋” ๊น”๋”ํ•ด์งˆ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค ๊ณ ์น˜๊ฒ ์Šต๋‹ˆ๋‹ค~

Comment on lines +3 to +4
public interface LetterControllerDocs {
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ์ธํ„ฐํŽ˜์ด์Šค๋Š” ๋ฌด์Šจ ์—ญํ• ์„ ํ•˜๋Š” ํŒŒ์ผ์ผ๊นŒ์š”?!

Copy link
Collaborator Author

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํŽธ์ง€๋ฅผ ๋ณด๋‚ธ ํ›„์˜ Response๋ผ๋ฉด ์ข€ ๋” ๊ฐ์ฒด๋ช…์„ ๋ช…ํ™•ํ•˜๊ฒŒ ํ‘œํ˜„ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!(ex. CreateLetterResponse)

ํŽธ์ง€ ์กฐํšŒ ์ƒ์„ฑ ์ˆ˜์ • ๋“ฑ์—์„œ ๊ณตํ†ต์œผ๋กœ ์‚ฌ์šฉํ•˜์‹ค ๊ฒƒ์ด๋ผ๋ฉด ๋ƒ…๋‘ฌ๋„ ์ƒ๊ด€ ์—†์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํŽธ์ง€๋ฅผ ๋ณด๋‚ธ ํ›„์˜ Response๋ผ์„œ ๊ฐ์ฒด๋ช… ๋ณ€๊ฒฝํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค~

Comment on lines 64 to 78
@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;
}
Copy link
Collaborator

@leeys9423 leeys9423 Feb 19, 2025

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์ด๋ผ๋Š” ๋ช…์นญ์€ ์ผ๋ฐ˜์ ์œผ๋กœ ๋งŽ์ด ์‚ฌ์šฉ๋˜๊ณ  ์žˆ๋Š” ๋ฉ”์„œ๋“œ ๋ช…์ด๋ผ์„œ ์ €๋ ‡๊ฒŒ ์ ์–ด๋ดค์Šต๋‹ˆ๋‹ค.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„ ์Šต๊ด€์ฒ˜๋Ÿผ ๋งŒ๋“ค์–ด ๋ฒ„๋ ธ๋„ค์š” ๊ณ ์น˜๊ฒ ์Šต๋‹ˆ๋‹ค~

Comment on lines 81 to 96
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();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„ ๋ฐ‘์— ์ด๋ ‡๊ฒŒ ์ ์–ด์ฃผ์…จ๊ตฌ๋‚˜.... ์ด๋ฏธ ์ž˜ ์‚ฌ์šฉํ•˜๊ณ  ๊ณ„์…จ๊ตฐ์š”...
๊ทธ๋Ÿผ ์ƒ์„ฑ์ž ๋ถ€๋ถ„์€ ์ง€์šฐ๊ณ  ์ฐจ๋ผ๋ฆฌ ํด๋ž˜์Šค์ž์ฒด์— @builder ๋ผ๋Š” ์–ด๋…ธํ…Œ์ด์…˜์„ ์ ์šฉ์‹œํ‚ค๋ฉด ์ƒ์„ฑ์ž ๋ถ€๋ถ„์„ ์•„์˜ˆ ์‚ญ์ œ ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค~

Copy link
Collaborator Author

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BaseTimeEntity ๋ˆ„๋ฝ ๋˜์–ด์žˆ๋„ค์—ฌ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„ต ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERD ๊ธฐ์ค€์œผ๋กœ ์•„์ง ํ•„๋“œ๋“ค์ด ๋‹ค ์„ค์ • ์•ˆ๋˜์–ด์žˆ๋Š” ๊ฒƒ ๊ฐ™๋„ค์š”!

์ถ”ํ›„์— ํ•ด๋‹น ๊ธฐ๋Šฅ ๋งŒ๋“œ์‹ค๋•Œ ํ•˜๋ ค๊ณ  ํ•˜์‹ ๊ฑฐ๊ฒ ์ฃ ??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„ต LetterMatching ์ด๋ž‘ LetterMatchingTimeout์€ ๋ผˆ๋Œ€๋งŒ ์žก๊ณ  ์•„์ง ๊ตฌํ˜„์€ ์•ˆํ–ˆ์Šต๋‹ˆ๋‹ค

@Kojinyoung7220 Kojinyoung7220 changed the title Feature/create letter(wr9 22) Feature/create letter(wr9-22) Feb 19, 2025
@Kojinyoung7220 Kojinyoung7220 merged commit 7cf999a into dev Feb 19, 2025
1 check failed
@Kojinyoung7220 Kojinyoung7220 deleted the feature/create-letter(WR9-22) branch February 19, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
โœจ Feature ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ โš™ Setting ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ธํŒ… โœ… Test test ๊ด€๋ จ(storybook, jest...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WR9-22] ํŽธ์ง€ ์ƒ์„ฑ
3 participants