diff --git a/http/test.http b/http/test.http index eaf407c8..0da56460 100644 --- a/http/test.http +++ b/http/test.http @@ -48,3 +48,16 @@ GET http://localhost:8080/api/v1/announcement/1 ### 삭제 (생성한 단체만 삭제 가능) DELETE http://localhost:8080/api/v1/announcement/1 Authorization: Bearer {{matsterToken}} + +### 보고서 작성 +POST http://localhost:8080/api/v1/reports +Content-Type: application/json + +{ + "title": "무신사 스폰서십", + "content": "무신사 스폰서십을 진행했습니다.", + "files": [] +} + +### 보고서 조회 +GET http://localhost:8080/api/v1/reports/0 diff --git a/src/main/java/com/sponus/sponusbe/domain/report/controller/ReportController.java b/src/main/java/com/sponus/sponusbe/domain/report/controller/ReportController.java index 552670a6..13459bd4 100644 --- a/src/main/java/com/sponus/sponusbe/domain/report/controller/ReportController.java +++ b/src/main/java/com/sponus/sponusbe/domain/report/controller/ReportController.java @@ -26,21 +26,19 @@ public class ReportController { private final ReportQueryService reportQueryService; @PostMapping - public ApiResponse create(@Valid @RequestBody ReportRequest request) { - ReportResponse response = reportService.create(request); - return ApiResponse.onSuccess(response); + public ApiResponse createReport(@Valid @RequestBody ReportRequest request) { + return ApiResponse.onSuccess(reportService.createReport(request)); } @PatchMapping("/{reportId}") - public ApiResponse update(@PathVariable Long reportId, @Valid @RequestBody ReportRequest request) { - ReportResponse response = reportService.update(reportId, request); - return ApiResponse.onSuccess(response); + public ApiResponse updateReport(@PathVariable Long reportId, + @Valid @RequestBody ReportRequest request) { + return ApiResponse.onSuccess(reportService.updateReport(reportId, request)); } @GetMapping("/{reportId}") - public ApiResponse read(@PathVariable Long reportId) { - ReportResponse response = reportQueryService.read(reportId); - return ApiResponse.onSuccess(response); + public ApiResponse readReport(@PathVariable Long reportId) { + return ApiResponse.onSuccess(reportQueryService.readReport(reportId)); } } diff --git a/src/main/java/com/sponus/sponusbe/domain/report/service/ReportQueryService.java b/src/main/java/com/sponus/sponusbe/domain/report/service/ReportQueryService.java index 75a813b7..c49c131e 100644 --- a/src/main/java/com/sponus/sponusbe/domain/report/service/ReportQueryService.java +++ b/src/main/java/com/sponus/sponusbe/domain/report/service/ReportQueryService.java @@ -18,7 +18,7 @@ public class ReportQueryService { private final ReportRepository reportRepository; - public ReportResponse read(Long id) { + public ReportResponse readReport(Long id) { Report report = reportRepository.findById(id) .orElseThrow(() -> new ReportException(ReportErrorCode.REPORT_NOT_FOUND)); return ReportResponse.from(report); diff --git a/src/main/java/com/sponus/sponusbe/domain/report/service/ReportService.java b/src/main/java/com/sponus/sponusbe/domain/report/service/ReportService.java index ccaf909d..021e9d72 100644 --- a/src/main/java/com/sponus/sponusbe/domain/report/service/ReportService.java +++ b/src/main/java/com/sponus/sponusbe/domain/report/service/ReportService.java @@ -18,12 +18,12 @@ public class ReportService { private final ReportRepository reportRepository; - public ReportResponse create(ReportRequest request) { + public ReportResponse createReport(ReportRequest request) { final Report report = reportRepository.save(request.toEntity()); return ReportResponse.from(report); } - public ReportResponse update(Long reportId, ReportRequest request) { + public ReportResponse updateReport(Long reportId, ReportRequest request) { final Report report = reportRepository.findById(reportId) .orElseThrow(() -> new ReportException(ReportErrorCode.REPORT_NOT_FOUND));