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:CHAT-152-BE-api-월별-일기-리스트-조회 #24

Merged
merged 9 commits into from
Jan 30, 2024

Conversation

Mouon
Copy link
Member

@Mouon Mouon commented Jan 21, 2024

요약 (Summary)

  • TagInfoDTO를 추가해 엔티티 객체의 노출을 줄였고 반환에 사진,태그 내용 제목등을 포함 하도록 수정하였습니다.

변경 사항 (Changes)

DiaryInquiryController 클래스 추가
TagInfoDTO 클래스 추가 (순환 참조 오류 발생으로 tag DTO도 작성)(llegalStateException: Cannot call sendError() after the response has been committed 오류)
DiaryInquiryRepository 클래스 수정
DiaryInquiryService 클래스 수정

리뷰 요구사항

  • [ ]TagInfoDTO 클래스의 필드 및 구조가 올바르게 설정되었는지 확인해주세요.(제가 문제가 있었던 부분이라 맞는지 모르겠네요..)
  • DiaryInquiryRepository 클래스: DiaryInquiryRepository 클래스의 수정 부분에 대한 리뷰를 진행해주세요. 특히, inquiryDiaryRange 메서드에서 DTO를 생성하는 부분이 올바르게 동작하는지 확인해주세요. 이 부분도 오류가 발생했던 부분이라 지금도 이상있는지 확인 부탁드립니다.
  • API가 기능 요구 사항대로 잘 작동하는지 확인해 주세요

확인 방법 (선택)

스크린샷 2024-01-29 오전 12 50 19

포스트맨을 통해 확인가능합니다.
쿼리는 다인님 다이어리 상세 PR에 있는 쿼리를 변형해서 이용하였습니다.

SELECT * FROM chatdiary.chat;

INSERT INTO member (email, password, create_at, update_at)
VALUES ("aa@aa", "123", NOW(), NOW());

INSERT INTO diary (user_id, diary_date, title, content,create_at, update_at)
VALUES (1,"20240101","1title", "1content", NOW(), NOW()),
(1,"20240102","2title", "2content", NOW(), NOW());

INSERT INTO tag (category, tag_name)
VALUES ("감정", "기쁨"), ("감정", "슬픔"), ("인물", "친구"), ("인물", "가족");

INSERT INTO diarytag (diary_id, tag_id)
VALUES (1,1),(1,2),(1,3),(1,4),(2,3),(2,4);

INSERT INTO chat (sender, content, chat_type, user_id, create_at)
VALUES ("USER", "", "IMG", 1, NOW()),("USER", "", "IMG", 1, NOW()),("LULU", "", "CHAT", 1, NOW()),("CHICHI", "", "CHAT", 1, NOW());

INSERT INTO photo (image_url)
VALUES ("1imageUrl"), ("2imageUrl");

INSERT INTO diaryphoto (diary_id, photo_id)
VALUES (1, (SELECT photo_id FROM photo WHERE image_url = "1imageUrl")),
(1, (SELECT photo_id FROM photo WHERE image_url = "2imageUrl"));

요청 예시:http://localhost:8080/get-monthly-diary?user_id=1&year=2024&month=1

Copy link
Contributor

@nonaninona nonaninona left a comment

Choose a reason for hiding this comment

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

API 명세서 깔끔하게 작성하신 것 같습니다!

PR은 이전에 비해 수정되었다는 언급만 있고 이전에 어땠는지 안나와있는 점이 아쉽습니다.
이전에 브랜치를 삭제하고 다시 만드시면서 간과한 것 아닌가 싶네요

이 밖에도 엔드포인트나 쿼리에 대한 코멘트 남겨봅니다~

Copy link
Collaborator

@dainshon dainshon left a comment

Choose a reason for hiding this comment

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

수고하셨어요:)

Tag 엔티티 직접 가져오려니 데이터 더 추가시 순환 참조 오류 발생 우려있어서
TagDTO 추가해서 해결
Tag 엔티티 직접 가져오려니 데이터 더 추가시 순환 참조 오류 발생 우려있어서
TagDTO 추가해서 해결, 엔티티 객체 직접 참조 안함
리뷰 반영해서 쉬운이름으로 개선
.size 또한 제외하였습니다.
diaryphoto가 추가됨에 따라 쿼리 로직 수정
@nonaninona nonaninona force-pushed the CHAT-152-BE-API-월별-일기-리스트-조회 branch from 0e45eba to 902b59a Compare January 29, 2024 18:51
Copy link
Contributor

@nonaninona nonaninona left a comment

Choose a reason for hiding this comment

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

바뀐 ERD로 rebase 해두었습니다

@nonaninona nonaninona merged commit f9f5915 into develop Jan 30, 2024
2 checks passed
@nonaninona nonaninona deleted the CHAT-152-BE-API-월별-일기-리스트-조회 branch February 4, 2024 20:21
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.

3 participants