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

[FEAT] 작품평가 생성 API 구현 #70

Merged
merged 73 commits into from
Jun 29, 2024
Merged

[FEAT] 작품평가 생성 API 구현 #70

merged 73 commits into from
Jun 29, 2024

Conversation

rinarina0429
Copy link
Contributor

@rinarina0429 rinarina0429 commented Jun 14, 2024

Related Issue

Key Changes

작품평가를 생성하는 API를 구현하였습니다.

  • 서재에 등록이 되어 있지 않은 경우에 작품평가로 서재에 등록하는 기능을 합니다.
  • 서재에 등록되면 Novel, UserStatistics, NovelStatistics 내의 해당 필드들이 증가합니다. NovelStatistics와 UserStatistics의 경우, 필드가 많은데 필드마다 count를 하나씩 늘려주는 함수를 쓰는 것이 아니라 필드 이름을 받는 increaseField()increaseFieldByAmount()를 만들었습니다.
  • dto에서 userNovelRating은 validator를 따로 만들어줬습니다.(@UserNovelRatingConstraint)
  • EmailGetReponse가 중간에 user 파일에서 User 파일로 옮겨졌는데, 경로가 바뀌지 않은 문제가 있어 실행이 안돼 함께 수정하였습니다.

To Reviewers

  • [Comment로 달지 못한 질문] RecentUserNovel의 역할이 기억이 안나는데요,, 왜 만들었던걸까요? 작품 평가 생성으로 서재 등록 시 해당 테이블을 건드려야 할까요?
  • UserNovelService 내 createUserNovel에서 매력포인트 테이블이 userNovel이 만들어진 후 생성되어야 해 유저노벨에서 매력포인트를 null값으로 넣어주고 유저노벨 생성 완료 후 매력표인트를 다시 넣어주는 방식을 사용하는데요... 혹시 더 좋은 방법이 있을까요?
  • NovelKeywords에서 userId, novelId, keywordId를 가지는데, 의미 상 UserNovelKeywords로 바꾸는게 더 좋지 않나... 라는 생각이 들어 의견 여쭙니다~
  • increaseField()increaseFieldByAmount()를 만들었는데, 그냥 @Setter를 사용하는 것이 나을지 의견 부탁드림니다!
  • 원래 단톡방에서, 존재하는 User의 UserStatistics가 존재하지 않거나, Novel의 NovelStatistics가 존재하지 않는 경우 Statistics를 만들어주는 방식으로 코드를 짜자고 했었는데, 아직 존재하지 않으면 Exception을 터트려 주는 방식으로 뒀습니다. 이유라 함은.. 예를 들어 만약 유저가 이미 기록이 있어 Statistics에 83829... 등의 값이 있어야 하는데, Statistics를 찾지 못한 경우 그냥 UserStatistics를 추가해버리면 그냥 초기화된 0000...의 옳지 않은 값이 들어가는게 이상한 것 같습니다. 그래서 유저나 작품 추가 시에 Statistics도 함께 만들어주는 방향으로 하고, 통계를 못찾을 경우 Exception을 터트려 주는게 더 괜찮다고 생각했는데 어떻게 생각하시나요..?

References

@rinarina0429 rinarina0429 self-assigned this Jun 14, 2024
Copy link
Contributor

@Kim-TaeUk Kim-TaeUk left a comment

Choose a reason for hiding this comment

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

코멘트 확인바랍니다~
고생하셨어요! 리뷰가 늦어서 죄송합니다 ㅜㅜ

Copy link
Member

@ChaeAg ChaeAg left a comment

Choose a reason for hiding this comment

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

수고 많으셨어용 +-+ !!

@rinarina0429 rinarina0429 merged commit c2b4a33 into dev Jun 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 작품평가 생성 API 구현
3 participants