From a85ef4550a8d17c68d4506d1499dea420280535d Mon Sep 17 00:00:00 2001 From: YongHo Shin Date: Thu, 5 Oct 2023 23:00:03 +0900 Subject: [PATCH] =?UTF-8?q?[api-server-v1]=20fix:=20DTO=20=EC=96=B4?= =?UTF-8?q?=EB=85=B8=ED=85=8C=EC=9D=B4=EC=85=98=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/dto/BlockResponseDTO.java | 3 ++- .../block/controller/dto/ImageBlockDTO.java | 17 ++++++++-------- .../v1/block/controller/dto/LinkBlockDTO.java | 9 +-------- .../block/controller/dto/VideoBlockDTO.java | 20 +++++++++---------- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/BlockResponseDTO.java b/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/BlockResponseDTO.java index d632470..8efdf1f 100644 --- a/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/BlockResponseDTO.java +++ b/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/BlockResponseDTO.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import java.util.UUID; +import javax.persistence.Lob; import kr.joberchip.core.block.*; import kr.joberchip.core.page.SharePage; import kr.joberchip.server.v1._utils.BlockType; @@ -13,7 +14,7 @@ public record BlockResponseDTO( BlockType type, String title, String description, - String src, + @Lob String src, Integer x, Integer y, Integer w, diff --git a/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/ImageBlockDTO.java b/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/ImageBlockDTO.java index 9b251e2..5d450a9 100755 --- a/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/ImageBlockDTO.java +++ b/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/ImageBlockDTO.java @@ -1,21 +1,20 @@ package kr.joberchip.server.v1.block.controller.dto; import kr.joberchip.core.block.ImageBlock; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; public record ImageBlockDTO( - @RequestParam String title, - @RequestParam String description, + @RequestPart String title, + @RequestPart String description, @RequestPart MultipartFile attachedImage, - @RequestParam Integer x, - @RequestParam Integer y, - @RequestParam Integer w, - @RequestParam Integer h, - @RequestParam Boolean visible) { + @RequestPart Integer x, + @RequestPart Integer y, + @RequestPart Integer w, + @RequestPart Integer h, + @RequestPart Boolean visible) { public ImageBlock toEntity() { - return ImageBlock.of(title, description, x, y, w, h, visible); + return ImageBlock.of(title, description, x, y, w, h); } } diff --git a/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/LinkBlockDTO.java b/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/LinkBlockDTO.java index f70ac44..e452d3d 100755 --- a/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/LinkBlockDTO.java +++ b/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/LinkBlockDTO.java @@ -1,16 +1,9 @@ package kr.joberchip.server.v1.block.controller.dto; import kr.joberchip.core.block.LinkBlock; -import org.springframework.web.bind.annotation.RequestParam; public record LinkBlockDTO( - @RequestParam String title, - @RequestParam String link, - @RequestParam Integer x, - @RequestParam Integer y, - @RequestParam Integer w, - @RequestParam Integer h, - @RequestParam Boolean visible) { + String title, String link, Integer x, Integer y, Integer w, Integer h, Boolean visible) { public LinkBlock toEntity() { return LinkBlock.of(title, link, x, y, w, h); diff --git a/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/VideoBlockDTO.java b/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/VideoBlockDTO.java index 118616b..ffb6821 100755 --- a/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/VideoBlockDTO.java +++ b/api/server-v1/src/main/java/kr/joberchip/server/v1/block/controller/dto/VideoBlockDTO.java @@ -1,23 +1,23 @@ package kr.joberchip.server.v1.block.controller.dto; import kr.joberchip.core.block.VideoBlock; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; public record VideoBlockDTO( - @RequestParam String title, - @RequestParam String description, - @RequestParam String videoLink, + @RequestPart String title, + @RequestPart String description, + @RequestPart String videoLink, @RequestPart MultipartFile attachedVideo, - @RequestParam Integer x, - @RequestParam Integer y, - @RequestParam Integer w, - @RequestParam Integer h, - @RequestParam Boolean visible) { + @RequestPart Integer x, + @RequestPart Integer y, + @RequestPart Integer w, + @RequestPart Integer h, + @RequestPart Boolean visible) { public VideoBlock toEntity() { - if (videoLink == null || "".equalsIgnoreCase(videoLink)) return VideoBlock.of(title, description, x, y, w, h); + if (videoLink == null || "".equalsIgnoreCase(videoLink)) + return VideoBlock.of(title, description, x, y, w, h); return VideoBlock.of(title, description, videoLink, x, y, w, h); }