Skip to content

Commit

Permalink
feat: postCasperBot API 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
k000927 committed Jul 30, 2024
1 parent 4175e9a commit ecaacd3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<GetCasperBot> postCasperBot(@RequestBody String body) {
return CustomResponse.create(lotteryEventService.postCasperBot(body));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit ecaacd3

Please sign in to comment.