From 7b9d4de3c3058d249ffbe1a64c8648007fcbcfa6 Mon Sep 17 00:00:00 2001 From: Kangmoon Seo <100016044+KangmoonSeo@users.noreply.github.com> Date: Sat, 18 Nov 2023 02:45:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20/update=20requestBody=20=EB=B0=B0?= =?UTF-8?q?=EC=97=B4=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/controller/UpdateController.java | 7 ++----- .../hellokicktty/server/dto/UpdateRequestDto.java | 15 --------------- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 workspace/server/src/main/java/org/hellokicktty/server/dto/UpdateRequestDto.java diff --git a/workspace/server/src/main/java/org/hellokicktty/server/controller/UpdateController.java b/workspace/server/src/main/java/org/hellokicktty/server/controller/UpdateController.java index ad83b65..70c893c 100644 --- a/workspace/server/src/main/java/org/hellokicktty/server/controller/UpdateController.java +++ b/workspace/server/src/main/java/org/hellokicktty/server/controller/UpdateController.java @@ -2,7 +2,6 @@ import lombok.RequiredArgsConstructor; import org.hellokicktty.server.domain.Kickboard; -import org.hellokicktty.server.dto.UpdateRequestDto; import org.hellokicktty.server.service.KickboardService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,12 +19,10 @@ public class UpdateController { private final KickboardService kickboardService; @PostMapping("/update") - public void updateKickboards(@RequestBody UpdateRequestDto dto) { - - List kickboardList = dto.getKickboards(); + public void updateKickboards(@RequestBody List kickboardList) { for (Kickboard k : kickboardList) { kickboardService.updateKickboard(k); } - log.info("{} kickboards are updated on repository", dto.getKickboards().size()); + log.info("{} kickboards are updated on repository", kickboardList.size()); } } diff --git a/workspace/server/src/main/java/org/hellokicktty/server/dto/UpdateRequestDto.java b/workspace/server/src/main/java/org/hellokicktty/server/dto/UpdateRequestDto.java deleted file mode 100644 index 5a780d5..0000000 --- a/workspace/server/src/main/java/org/hellokicktty/server/dto/UpdateRequestDto.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.hellokicktty.server.dto; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.hellokicktty.server.domain.Kickboard; - -import java.util.ArrayList; -import java.util.List; - -@Getter -@NoArgsConstructor -public class UpdateRequestDto { - List kickboards = new ArrayList<>(); - -}