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-156-BE-API-일기상세조회 #14

Merged
merged 6 commits into from
Jan 22, 2024

Conversation

dainshon
Copy link
Collaborator

@dainshon dainshon commented Jan 19, 2024

요약 (Summary)

  • 일기 상세 조회 API 구현

변경 사항 (Changes)

  • 엔드포인트(/diary/detail) 로 작성
  • dto, repository, service 생성
  • dto/diary: DiaryShowDetailResponse
  • repository: DiaryRepository
  • service: DiaryService
  • (추가) imgUrl, tagName만 list 형태로 반환하도록 변경했습니다. (�기존에는 일기 하나의 정보를 가져오는데 title, content는 계속 중복되는 문제?가 있었음. title)

리뷰 요구사항

  • dto 값들이 명세서대로 들어가있는지
  • �쿼리문이 의도대로 동작하는지
  • 이름, 파일 구조가 네이밍 규칙을 따르는지

확인 방법 (선택)

Postman을 통해 확인 가능할 것 같습니다.
각자 local db에서 테스트해주세요. (제 local db에서는 잘동작하지만 다른 데이터에서는 어떨지 모르니)

  • diary_date타입이 date로 바뀌어 "2024-01-01" 형태로 넣어야합니다-! ("20240101" X)
image 결과: { "diaryDate": "2024-01-01", "title": "1title", "imgUrl": [ "1imageUrl", "2imageUrl" ], "content": "1content", "tagName": [ "기쁨", "슬픔" ] }

<sample diary 정보 넣는 SQL>
`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);

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 (diary_id, chat_id, image_url)
VALUES (1, 1, "1imageUrl"), (1, 2, "2imageUrl");`

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.

  1. PR 설명을 되게 깔끔하게 잘한 것 같습니다!

  2. 명세서에 대한 근본적인 의문이 드는데,
    일기 상세를 조회하는 거면 일기 1개의 정보를 조회하는 것이 아닌가요?
    만약에 1개의 정보를 조회하는 것이라면,
    List<DiaryShowDetailResponse>가 아니라
    DiaryShowDetailResponse 1개만 body에 실려서 와야할 것 같고,
    img_url과 tag_name을 list로 구성해야하지 않을까 싶습니다.

  3. query는 3개 조인 앞에서 무릎을 꿇어서 잘 모르겠습니다.

  4. sample diary를 DB에 넣는 SQL 문을 제시해주면 리뷰어들이 편리할 것 같습니다

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 명세도 잘 바뀐 것 확인했습니다!

수정사항 반영/API 명세서 수정까지 되게 꼼꼼하게 잘하네요 🤭👍

showDiaryDetail에서 해당하는 diary가 없을 경우의 처리는 어떻게 하는게 좋을지 고민해보는 것도 좋을 것 같아요!

다른 분들의 리뷰를 기다리며 저는 Approve 하겠슴다~

Copy link
Member

@Mouon Mouon left a comment

Choose a reason for hiding this comment

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

데이터가 이상없이 들어오는 것 확인했습니다.
로그랑 클래스 명모두 네이밍 규칙을 잘 따르는 것 같습니다.
PR에 리뷰를 위한 정보도 적절해서 좋았습니다!
수고하셨습니다.

@dainshon dainshon merged commit b0f52a5 into develop Jan 22, 2024
2 checks passed
@nonaninona nonaninona deleted the CHAT-156-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