From 1446b98c427bbe350b82871154021104cdc42997 Mon Sep 17 00:00:00 2001 From: sanghee0820 Date: Wed, 9 Oct 2024 23:04:03 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20RequestMapping=20=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/InfluencerController.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/team7/inplace/influencer/presentation/InfluencerController.java b/src/main/java/team7/inplace/influencer/presentation/InfluencerController.java index 2fe8ef00..a38778fa 100644 --- a/src/main/java/team7/inplace/influencer/presentation/InfluencerController.java +++ b/src/main/java/team7/inplace/influencer/presentation/InfluencerController.java @@ -26,12 +26,12 @@ public class InfluencerController implements InfluencerControllerApiSpec { private final InfluencerService influencerService; - @GetMapping() + @GetMapping("/influencers") public ResponseEntity getAllInfluencers() { List influencersDtoList = influencerService.getAllInfluencers(); List influencers = influencersDtoList.stream() - .map(InfluencerResponse::from) - .toList(); + .map(InfluencerResponse::from) + .toList(); InfluencerListResponse response = new InfluencerListResponse(influencers); return new ResponseEntity<>(response, HttpStatus.OK); @@ -40,9 +40,9 @@ public ResponseEntity getAllInfluencers() { @PostMapping("/influencers") public ResponseEntity createInfluencer(@RequestBody InfluencerRequest request) { InfluencerCommand influencerCommand = new InfluencerCommand( - request.influencerName(), - request.influencerImgUrl(), - request.influencerJob() + request.influencerName(), + request.influencerImgUrl(), + request.influencerJob() ); Long savedId = influencerService.createInfluencer(influencerCommand); @@ -51,11 +51,11 @@ public ResponseEntity createInfluencer(@RequestBody InfluencerRequest requ @PutMapping("/influencers/{id}") public ResponseEntity updateInfluencer(@PathVariable Long id, - @RequestBody InfluencerRequest request) { + @RequestBody InfluencerRequest request) { InfluencerCommand influencerCommand = new InfluencerCommand( - request.influencerName(), - request.influencerImgUrl(), - request.influencerJob() + request.influencerName(), + request.influencerImgUrl(), + request.influencerJob() ); Long updatedId = influencerService.updateInfluencer(id, influencerCommand);