-
Notifications
You must be signed in to change notification settings - Fork 2
[BE] SISC1-86/87 사용자 베팅 등록/취소 API 구현 #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "SISC1-86-BE-\uC0AC\uC6A9\uC790-\uBCA0\uD305-\uB4F1\uB85D-API-\uAD6C\uD604"
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7126ff3
[BE] SISC1-86/87 사용자 베팅 등록/취소 API 구현
otter2023 eb10c20
[BE] SISC1-86 [REFACTOR] 불필요한 코드 삭제, stakePoints가 NULL이 아니도록 수정
otter2023 9f68416
Merge branch 'main' into SISC1-86-BE-사용자-베팅-등록-API-구현
discipline24 69ab66b
Merge branch 'main' into SISC1-86-BE-사용자-베팅-등록-API-구현
discipline24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
29 changes: 29 additions & 0 deletions
29
backend/src/main/java/org/sejongisc/backend/betting/dto/UserBetRequest.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package org.sejongisc.backend.betting.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import jakarta.validation.constraints.Min; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import org.sejongisc.backend.betting.entity.BetOption; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| @Getter | ||
| @Builder @AllArgsConstructor @NoArgsConstructor | ||
| public class UserBetRequest { | ||
|
|
||
| @NotNull(message = "라운드 ID는 필수입니다.") | ||
| private UUID roundId; | ||
|
|
||
| @NotNull(message = "베팅 옵션은 필수입니다.") | ||
| private BetOption option; | ||
|
|
||
| @JsonProperty("isFree") | ||
| private boolean free; | ||
|
|
||
| @Min(value = 10, message = "베팅 포인트는 10 이상이어야 합니다.") | ||
| private Integer stakePoints; | ||
| } | ||
6 changes: 6 additions & 0 deletions
6
backend/src/main/java/org/sejongisc/backend/betting/entity/UserBet.java
This file contains hidden or 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: 13 additions & 0 deletions
13
backend/src/main/java/org/sejongisc/backend/betting/repository/UserBetRepository.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package org.sejongisc.backend.betting.repository; | ||
|
|
||
| import org.sejongisc.backend.betting.entity.BetRound; | ||
| import org.sejongisc.backend.betting.entity.UserBet; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| import java.util.Optional; | ||
| import java.util.UUID; | ||
|
|
||
| public interface UserBetRepository extends JpaRepository<UserBet, UUID> { | ||
| boolean existsByRoundAndUserId(BetRound round, UUID userId); | ||
| Optional<UserBet> findByUserBetIdAndUserId(UUID userBetId, UUID userId); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.