Skip to content

Conversation

@gitseoyeon
Copy link
Member

Summary

변경 응답 구조

[
    {
       "id" :  id,
        "name": "예약명",
        "description":   "설명" ,
        "price": 00,
        "imageUrl": "사진url",
        "reservations": [
            {
                "date":  날짜,
                "times": [
                    { "id":, "times": "18:00", "status": "EMPTY" },
                    ...
                ]
            },
            {
                "date": ,
                "times": [
                    { "id":, "times": "19:00", "status": "RESERVED" },
                    ...
                ]
            }
        ]
    },
    ...
]

Key Changes

  • 기존에 response에서 dto 값을 매핑 한 과정을 service에서 매핑하도록 수정했습니다.
  • 예약 name 별로 그룹화 시킨 후 그 안에서 날짜를 다시 그룹화 시키는 과정을 추가했습니다.
  • reservationDetailRepository에 datail 데이터를 불러오기 위한 쿼리 메소드를 추가했습니다.

Testing

image image

To Reviewers

BoothReservationService 안 getGroupReservation 메소드를 만들어서 boothId 와 일치하는 예약 객체들을 리스트로 받고 그 안에서
예약명별로 그룹화를 1차 작업했습니다.

예약 서비스의 기본 정보(id, name, description,...) 과 같은 정보는 하나의 서비스는 모두 같은 기본 정보들을 내포하고 있기 때문에 예약 객체 리스트중 첫번째 데이터를 기준으로 정보를 불러왔습니다.

그룹화 시킨 리스트들은 date를 기준으로 다시 그룹화가 진행되고 boothReservationDateDto에 그룹화된 date와 detail 정보들이 담겨집니다.

처음에는 쿼리문을 통해 name의 group by 작업을 진행했었는데 리턴은 boothReservation 리스트 형태로 반환하다 보니 그룹 형태가 유지 되지 않는다는 점을 알게 되었습니다. 그래서 service 계층에서 groupingBy 라는 메소드를 사용해서 그룹화를 진행했습니다.

추가적으로 질문이나 의견 있으시면 코멘트 남겨주세요!

@gitseoyeon gitseoyeon added the refactor 코드를 개선합니다. label Nov 5, 2024
@gitseoyeon gitseoyeon requested a review from muncool39 November 5, 2024 07:44
@gitseoyeon gitseoyeon self-assigned this Nov 5, 2024
@gitseoyeon
Copy link
Member Author

날짜 형식을 "yyyy.MM.dd"로 변경했는데 테스팅 사진에는 변경 전으로 올라와있습니다! 😅
확인하실때 참고 부탁드립니다!

Copy link
Member

@muncool39 muncool39 left a comment

Choose a reason for hiding this comment

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

확인했습니다! 복잡하셨을텐데 고생 많으셨습니다!😭

@gitseoyeon gitseoyeon merged commit 8302df6 into dev Nov 6, 2024
3 checks passed
@gitseoyeon gitseoyeon deleted the refactor/#295 branch November 6, 2024 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 코드를 개선합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 예약 반환 데이터 형식 수정

3 participants