From eab1748adbb70de0dd26fe63c44ef46dc2d5b3c0 Mon Sep 17 00:00:00 2001 From: k000927 Date: Wed, 31 Jul 2024 16:19:47 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=EC=BA=90=EC=8A=A4=ED=8D=BC=20=EB=B4=87?= =?UTF-8?q?=20=EC=9D=91=EB=AA=A8=20=EC=97=AC=EB=B6=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 4 ++-- .../controller/eventController/LotteryEventController.java | 6 ++++++ .../event/service/eventService/LotteryEventService.java | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 894c01c4..22f6333f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,9 @@ name: Deploy to EC2 with Docker Compose on: - pull_request: + push: branches: - - dev + - test/db env: AWS_REGION: ap-northeast-2 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 86e9d9fd..12d9ed1e 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 @@ -20,4 +20,10 @@ public ResponseEntity> postCasperBot(@CookieValue S @RequestBody String body) { return new ResponseEntity<>(CustomResponse.create(lotteryEventService.postCasperBot(userData, body)), HttpStatus.CREATED); } + + @GetMapping("/{casperBotId}") + public ResponseEntity getCasperBot(@PathVariable String casperBotId){ + return new ResponseEntity<>(lotteryEventService.getCasperBot(Long.parseLong(casperBotId)), HttpStatus.OK); + } + } diff --git a/Server/src/main/java/JGS/CasperEvent/domain/event/service/eventService/LotteryEventService.java b/Server/src/main/java/JGS/CasperEvent/domain/event/service/eventService/LotteryEventService.java index 3f5dc94b..22f13604 100644 --- a/Server/src/main/java/JGS/CasperEvent/domain/event/service/eventService/LotteryEventService.java +++ b/Server/src/main/java/JGS/CasperEvent/domain/event/service/eventService/LotteryEventService.java @@ -54,4 +54,9 @@ public LotteryParticipants registerUserIfNeed(String userData) { return participants; } + + public GetCasperBot getCasperBot(long casperBotId){ + return GetCasperBot.of(casperBotRepository.findById(casperBotId).get()); + } + }