diff --git a/src/main/java/com/dissonance/itit/global/common/exception/ErrorCode.java b/src/main/java/com/dissonance/itit/global/common/exception/ErrorCode.java index d7048d0..dbfd51f 100644 --- a/src/main/java/com/dissonance/itit/global/common/exception/ErrorCode.java +++ b/src/main/java/com/dissonance/itit/global/common/exception/ErrorCode.java @@ -25,10 +25,6 @@ public enum ErrorCode { IMAGE_NOT_FOUND(HttpStatus.NOT_FOUND, "해당 id의 이미지가 존재하지 않습니다."), NON_EXISTENT_CATEGORY_ID(HttpStatus.NOT_FOUND, "해당 id의 카테고리가 존재하지 않습니다."), NON_EXISTENT_INFO_POST_ID(HttpStatus.NOT_FOUND, "해당 id의 공고 게시글이 존재하지 않습니다."), - REPORTED_INFO_POST_ID(HttpStatus.NOT_FOUND, "해당 id의 게시글은 신고 처리되었습니다."), - - // 409 - ALREADY_REPORTED_POST(HttpStatus.CONFLICT, "이미 신고한 공고입니다."), // 500 IO_EXCEPTION(HttpStatus.INTERNAL_SERVER_ERROR, "파일 입출력 에러"), diff --git a/src/main/java/com/dissonance/itit/post/controller/InfoPostController.java b/src/main/java/com/dissonance/itit/post/controller/InfoPostController.java index e9250ef..8abcb68 100644 --- a/src/main/java/com/dissonance/itit/post/controller/InfoPostController.java +++ b/src/main/java/com/dissonance/itit/post/controller/InfoPostController.java @@ -3,19 +3,15 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import com.dissonance.itit.global.common.annotation.CurrentUser; import com.dissonance.itit.global.common.util.ApiResponse; import com.dissonance.itit.post.dto.response.InfoPostDetailRes; import com.dissonance.itit.post.dto.response.InfoPostRes; import com.dissonance.itit.post.service.InfoPostService; -import com.dissonance.itit.post.service.ReportService; -import com.dissonance.itit.user.domain.User; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; @@ -25,7 +21,6 @@ @RequestMapping("/info-posts") public class InfoPostController { private final InfoPostService infoPostService; - private final ReportService reportService; @GetMapping("/{infoPostId}") @Operation(summary = "공고 게시글 조회", description = "공고 게시글을 상세 조회합니다.") @@ -34,13 +29,6 @@ public ApiResponse getInfoPostDetail(@PathVariable Long infoP return ApiResponse.success(infoPostDetailRes); } - @PatchMapping("/{infoPostId}/reports") - @Operation(summary = "공고 게시글 신고", description = "공고 게시글을 신고 처리합니다.") - public ApiResponse reportedInfoPost(@PathVariable Long infoPostId, @CurrentUser User loginUser) { - Long resultId = reportService.reportedInfoPost(infoPostId, loginUser); - return ApiResponse.success(resultId + "번 게시글의 신고가 성공적으로 접수되었습니다."); - } - @GetMapping("/categories/{categoryId}/posts") @Operation(summary = "공고 게시글 목록 조회", description = "카테고리별 공고 게시글 목록을 조회합니다. (정렬: 최신순 - latest, 마감일순 - deadline)") public ApiResponse> getInfoPostsByCategory(@PathVariable Integer categoryId, Pageable pageable) { diff --git a/src/main/java/com/dissonance/itit/post/domain/InfoPost.java b/src/main/java/com/dissonance/itit/post/domain/InfoPost.java index 8e02e51..9cd2786 100644 --- a/src/main/java/com/dissonance/itit/post/domain/InfoPost.java +++ b/src/main/java/com/dissonance/itit/post/domain/InfoPost.java @@ -4,8 +4,8 @@ import com.dissonance.itit.global.common.entity.BaseTime; import com.dissonance.itit.image.domain.Image; -import com.dissonance.itit.user.domain.User; import com.dissonance.itit.post.dto.request.InfoPostUpdateReq; +import com.dissonance.itit.user.domain.User; import jakarta.persistence.CascadeType; import jakarta.persistence.Column; @@ -75,9 +75,6 @@ public class InfoPost extends BaseTime { @Column(name = "organization") private String organization; - @Column(name = "reported") - private Boolean reported; - @Column(name = "recruitment_closed") private Boolean recruitmentClosed; diff --git a/src/main/java/com/dissonance/itit/post/dto/request/InfoPostReq.java b/src/main/java/com/dissonance/itit/post/dto/request/InfoPostReq.java index 36fa881..e2c1bda 100644 --- a/src/main/java/com/dissonance/itit/post/dto/request/InfoPostReq.java +++ b/src/main/java/com/dissonance/itit/post/dto/request/InfoPostReq.java @@ -55,7 +55,6 @@ public InfoPost toEntity(Image image, User author, Category category) { .activityStartDate(stringToDate(activityStartDate())) .activityEndDate(stringToDate(activityEndDate())) .detailUrl(detailUrl()) - .reported(false) .recruitmentClosed(false) .build(); } diff --git a/src/main/java/com/dissonance/itit/post/dto/response/InfoPostDetailRes.java b/src/main/java/com/dissonance/itit/post/dto/response/InfoPostDetailRes.java index d427da5..3a57731 100644 --- a/src/main/java/com/dissonance/itit/post/dto/response/InfoPostDetailRes.java +++ b/src/main/java/com/dissonance/itit/post/dto/response/InfoPostDetailRes.java @@ -38,7 +38,6 @@ public static class InfoPostInfo { private String content; private String detailUrl; private Integer viewCount; - private Boolean reported; private final String imageUrl; } diff --git a/src/main/java/com/dissonance/itit/post/repository/InfoPostRepositorySupport.java b/src/main/java/com/dissonance/itit/post/repository/InfoPostRepositorySupport.java index 3cd2079..ee0794f 100644 --- a/src/main/java/com/dissonance/itit/post/repository/InfoPostRepositorySupport.java +++ b/src/main/java/com/dissonance/itit/post/repository/InfoPostRepositorySupport.java @@ -45,7 +45,6 @@ public InfoPostInfo findInfoPostWithDetails(Long infoPostId) { infoPost.content.as("content"), infoPost.detailUrl.as("detailUrl"), infoPost.viewCount.as("viewCount"), - infoPost.reported.as("reported"), infoPost.image.imageUrl.as("imageUrl") )) .from(infoPost) diff --git a/src/main/java/com/dissonance/itit/post/service/InfoPostService.java b/src/main/java/com/dissonance/itit/post/service/InfoPostService.java index 1753718..bb40cbf 100644 --- a/src/main/java/com/dissonance/itit/post/service/InfoPostService.java +++ b/src/main/java/com/dissonance/itit/post/service/InfoPostService.java @@ -59,10 +59,6 @@ public InfoPostDetailRes getInfoPostDetailById(Long infoPostId) { throw new CustomException(ErrorCode.NON_EXISTENT_INFO_POST_ID); } - if (infoPostInfo.getReported()) { - throw new CustomException(ErrorCode.REPORTED_INFO_POST_ID); - } - List positionInfos = recruitmentPositionService.findPositionInfosByInfoPostId(infoPostId); return InfoPostDetailRes.of(infoPostInfo, positionInfos);