-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
47 additions
and
27 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/main/java/hyangyu/server/dto/review/MyReviewResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
22
src/main/java/hyangyu/server/dto/review/MyReviewResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |