From ecaacd322c65809978d347f477ed0c241b401035 Mon Sep 17 00:00:00 2001 From: k000927 Date: Tue, 30 Jul 2024 15:08:28 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20postCasperBot=20API=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LotteryEventController.java | 23 +++++++++++++++++++ .../event/entity/casperBot/CasperBot.java | 6 +++++ 2 files changed, 29 insertions(+) diff --git a/Server/src/main/java/JGS/CasperEvent/domain/event/controller/eventController/LotteryEventController.java b/Server/src/main/java/JGS/CasperEvent/domain/event/controller/eventController/LotteryEventController.java index 97ac2cf6..7e2d6e5f 100644 --- a/Server/src/main/java/JGS/CasperEvent/domain/event/controller/eventController/LotteryEventController.java +++ b/Server/src/main/java/JGS/CasperEvent/domain/event/controller/eventController/LotteryEventController.java @@ -1,4 +1,27 @@ package JGS.CasperEvent.domain.event.controller.eventController; +import JGS.CasperEvent.domain.event.dto.GetCasperBot; +import JGS.CasperEvent.domain.event.service.eventService.LotteryEventService; +import JGS.CasperEvent.global.response.CustomResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/event/lottery") public class LotteryEventController { + + private final LotteryEventService lotteryEventService; + + @Autowired + public LotteryEventController(LotteryEventService lotteryEventService) { + this.lotteryEventService = lotteryEventService; + } + + @PostMapping + public CustomResponse postCasperBot(@RequestBody String body) { + return CustomResponse.create(lotteryEventService.postCasperBot(body)); + } } diff --git a/Server/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/CasperBot.java b/Server/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/CasperBot.java index b00a04e3..ec9d3fbf 100644 --- a/Server/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/CasperBot.java +++ b/Server/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/CasperBot.java @@ -2,6 +2,7 @@ import JGS.CasperEvent.domain.event.entity.casperBot.casperEnum.*; import JGS.CasperEvent.global.entity.BaseEntity; +import com.google.gson.annotations.SerializedName; import jakarta.persistence.*; import static jakarta.persistence.GenerationType.IDENTITY; @@ -15,18 +16,23 @@ public class CasperBot extends BaseEntity { private String phoneNumber; + @SerializedName("eyeShape") @Enumerated(EnumType.STRING) private EyeShape eyeShape; + @SerializedName("eyePosition") @Enumerated(EnumType.STRING) private EyePosition eyePosition; + @SerializedName("mouthShape") @Enumerated(EnumType.STRING) private MouthShape mouthShape; + @SerializedName("color") @Enumerated(EnumType.STRING) private Color color; + @SerializedName("sticker") @Enumerated(EnumType.STRING) private Sticker sticker; private String name;