-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from softeerbootcamp4th/feat#11-Create-Casper-Bot
Feat#11 create casper bot
- Loading branch information
Showing
21 changed files
with
367 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/Server/build/ | ||
/Server/src/main/resources/application.properties | ||
/.idea/ | ||
/Server/out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.3.2' | ||
id 'io.spring.dependency-management' version '1.1.6' | ||
id 'java' | ||
id 'org.springframework.boot' version '3.3.2' | ||
id 'io.spring.dependency-management' version '1.1.6' | ||
} | ||
|
||
group = 'JGS' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'com.google.code.gson:gson:2.9.0' | ||
|
||
runtimeOnly 'com.h2database:h2' | ||
|
||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
useJUnitPlatform() | ||
} |
23 changes: 23 additions & 0 deletions
23
.../java/JGS/CasperEvent/domain/event/controller/eventController/LotteryEventController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
Server/src/main/java/JGS/CasperEvent/domain/event/entity/admin/Admin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
Server/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/casperEnum/Color.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
...r/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/casperEnum/EyePosition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
Server/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/casperEnum/EyeShape.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...er/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/casperEnum/MouthShape.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Server/src/main/java/JGS/CasperEvent/domain/event/entity/casperBot/casperEnum/Sticker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
Server/src/main/java/JGS/CasperEvent/domain/event/entity/participants/BaseParticipant.java
This file was deleted.
Oops, something went wrong.
12 changes: 10 additions & 2 deletions
12
...r/src/main/java/JGS/CasperEvent/domain/event/entity/participants/LotteryParticipants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
package JGS.CasperEvent.domain.event.entity.participants; | ||
|
||
import JGS.CasperEvent.domain.event.entity.event.LotteryEvent; | ||
import JGS.CasperEvent.global.entity.BaseEntity; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
|
||
public class LotteryParticipants extends BaseParticipant{ | ||
@Entity | ||
public class LotteryParticipants extends BaseEntity { | ||
private int linkClickedCount; | ||
private int expectations; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="lottery_event_id") | ||
private Long lotteryEventId; | ||
private LotteryEvent lotteryEvent; | ||
|
||
@Id | ||
private String phoneNumber; | ||
} |
12 changes: 10 additions & 2 deletions
12
Server/src/main/java/JGS/CasperEvent/domain/event/entity/participants/RushParticipants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
package JGS.CasperEvent.domain.event.entity.participants; | ||
|
||
import JGS.CasperEvent.domain.event.entity.event.RushEvent; | ||
import JGS.CasperEvent.global.entity.BaseEntity; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
|
||
public class RushParticipants extends BaseParticipant{ | ||
@Entity | ||
public class RushParticipants extends BaseEntity { | ||
private int choice; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "rush_event_id") | ||
private Long rushEventId; | ||
private RushEvent rushEvent; | ||
|
||
@Id | ||
private String phoneNumber; | ||
} |
16 changes: 16 additions & 0 deletions
16
.../src/main/java/JGS/CasperEvent/domain/event/service/eventService/LotteryEventService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
package JGS.CasperEvent.domain.event.service.eventService; | ||
|
||
import JGS.CasperEvent.domain.event.dto.GetCasperBot; | ||
import JGS.CasperEvent.domain.event.entity.casperBot.CasperBot; | ||
import JGS.CasperEvent.domain.event.repository.eventRepository.LotteryEventRepository; | ||
import com.google.gson.Gson; | ||
import org.springframework.stereotype.Service; | ||
|
||
import static JGS.CasperEvent.global.util.GsonUtil.getGson; | ||
|
||
@Service | ||
public class LotteryEventService { | ||
private LotteryEventRepository lotteryEventRepository; | ||
|
||
public GetCasperBot postCasperBot(String body) { | ||
Gson gson = getGson(); | ||
CasperBot casperBot = gson.fromJson(body, CasperBot.class); | ||
return GetCasperBot.of(casperBot); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.