Skip to content

Commit

Permalink
[feat] 내가 쓴 리뷰 응답 DTO 생성 (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
yujin113 committed May 23, 2022
1 parent 8fe4c6f commit 01bff37
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/main/java/hyangyu/server/dto/review/MyReviewDto.java

This file was deleted.

25 changes: 25 additions & 0 deletions src/main/java/hyangyu/server/dto/review/MyReviewResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package hyangyu.server.dto.review;

import hyangyu.server.constants.SuccessCode;
import hyangyu.server.dto.BaseResponse;
import lombok.Getter;
import org.springframework.http.ResponseEntity;

@Getter
public class MyReviewResponse extends BaseResponse {
MyReviewResponseDto data;

private MyReviewResponse(Boolean success, String msg, MyReviewResponseDto data) {
super(success, msg);
this.data = data;
}

public static MyReviewResponse of(Boolean success, String message, MyReviewResponseDto data) {
return new MyReviewResponse(success, message, data);
}

public static ResponseEntity<MyReviewResponse> newResponse(SuccessCode code, MyReviewResponseDto data) {
MyReviewResponse response = MyReviewResponse.of(true, code.getMessage(), data);
return new ResponseEntity<MyReviewResponse>(response, code.getStatus());
}
}
22 changes: 22 additions & 0 deletions src/main/java/hyangyu/server/dto/review/MyReviewResponseDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package hyangyu.server.dto.review;

import lombok.Getter;

import java.util.List;

@Getter
public class MyReviewResponseDto {
List<ReviewDto> display;
List<ReviewDto> fair;
List<ReviewDto> festival;

private MyReviewResponseDto(List<ReviewDto> display, List<ReviewDto> fair, List<ReviewDto> festival) {
this.display = display;
this.fair = fair;
this.festival = festival;
}

public static MyReviewResponseDto of(List<ReviewDto> display, List<ReviewDto> fair, List<ReviewDto> festival) {
return new MyReviewResponseDto(display, fair, festival);
}
}

0 comments on commit 01bff37

Please sign in to comment.