File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/main/java/com/example/solidconnection/report/controller Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .example .solidconnection .report .controller ;
2+
3+ import com .example .solidconnection .common .resolver .AuthorizedUser ;
4+ import com .example .solidconnection .report .dto .ReportRequest ;
5+ import com .example .solidconnection .report .service .ReportService ;
6+ import com .example .solidconnection .siteuser .domain .SiteUser ;
7+ import jakarta .validation .Valid ;
8+ import lombok .RequiredArgsConstructor ;
9+ import org .springframework .http .ResponseEntity ;
10+ import org .springframework .web .bind .annotation .PostMapping ;
11+ import org .springframework .web .bind .annotation .RequestBody ;
12+ import org .springframework .web .bind .annotation .RequestMapping ;
13+ import org .springframework .web .bind .annotation .RestController ;
14+
15+ @ RestController
16+ @ RequiredArgsConstructor
17+ @ RequestMapping ("/reports" )
18+ public class ReportController {
19+
20+ private final ReportService reportService ;
21+
22+ @ PostMapping
23+ public ResponseEntity <Void > createReport (
24+ @ AuthorizedUser SiteUser siteUser ,
25+ @ Valid @ RequestBody ReportRequest reportRequest
26+ ) {
27+ reportService .createReport (siteUser .getId (), reportRequest );
28+ return ResponseEntity .ok ().build ();
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments