-
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.
Browse files
Browse the repository at this point in the history
[refactor] 리뷰 조회 API 리팩토링
- Loading branch information
Showing
15 changed files
with
133 additions
and
158 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/main/java/hyangyu/server/dto/review/MyReviewsResponseDto.java
This file was deleted.
Oops, something went wrong.
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
25 changes: 25 additions & 0 deletions
25
src/main/java/hyangyu/server/dto/review/ReviewListResponse.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 ReviewListResponse extends BaseResponse { | ||
ReviewListResponseDto data; | ||
|
||
private ReviewListResponse(Boolean success, String msg, ReviewListResponseDto data) { | ||
super(success, msg); | ||
this.data = data; | ||
} | ||
|
||
public static ReviewListResponse of(Boolean success, String message, ReviewListResponseDto data) { | ||
return new ReviewListResponse(success, message, data); | ||
} | ||
|
||
public static ResponseEntity<ReviewListResponse> newResponse(SuccessCode code, ReviewListResponseDto data) { | ||
ReviewListResponse response = ReviewListResponse.of(true, code.getMessage(), data); | ||
return new ResponseEntity<ReviewListResponse>(response, code.getStatus()); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/hyangyu/server/dto/review/ReviewListResponseDto.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,20 @@ | ||
package hyangyu.server.dto.review; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class ReviewListResponseDto { | ||
List<ReviewDto> reviews; | ||
|
||
private ReviewListResponseDto(List<ReviewDto> reviews) { | ||
this.reviews = reviews; | ||
} | ||
|
||
public static ReviewListResponseDto of(List<ReviewDto> reviews) { | ||
return new ReviewListResponseDto(reviews); | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
src/main/java/hyangyu/server/dto/review/ReviewsResponseDto.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/hyangyu/server/dto/review/ShowReviewsDto.java
This file was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.