diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 37c9c9d..94f1e4a 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -54,7 +54,7 @@ jobs: aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY_ID }} aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }} application_name: solution-friend-dev - environment_name: Solution-friend-dev-env + environment_name: Solution-friend-dev-env-1 version_label: github-action-${{ steps.current-time.outputs.formattedTime }} region: ap-northeast-2 deployment_package: deploy/deploy.zip diff --git a/src/main/java/friend/spring/apiPayload/code/status/ErrorStatus.java b/src/main/java/friend/spring/apiPayload/code/status/ErrorStatus.java index a9bd165..2daa04f 100644 --- a/src/main/java/friend/spring/apiPayload/code/status/ErrorStatus.java +++ b/src/main/java/friend/spring/apiPayload/code/status/ErrorStatus.java @@ -8,9 +8,7 @@ @Getter @AllArgsConstructor -public enum -ErrorStatus implements BaseErrorCode { - +public enum ErrorStatus implements BaseErrorCode { // 가장 일반적인 응답 _INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "COMMON5000", "서버 에러, 관리자에게 문의 바랍니다."), @@ -61,7 +59,9 @@ POST_SCRAP_DUPLICATE(HttpStatus.BAD_REQUEST, "POST4015", "글에 대한 스크랩 데이터가 이미 존재합니다."), DEADLINE_OVER(HttpStatus.BAD_REQUEST, "POST4016", "투표 마감 시간이 지났습니다"), ALREADY_VOTE(HttpStatus.BAD_REQUEST, "POST4017", "이미 투표 하셨습니다."), -// USER_VOTE(HttpStatus.BAD_REQUEST,"POST4017","작성자는 투표가 불가능 합니다 하셨습니다."), +// USER_VOTE(HttpStatus.BAD_REQUEST,"POST4017","작성자는 투표가 불가능 합니다 하셨습니다."), // 이거 필요없으면 지워야 할 것 같습니다! + + POST_REPORT_DUPLICATE(HttpStatus.BAD_REQUEST, "POST4018", "이 유저가 해당 글을 신고한 신고 내역 데이터가 이미 존재합니다."), // 댓글 관련 응답 COMMENT_NOT_FOUND(HttpStatus.NOT_FOUND, "COMMENT4001", "댓글을 찾을 수 없습니다."), @@ -71,6 +71,7 @@ COMMENT_NOT_CORRECT_USER(HttpStatus.BAD_REQUEST, "COMMENT4005", "올바른 사용자(댓글 작성자)가 아닙니다."), COMMENT_POST_NOT_MATCH(HttpStatus.BAD_REQUEST, "COMMENT4006", "해당 글에 작성된 댓글이 아닙니다."), COMMENT_LIKE_DUPLICATE(HttpStatus.BAD_REQUEST, "COMMENT4007", "댓글에 대한 좋아요 데이터가 이미 존재합니다."), + COMMENT_REPORT_DUPLICATE(HttpStatus.BAD_REQUEST, "COMMENT4008", "이 유저가 해당 댓글을 신고한 신고 내역 데이터가 이미 존재합니다."), // 알림 관련 응답 ALARM_NOT_FOUND(HttpStatus.NOT_FOUND, "ALARM4001", "알림이 없습니다"), diff --git a/src/main/java/friend/spring/converter/CommentConverter.java b/src/main/java/friend/spring/converter/CommentConverter.java index 97b6051..40e5efe 100644 --- a/src/main/java/friend/spring/converter/CommentConverter.java +++ b/src/main/java/friend/spring/converter/CommentConverter.java @@ -1,13 +1,13 @@ package friend.spring.converter; -import friend.spring.domain.Comment; -import friend.spring.domain.Post; -import friend.spring.domain.User; +import friend.spring.domain.*; import friend.spring.domain.enums.CommentState; +import friend.spring.domain.enums.ReportType; import friend.spring.domain.mapping.Comment_choice; import friend.spring.domain.mapping.Comment_like; import friend.spring.web.dto.CommentRequestDTO; import friend.spring.web.dto.CommentResponseDTO; +import friend.spring.web.dto.PostResponseDTO; import java.util.ArrayList; import java.util.List; @@ -116,4 +116,20 @@ public static CommentResponseDTO.myCommentRes toMyCommentResDTO(Comment comment) .build(); } + public static CommentResponseDTO.CommentReportRes toCommentReportRes(PostResponseDTO.ReportResult reportResult) { + return CommentResponseDTO.CommentReportRes.builder() + .reportId(reportResult.getReport().getId()) + .createdAt(reportResult.getReport().getCreatedAt()) + .duplicatedReport(reportResult.getDuplicatedReport()) + .build(); + } + + public static Report toReportComment(Comment comment, User user, ReportCategory reportCategory) { + return Report.builder() + .targetType(ReportType.COMMENT) + .targetId(comment.getId()) + .reportCategory(reportCategory) + .user(user) + .build(); + } } diff --git a/src/main/java/friend/spring/converter/PostConverter.java b/src/main/java/friend/spring/converter/PostConverter.java index f7f6ca6..d6ab6ef 100644 --- a/src/main/java/friend/spring/converter/PostConverter.java +++ b/src/main/java/friend/spring/converter/PostConverter.java @@ -5,6 +5,7 @@ import friend.spring.domain.enums.PostState; import friend.spring.domain.enums.PostType; import friend.spring.domain.enums.PostVoteType; +import friend.spring.domain.enums.ReportType; import friend.spring.service.PostQueryService; import friend.spring.web.dto.*; import org.springframework.data.domain.Page; @@ -20,10 +21,8 @@ import friend.spring.domain.mapping.Post_like; import friend.spring.domain.mapping.Post_scrap; -import friend.spring.web.dto.CandidateResponseDTO; import friend.spring.web.dto.PostRequestDTO; import friend.spring.web.dto.PostResponseDTO; -import software.amazon.awssdk.services.s3.endpoints.internal.Value; import java.util.List; @@ -997,6 +996,23 @@ public static PostResponseDTO.ScrapCreateRes toScrapCreateRes(Post_scrap post_sc .build(); } + public static Report toReportPost(Post post, User user, ReportCategory reportCategory) { + return Report.builder() + .targetType(ReportType.POST) + .targetId(post.getId()) + .reportCategory(reportCategory) + .user(user) + .build(); + } + + public static PostResponseDTO.PostReportRes toPostReportRes(PostResponseDTO.ReportResult reportResult) { + return PostResponseDTO.PostReportRes.builder() + .reportId(reportResult.getReport().getId()) + .createdAt(reportResult.getReport().getCreatedAt()) + .duplicatedReport(reportResult.getDuplicatedReport()) + .build(); + } + public static PostResponseDTO.PostSearchRes PostSearchResDTO(Post post,Long userId) { Integer likeCount = post.getPostLikeList().size(); Integer commentCount = post.getCommentList().size(); diff --git a/src/main/java/friend/spring/domain/Report.java b/src/main/java/friend/spring/domain/Report.java index cf87d47..396f4fd 100644 --- a/src/main/java/friend/spring/domain/Report.java +++ b/src/main/java/friend/spring/domain/Report.java @@ -1,7 +1,6 @@ package friend.spring.domain; import friend.spring.domain.common.BaseEntity; -import friend.spring.domain.enums.ReportCategory; import friend.spring.domain.enums.ReportType; import lombok.*; @@ -22,14 +21,11 @@ public class Report extends BaseEntity { private ReportType targetType; @Column(nullable = false) - private Integer targetId; + private Long targetId; - @Column(nullable = false, length = 500) - private String content; - - @Enumerated(EnumType.STRING) - @Column - private ReportCategory category; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "report_category_id") + private ReportCategory reportCategory; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") diff --git a/src/main/java/friend/spring/domain/ReportCategory.java b/src/main/java/friend/spring/domain/ReportCategory.java new file mode 100644 index 0000000..b382fd1 --- /dev/null +++ b/src/main/java/friend/spring/domain/ReportCategory.java @@ -0,0 +1,29 @@ +package friend.spring.domain; + +import friend.spring.domain.common.BaseEntity; +import lombok.*; + +import javax.persistence.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Getter +@Builder +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class ReportCategory { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(nullable = false) + private String name; + + @Builder.Default + @OneToMany(mappedBy = "reportCategory") + private List reportList = new ArrayList<>(); + +} + diff --git a/src/main/java/friend/spring/domain/enums/ReportCategory.java b/src/main/java/friend/spring/domain/enums/ReportCategory.java deleted file mode 100644 index 1c79bbf..0000000 --- a/src/main/java/friend/spring/domain/enums/ReportCategory.java +++ /dev/null @@ -1,5 +0,0 @@ -package friend.spring.domain.enums; - -public enum ReportCategory { - SPAM, PRONO, NOT_FIT_POST, ABUSE, AD -} diff --git a/src/main/java/friend/spring/repository/ReportCategoryRepository.java b/src/main/java/friend/spring/repository/ReportCategoryRepository.java new file mode 100644 index 0000000..1487661 --- /dev/null +++ b/src/main/java/friend/spring/repository/ReportCategoryRepository.java @@ -0,0 +1,10 @@ +package friend.spring.repository; + +import friend.spring.domain.Category; +import friend.spring.domain.Report; +import friend.spring.domain.ReportCategory; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ReportCategoryRepository extends JpaRepository { + ReportCategory findByName(String category); +} diff --git a/src/main/java/friend/spring/repository/ReportRepository.java b/src/main/java/friend/spring/repository/ReportRepository.java new file mode 100644 index 0000000..7991e22 --- /dev/null +++ b/src/main/java/friend/spring/repository/ReportRepository.java @@ -0,0 +1,11 @@ +package friend.spring.repository; + +import friend.spring.domain.Report; +import friend.spring.domain.enums.ReportType; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.Optional; + +public interface ReportRepository extends JpaRepository { + Optional findByTargetTypeAndTargetIdAndUserId(ReportType post, Long postId, Long userId); +} diff --git a/src/main/java/friend/spring/service/CommentService.java b/src/main/java/friend/spring/service/CommentService.java index 3199432..f0699e9 100644 --- a/src/main/java/friend/spring/service/CommentService.java +++ b/src/main/java/friend/spring/service/CommentService.java @@ -1,10 +1,12 @@ package friend.spring.service; import friend.spring.domain.Comment; +import friend.spring.domain.Report; import friend.spring.domain.mapping.Comment_choice; import friend.spring.domain.mapping.Comment_like; import friend.spring.web.dto.CommentRequestDTO; import friend.spring.web.dto.CommentResponseDTO; +import friend.spring.web.dto.PostResponseDTO; import org.springframework.data.domain.Page; import javax.servlet.http.HttpServletRequest; @@ -36,4 +38,6 @@ public interface CommentService { Page getMyCommentList(Long userId, Integer page); void deleteComment(Long postId, Long commentId, HttpServletRequest request); + + PostResponseDTO.ReportResult createReportComment(Long commentId, CommentRequestDTO.CommentReportReq request, HttpServletRequest request2); } diff --git a/src/main/java/friend/spring/service/CommentServiceImpl.java b/src/main/java/friend/spring/service/CommentServiceImpl.java index 6863c52..7633b87 100644 --- a/src/main/java/friend/spring/service/CommentServiceImpl.java +++ b/src/main/java/friend/spring/service/CommentServiceImpl.java @@ -3,17 +3,21 @@ import friend.spring.apiPayload.GeneralException; import friend.spring.apiPayload.code.status.ErrorStatus; import friend.spring.apiPayload.handler.CommentHandler; +import friend.spring.apiPayload.handler.PostHandler; import friend.spring.converter.AlarmConverter; import friend.spring.converter.CommentConverter; +import friend.spring.converter.PostConverter; import friend.spring.converter.SseConverter; import friend.spring.domain.*; import friend.spring.domain.enums.AlarmType; +import friend.spring.domain.enums.ReportType; import friend.spring.domain.mapping.Comment_choice; import friend.spring.domain.mapping.Comment_like; import friend.spring.repository.*; import friend.spring.security.JwtTokenProvider; import friend.spring.web.dto.CommentRequestDTO; import friend.spring.web.dto.CommentResponseDTO; +import friend.spring.web.dto.PostResponseDTO; import friend.spring.web.dto.SseResponseDTO; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -38,6 +42,8 @@ public class CommentServiceImpl implements CommentService { private final CommentChoiceRepository commentChoiceRepository; private final PointRepository pointRepository; private final AlarmRepository alarmRepository; + private final ReportRepository reportRepository; + private final ReportCategoryRepository reportCategoryRepository; private final UserService userService; private final PostService postService; private final JwtTokenProvider jwtTokenProvider; @@ -400,5 +406,39 @@ public void deleteComment(Long postId, Long commentId, HttpServletRequest reques } comment.updateStateToDeleted(); } + + @Override + public PostResponseDTO.ReportResult createReportComment(Long commentId, CommentRequestDTO.CommentReportReq request, HttpServletRequest request2) { + Long userId = jwtTokenProvider.getCurrentUser(request2); + + Optional optionalComment = commentRepository.findById(commentId); + if (optionalComment.isEmpty()) { + this.checkComment(false); + } + + Optional optionalUser = userRepository.findById(userId); + if (optionalUser.isEmpty()) { + userService.checkUser(false); + } + + Comment comment = optionalComment.get(); + User user = optionalUser.get(); + + // 이미 신고된 건인지 확인 + Optional optionalReport = reportRepository.findByTargetTypeAndTargetIdAndUserId(ReportType.COMMENT, commentId, userId); + if (!optionalReport.isEmpty()) { + return PostResponseDTO.ReportResult.builder() + .report(optionalReport.get()) + .duplicatedReport(true) + .build(); + } + + ReportCategory reportCategory = reportCategoryRepository.findByName(request.getReportCategory()); + Report report = CommentConverter.toReportComment(comment, user, reportCategory); + return PostResponseDTO.ReportResult.builder() + .report(reportRepository.save(report)) + .duplicatedReport(false) + .build(); + } } diff --git a/src/main/java/friend/spring/service/PostService.java b/src/main/java/friend/spring/service/PostService.java index 4e5cc42..063bdb2 100644 --- a/src/main/java/friend/spring/service/PostService.java +++ b/src/main/java/friend/spring/service/PostService.java @@ -49,4 +49,8 @@ public interface PostService { Post_scrap createScrapPost(Long postId, HttpServletRequest request); void deleteScrapPost(Long postId, HttpServletRequest request); + + + PostResponseDTO.ReportResult createReportPost(Long postId, PostRequestDTO.PostReportReq request, HttpServletRequest request2); + } diff --git a/src/main/java/friend/spring/service/PostServiceImpl.java b/src/main/java/friend/spring/service/PostServiceImpl.java index 86bd18c..325fa71 100644 --- a/src/main/java/friend/spring/service/PostServiceImpl.java +++ b/src/main/java/friend/spring/service/PostServiceImpl.java @@ -9,6 +9,7 @@ import friend.spring.domain.Redis.SearchLog; import friend.spring.domain.enums.PostState; import friend.spring.domain.enums.PostType; +import friend.spring.domain.enums.ReportType; import friend.spring.domain.enums.S3ImageType; import friend.spring.domain.mapping.Post_like; import friend.spring.domain.mapping.Post_scrap; @@ -44,6 +45,8 @@ public class PostServiceImpl implements PostService { private final Card_PollRepository cardPollRepository; private final PointRepository pointRepository; private final CategoryRepository categoryRepository; + private final ReportCategoryRepository reportCategoryRepository; + private final ReportRepository reportRepository; private final PostLikeRepository postLikeRepository; private final CommentRepository commentRepository; @@ -476,4 +479,38 @@ public void deleteScrapPost(Long postId, HttpServletRequest request) { Post_scrap post_scrap = optionalPost_scrap.get(); postScrapRepository.delete(post_scrap); } + + @Override + public PostResponseDTO.ReportResult createReportPost(Long postId, PostRequestDTO.PostReportReq request, HttpServletRequest request2) { + Long userId = jwtTokenProvider.getCurrentUser(request2); + + Optional optionalPost = postRepository.findById(postId); + if (optionalPost.isEmpty()) { + this.checkPost(false); + } + + Optional optionalUser = userRepository.findById(userId); + if (optionalUser.isEmpty()) { + userService.checkUser(false); + } + + Post post = optionalPost.get(); + User user = optionalUser.get(); + + // 이미 신고된 건인지 확인 + Optional optionalReport = reportRepository.findByTargetTypeAndTargetIdAndUserId(ReportType.POST, postId, userId); + if (!optionalReport.isEmpty()) { + return PostResponseDTO.ReportResult.builder() + .report(optionalReport.get()) + .duplicatedReport(true) + .build(); + } + + ReportCategory reportCategory = reportCategoryRepository.findByName(request.getReportCategory()); + Report report = PostConverter.toReportPost(post, user, reportCategory); + return PostResponseDTO.ReportResult.builder() + .report(reportRepository.save(report)) + .duplicatedReport(false) + .build(); + } } diff --git a/src/main/java/friend/spring/web/controller/CommentRestController.java b/src/main/java/friend/spring/web/controller/CommentRestController.java index 583516c..ea05999 100644 --- a/src/main/java/friend/spring/web/controller/CommentRestController.java +++ b/src/main/java/friend/spring/web/controller/CommentRestController.java @@ -2,12 +2,15 @@ import friend.spring.apiPayload.ApiResponse; import friend.spring.converter.CommentConverter; +import friend.spring.converter.PostConverter; import friend.spring.domain.Comment; +import friend.spring.domain.Report; import friend.spring.domain.mapping.Comment_choice; import friend.spring.domain.mapping.Comment_like; import friend.spring.service.CommentService; import friend.spring.web.dto.CommentRequestDTO; import friend.spring.web.dto.CommentResponseDTO; +import friend.spring.web.dto.PostResponseDTO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameters; @@ -197,4 +200,27 @@ public ApiResponse deleteComment( commentService.deleteComment(postId, commentId, request); return ApiResponse.onSuccess(null); } + + // 댓글 신고 + @PostMapping("/posts/{post-id}/comment/{comment-id}/report") + @Operation(summary = "댓글 신고 API", description = "댓글 신고하는 API입니다. ex) /posts/1/report") + @ApiResponses({ + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 요청에 성공했습니다."), + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "USER4001", description = "NOT_FOUND, 사용자를 찾을 수 없습니다."), + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "POST4001", description = "NOT_FOUND, 글을 찾을 수 없습니다."), + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMENT4008", description = "BAD_REQUEST, 이 유저가 해당 댓글을 신고한 신고 내역 데이터가 이미 존재합니다."), + }) + @Parameters({ + @Parameter(name = "post-id", description = "path variable - 글 아이디"), + @Parameter(name = "atk", description = "RequestHeader - 로그인한 사용자의 accessToken"), + }) + public ApiResponse createReportComment( + @PathVariable("comment-id") Long commentId, + @RequestBody CommentRequestDTO.CommentReportReq request, + @RequestHeader("atk") String atk, + HttpServletRequest request2 + ) { + PostResponseDTO.ReportResult commentReport = commentService.createReportComment(commentId, request, request2); + return ApiResponse.onSuccess(CommentConverter.toCommentReportRes(commentReport)); + } } diff --git a/src/main/java/friend/spring/web/controller/PostRestController.java b/src/main/java/friend/spring/web/controller/PostRestController.java index 0174125..c091e97 100644 --- a/src/main/java/friend/spring/web/controller/PostRestController.java +++ b/src/main/java/friend/spring/web/controller/PostRestController.java @@ -306,6 +306,30 @@ public ApiResponse deleteScrapPost( return ApiResponse.onSuccess(null); } + // 글 신고 + @PostMapping("/posts/{post-id}/report") + @Operation(summary = "글 신고 API", description = "글 신고하는 API입니다. ex) /posts/1/report") + @ApiResponses({ + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 요청에 성공했습니다."), + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "USER4001", description = "NOT_FOUND, 사용자를 찾을 수 없습니다."), + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "POST4001", description = "NOT_FOUND, 글을 찾을 수 없습니다."), + @io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "POST4018", description = "BAD_REQUEST, 이 유저가 해당 글을 신고한 신고 내역 데이터가 이미 존재합니다."), + }) + @Parameters({ + @Parameter(name = "post-id", description = "path variable - 글 아이디"), + @Parameter(name = "atk", description = "RequestHeader - 로그인한 사용자의 accessToken"), + }) + public ApiResponse createReportPost( + @PathVariable("post-id") Long postId, + @RequestBody PostRequestDTO.PostReportReq request, + @RequestHeader("atk") String atk, + HttpServletRequest request2 + ) { + PostResponseDTO.ReportResult postReport = postService.createReportPost(postId, request, request2); + return ApiResponse.onSuccess(PostConverter.toPostReportRes(postReport)); + } + + // 글 검색 @GetMapping("/post/search/") @Operation(summary = "글 검색 API", description = "글을 검색합니다") @Parameters({ @@ -334,5 +358,6 @@ public ApiResponse getRecentSearch(@RequestHead Long userId = jwtTokenService.JwtToId(request); List recentSearchLogs = postQueryService.getRecentSearchLogs(userId); return ApiResponse.onSuccess(PostConverter.toRecentSearchRes(recentSearchLogs)); + } } diff --git a/src/main/java/friend/spring/web/dto/CommentRequestDTO.java b/src/main/java/friend/spring/web/dto/CommentRequestDTO.java index 96e1ee7..82e9559 100644 --- a/src/main/java/friend/spring/web/dto/CommentRequestDTO.java +++ b/src/main/java/friend/spring/web/dto/CommentRequestDTO.java @@ -27,4 +27,12 @@ public static class commentEditReq { @NotBlank String content; } + + @Builder + @Getter + @NoArgsConstructor + @AllArgsConstructor + public static class CommentReportReq { + String reportCategory; + } } diff --git a/src/main/java/friend/spring/web/dto/CommentResponseDTO.java b/src/main/java/friend/spring/web/dto/CommentResponseDTO.java index 790d956..b97f840 100644 --- a/src/main/java/friend/spring/web/dto/CommentResponseDTO.java +++ b/src/main/java/friend/spring/web/dto/CommentResponseDTO.java @@ -1,5 +1,6 @@ package friend.spring.web.dto; +import friend.spring.domain.Report; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -70,4 +71,14 @@ public static class myCommentRes { Integer commentLike; Integer reComment; } + + @Builder + @Getter + @NoArgsConstructor + @AllArgsConstructor + public static class CommentReportRes { + Long reportId; + LocalDateTime createdAt; + Boolean duplicatedReport; + } } diff --git a/src/main/java/friend/spring/web/dto/PostRequestDTO.java b/src/main/java/friend/spring/web/dto/PostRequestDTO.java index 6619638..d80a409 100644 --- a/src/main/java/friend/spring/web/dto/PostRequestDTO.java +++ b/src/main/java/friend/spring/web/dto/PostRequestDTO.java @@ -50,4 +50,11 @@ public static class PostEditReq { Boolean voteOnGoing; } + @Builder + @Getter + @NoArgsConstructor + @AllArgsConstructor + public static class PostReportReq { + String reportCategory; + } } diff --git a/src/main/java/friend/spring/web/dto/PostResponseDTO.java b/src/main/java/friend/spring/web/dto/PostResponseDTO.java index 2f42eb5..ac55e49 100644 --- a/src/main/java/friend/spring/web/dto/PostResponseDTO.java +++ b/src/main/java/friend/spring/web/dto/PostResponseDTO.java @@ -1,8 +1,8 @@ package friend.spring.web.dto; +import friend.spring.domain.Report; import friend.spring.domain.enums.PostType; import friend.spring.domain.enums.PostVoteType; -import io.swagger.models.auth.In; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -167,6 +167,7 @@ public static class PostSearchList { List reviewPostList; private Boolean isEnd; } + @Builder @Getter @NoArgsConstructor @@ -191,6 +192,17 @@ public static class PostSearchRes{ public static class RecentSearchRes { List recentSearchList; } + + @Builder + @Getter + @NoArgsConstructor + @AllArgsConstructor + public static class PostReportRes { + Long reportId; + LocalDateTime createdAt; + Boolean duplicatedReport; + } + @Builder @Getter @NoArgsConstructor @@ -199,4 +211,13 @@ public static class SearchLog{ private String name; private String createdAt; } + + @Builder + @Getter + @NoArgsConstructor + @AllArgsConstructor + public static class ReportResult{ + Report report; + Boolean duplicatedReport; + } } \ No newline at end of file