Skip to content

Commit

Permalink
[fix] #204 - SuccessReponse 메서드 타입 수정 및 회원 예매 조회 타입 일치 완료 (#205)
Browse files Browse the repository at this point in the history
* [#204] fix(SuccessResponse): 메서드에 제네릭 타입 명시

* [#204] fix(BookingController): 회원 예매 조회 response 타입 일치하도록 수정
  • Loading branch information
hoonyworld authored Sep 2, 2024
1 parent e3a1283 commit e2b48bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ResponseEntity<SuccessResponse<MemberBookingResponse>> createMemberBookin

@Operation(summary = "회원 예매 조회 API", description = "회원이 예매를 조회하는 GET API입니다.")
@GetMapping("/member/retrieve")
public ResponseEntity<SuccessResponse<MemberBookingRetrieveResponse>> getMemberBookings(
public ResponseEntity<SuccessResponse<List<MemberBookingRetrieveResponse>>> getMemberBookings(
@CurrentMember Long memberId) {
List<MemberBookingRetrieveResponse> response = memberBookingRetrieveService.findMemberBookings(memberId);
return ResponseEntity.status(HttpStatus.OK)
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/beat/global/common/dto/SuccessResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ public record SuccessResponse<T>(
String message,
T data
) {
public static <T> SuccessResponse of(final BaseSuccessCode baseSuccessCode, final T data) {
return new SuccessResponse(baseSuccessCode.getStatus(), baseSuccessCode.getMessage(), data);
public static <T> SuccessResponse<T> of(final BaseSuccessCode baseSuccessCode, final T data) {
return new SuccessResponse<>(baseSuccessCode.getStatus(), baseSuccessCode.getMessage(), data);
}

public static SuccessResponse from(final BaseSuccessCode baseSuccessCode) {
return new SuccessResponse(baseSuccessCode.getStatus(), baseSuccessCode.getMessage(), null);
public static <T> SuccessResponse<T> from(final BaseSuccessCode baseSuccessCode) {
return new SuccessResponse<>(baseSuccessCode.getStatus(), baseSuccessCode.getMessage(), null);
}
}

0 comments on commit e2b48bb

Please sign in to comment.