diff --git a/src/main/java/team7/inplace/influencer/presentation/InfluencerController.java b/src/main/java/team7/inplace/influencer/presentation/InfluencerController.java index a38778fa..bcd4a545 100644 --- a/src/main/java/team7/inplace/influencer/presentation/InfluencerController.java +++ b/src/main/java/team7/inplace/influencer/presentation/InfluencerController.java @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import team7.inplace.influencer.application.InfluencerService; import team7.inplace.influencer.application.dto.InfluencerCommand; @@ -22,11 +23,12 @@ @RequiredArgsConstructor @RestController +@RequestMapping("/influencers") public class InfluencerController implements InfluencerControllerApiSpec { private final InfluencerService influencerService; - @GetMapping("/influencers") + @GetMapping() public ResponseEntity getAllInfluencers() { List influencersDtoList = influencerService.getAllInfluencers(); List influencers = influencersDtoList.stream() @@ -37,7 +39,7 @@ public ResponseEntity getAllInfluencers() { return new ResponseEntity<>(response, HttpStatus.OK); } - @PostMapping("/influencers") + @PostMapping() public ResponseEntity createInfluencer(@RequestBody InfluencerRequest request) { InfluencerCommand influencerCommand = new InfluencerCommand( request.influencerName(), @@ -49,7 +51,7 @@ public ResponseEntity createInfluencer(@RequestBody InfluencerRequest requ return new ResponseEntity<>(savedId, HttpStatus.OK); } - @PutMapping("/influencers/{id}") + @PutMapping("/{id}") public ResponseEntity updateInfluencer(@PathVariable Long id, @RequestBody InfluencerRequest request) { InfluencerCommand influencerCommand = new InfluencerCommand( @@ -62,7 +64,7 @@ public ResponseEntity updateInfluencer(@PathVariable Long id, return new ResponseEntity<>(updatedId, HttpStatus.OK); } - @DeleteMapping("/influencers/{id}") + @DeleteMapping("/{id}") public ResponseEntity deleteInfluencer(@PathVariable Long id) { influencerService.deleteInfluencer(id);