Commit 8dc1e51 1 parent 78c6f60 commit 8dc1e51 Copy full SHA for 8dc1e51
File tree 4 files changed +23
-12
lines changed
src/main/java/com/sponus/sponusbe/domain/report
4 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,16 @@ GET http://localhost:8080/api/v1/announcement/1
48
48
### 삭제 (생성한 단체만 삭제 가능)
49
49
DELETE http://localhost:8080/api/v1/announcement/1
50
50
Authorization: Bearer {{matsterToken}}
51
+
52
+ ### 보고서 작성
53
+ POST http://localhost:8080/api/v1/reports
54
+ Content-Type: application/json
55
+
56
+ {
57
+ "title" : " 무신사 스폰서십" ,
58
+ "content" : " 무신사 스폰서십을 진행했습니다." ,
59
+ "files" : []
60
+ }
61
+
62
+ ### 보고서 조회
63
+ GET http://localhost:8080/api/v1/reports/0
Original file line number Diff line number Diff line change @@ -26,21 +26,19 @@ public class ReportController {
26
26
private final ReportQueryService reportQueryService ;
27
27
28
28
@ PostMapping
29
- public ApiResponse <ReportResponse > create (@ Valid @ RequestBody ReportRequest request ) {
30
- ReportResponse response = reportService .create (request );
31
- return ApiResponse .onSuccess (response );
29
+ public ApiResponse <ReportResponse > createReport (@ Valid @ RequestBody ReportRequest request ) {
30
+ return ApiResponse .onSuccess (reportService .createReport (request ));
32
31
}
33
32
34
33
@ PatchMapping ("/{reportId}" )
35
- public ApiResponse <ReportResponse > update (@ PathVariable Long reportId , @ Valid @ RequestBody ReportRequest request ) {
36
- ReportResponse response = reportService . update ( reportId , request );
37
- return ApiResponse .onSuccess (response );
34
+ public ApiResponse <ReportResponse > updateReport (@ PathVariable Long reportId ,
35
+ @ Valid @ RequestBody ReportRequest request ) {
36
+ return ApiResponse .onSuccess (reportService . updateReport ( reportId , request ) );
38
37
}
39
38
40
39
@ GetMapping ("/{reportId}" )
41
- public ApiResponse <ReportResponse > read (@ PathVariable Long reportId ) {
42
- ReportResponse response = reportQueryService .read (reportId );
43
- return ApiResponse .onSuccess (response );
40
+ public ApiResponse <ReportResponse > readReport (@ PathVariable Long reportId ) {
41
+ return ApiResponse .onSuccess (reportQueryService .readReport (reportId ));
44
42
}
45
43
46
44
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class ReportQueryService {
18
18
19
19
private final ReportRepository reportRepository ;
20
20
21
- public ReportResponse read (Long id ) {
21
+ public ReportResponse readReport (Long id ) {
22
22
Report report = reportRepository .findById (id )
23
23
.orElseThrow (() -> new ReportException (ReportErrorCode .REPORT_NOT_FOUND ));
24
24
return ReportResponse .from (report );
Original file line number Diff line number Diff line change 18
18
public class ReportService {
19
19
private final ReportRepository reportRepository ;
20
20
21
- public ReportResponse create (ReportRequest request ) {
21
+ public ReportResponse createReport (ReportRequest request ) {
22
22
final Report report = reportRepository .save (request .toEntity ());
23
23
return ReportResponse .from (report );
24
24
}
25
25
26
- public ReportResponse update (Long reportId , ReportRequest request ) {
26
+ public ReportResponse updateReport (Long reportId , ReportRequest request ) {
27
27
final Report report = reportRepository .findById (reportId )
28
28
.orElseThrow (() -> new ReportException (ReportErrorCode .REPORT_NOT_FOUND ));
29
29
You can’t perform that action at this time.
0 commit comments