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 : 내 예매목록 조회 #237

Merged
merged 6 commits into from
Jan 31, 2023
Merged

feat : 내 예매목록 조회 #237

merged 6 commits into from
Jan 31, 2023

Conversation

ImNM
Copy link
Member

@ImNM ImNM commented Jan 30, 2023

개요

작업사항

  • 마이페이지 내 예매목록 조회 작업
    무제
{
  "success": true,
  "status": 200,
  "data": {
    "content": [
      {
        "refundInfo": {
          "endAt": "2023-01-30T20:00:00",
          "availAble": false
        },
        "eventProfile": {
          "eventId": 9,
          "posterImage": null,
          "name": "고스락 제 22회 정기공연",
          "startAt": "2023-01-30T19:00:00",
          "placeName": null,
          "status": "OPEN"
        },
        "orderUuid": "a11c2bd7-d3fb-4be4-b311-38656780fd50",
        "orderNo": "R1000002",
        "stage": "관람예정",
        "orderStatus": "승인 완료",
        "itemName": "일반 티켓 선착순",
        "totalQuantity": 1
      },
      {
        "refundInfo": {
          "endAt": "2023-01-30T20:00:00",
          "availAble": false
        },
        "eventProfile": {
          "eventId": 9,
          "posterImage": null,
          "name": "고스락 제 22회 정기공연",
          "startAt": "2023-01-30T19:00:00",
          "placeName": null,
          "status": "OPEN"
        },
        "orderUuid": "7e71bd9a-6b48-47c4-9c10-0017c0caaea6",
        "orderNo": "R1000001",
        "stage": "관람예정",
        "orderStatus": "승인 완료",
        "itemName": "일반 티켓 선착순",
        "totalQuantity": 1
      }
    ],
    "page": 0,
    "size": 2,
    "totalElements": 2,
    "totalPages": 1,
    "hasNextPage": false
  },
  "timeStamp": "2023-01-30T20:34:03.202949"
}
  • IssuedTicket 을 리스트로 받아와서 스트림 돌리는게 많다보니깐
    그냥 일급 컬렉션으로 만들었습니다.

일급컬렉션 관련글.
https://jojoldu.tistory.com/412

보면은 좀 사용하면 소스 퍼진거 모을수 있을거 같은데 옵션같은거..
담에 눈에좀 보이면 넣도록 하겠습니다.

  • DateTemplate 사용
DateTemplate<LocalDateTime> eventEndAtTemplate =
                Expressions.dateTemplate(
                        LocalDateTime.class,
                        "TIMESTAMPADD(MINUTE,{0}, {1}) ",
                        event.eventBasic.runTime,
                        event.eventBasic.startAt);

이벤트 시작시간에 + 런타임을 디비에서 더해서
상영중 여부를 계산합니다. mysql에 날짜관련 함수가 더 있긴한데
하이버네이트가 interval을 예약어로 잡아버려서 TIMESTAMPADD
를 쓰기로 했습니다.

레퍼런스

변경로직

  • 주문도메인에 eventid를 추가했습니다.
  • 없으면 안되는 구조였더라구용
  • 관리자에서 조회할때도 eventId 써야하니깜

@ImNM ImNM requested a review from sanbonai06 as a code owner January 30, 2023 11:42
@ImNM ImNM self-assigned this Jan 30, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 260 Code Smells

17.1% 17.1% Coverage
0.0% 0.0% Duplication

Copy link
Member

@kim-wonjin kim-wonjin left a comment

Choose a reason for hiding this comment

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

LGTM🌿

Comment on lines +56 to +59
// 관리자에서 주문 목록 불러올려면 event 아이디 저장 필요
@Column(nullable = false)
private Long eventId;

Copy link
Member

Choose a reason for hiding this comment

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

컬럼추가 확인이욤

Copy link
Member

@gengminy gengminy left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ImNM ImNM merged commit 35ab5a6 into dev Jan 31, 2023
@ImNM ImNM deleted the feature/139-my-orders-pagination branch January 31, 2023 02:47
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.

🚀 [feature] 내 주문 목록 조회 with 페이지네이션
3 participants