diff --git a/src/main/java/hyangyu/server/dto/review/MyReviewDto.java b/src/main/java/hyangyu/server/dto/review/MyReviewDto.java deleted file mode 100644 index 5b79b50..0000000 --- a/src/main/java/hyangyu/server/dto/review/MyReviewDto.java +++ /dev/null @@ -1,27 +0,0 @@ -package hyangyu.server.dto.review; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.time.LocalDateTime; - -@Data -@AllArgsConstructor -public class MyReviewDto { - - Long reviewId; - - String eventTitle; - - String photo; - - String username; - - @JsonFormat(pattern = "yyyy/MM/dd HH:mm", timezone = "Asia/Seoul") - LocalDateTime createTime; - - String content; - - int score; -} diff --git a/src/main/java/hyangyu/server/dto/review/MyReviewResponse.java b/src/main/java/hyangyu/server/dto/review/MyReviewResponse.java new file mode 100644 index 0000000..2e4b8ef --- /dev/null +++ b/src/main/java/hyangyu/server/dto/review/MyReviewResponse.java @@ -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 newResponse(SuccessCode code, MyReviewResponseDto data) { + MyReviewResponse response = MyReviewResponse.of(true, code.getMessage(), data); + return new ResponseEntity(response, code.getStatus()); + } +} diff --git a/src/main/java/hyangyu/server/dto/review/MyReviewResponseDto.java b/src/main/java/hyangyu/server/dto/review/MyReviewResponseDto.java new file mode 100644 index 0000000..0ae9663 --- /dev/null +++ b/src/main/java/hyangyu/server/dto/review/MyReviewResponseDto.java @@ -0,0 +1,22 @@ +package hyangyu.server.dto.review; + +import lombok.Getter; + +import java.util.List; + +@Getter +public class MyReviewResponseDto { + List display; + List fair; + List festival; + + private MyReviewResponseDto(List display, List fair, List festival) { + this.display = display; + this.fair = fair; + this.festival = festival; + } + + public static MyReviewResponseDto of(List display, List fair, List festival) { + return new MyReviewResponseDto(display, fair, festival); + } +}