-
Notifications
You must be signed in to change notification settings - Fork 0
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 #35 from jurumarble/dev
Dev
- Loading branch information
Showing
14 changed files
with
162 additions
and
58 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
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
44 changes: 44 additions & 0 deletions
44
src/main/java/co/kr/jurumarble/vote/dto/request/UpdateDrinkVoteRequest.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package co.kr.jurumarble.vote.dto.request; | ||
|
||
import co.kr.jurumarble.vote.service.UpdateDrinkVoteServiceRequest; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.Positive; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class UpdateDrinkVoteRequest { | ||
|
||
@Schema(description = "투표 제목", example = "A, B 중 어떤게 나을까요?") | ||
@NotBlank(message = "투표 제목은 필수입니다.") | ||
private String title; | ||
|
||
@Schema(description = "전통주 후보 A의 id (전통주 아이디는 다른값으로 넣어주셔야합니다.)") | ||
@Positive(message = "전통주 아이디는 양수값의 정수여야합니다.") | ||
private Long drinkAId; | ||
|
||
@Schema(description = "전통주 후보 B의 id (전통주 아이디는 다른값으로 넣어주셔야합니다.)") | ||
@Positive(message = "전통주 아이디는 양수값의 정수여야합니다.") | ||
private Long drinkBId; | ||
|
||
@Schema(description = "투표 상세글") | ||
@NotBlank(message = "투표 상세글은 필수입니다.") | ||
private String detail; | ||
|
||
public UpdateDrinkVoteServiceRequest toServiceRequest(Long voteId, Long userId) { | ||
return UpdateDrinkVoteServiceRequest.builder() | ||
.voteId(voteId) | ||
.userId(userId) | ||
.title(title) | ||
.detail(detail) | ||
.drinkAId(drinkAId) | ||
.drinkBId(drinkBId) | ||
.build(); | ||
} | ||
} |
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
1 change: 0 additions & 1 deletion
1
src/main/java/co/kr/jurumarble/vote/repository/VoteDrinkContentRepository.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
30 changes: 30 additions & 0 deletions
30
src/main/java/co/kr/jurumarble/vote/service/UpdateDrinkVoteServiceRequest.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package co.kr.jurumarble.vote.service; | ||
|
||
import co.kr.jurumarble.drink.domain.dto.DrinkIdsUsedForVote; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class UpdateDrinkVoteServiceRequest { | ||
|
||
private final Long voteId; | ||
private final Long userId; | ||
private final String title; | ||
private final String detail; | ||
private final Long drinkAId; | ||
private final Long drinkBId; | ||
|
||
@Builder | ||
public UpdateDrinkVoteServiceRequest(Long voteId, Long userId, String title, String detail, Long drinkAId, Long drinkBId) { | ||
this.voteId = voteId; | ||
this.userId = userId; | ||
this.title = title; | ||
this.detail = detail; | ||
this.drinkAId = drinkAId; | ||
this.drinkBId = drinkBId; | ||
} | ||
|
||
public DrinkIdsUsedForVote extractDrinkIds() { | ||
return new DrinkIdsUsedForVote(drinkAId, drinkBId); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/co/kr/jurumarble/vote/service/UpdateNormalVoteServiceRequest.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package co.kr.jurumarble.vote.service; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class UpdateNormalVoteServiceRequest { | ||
|
||
private final Long voteId; | ||
private final Long userId; | ||
private final String title; | ||
private final String detail; | ||
private final String titleA; | ||
private final String titleB; | ||
|
||
|
||
@Builder | ||
private UpdateNormalVoteServiceRequest(Long voteId, Long userId, String title, String detail, String titleA, String titleB) { | ||
this.voteId = voteId; | ||
this.userId = userId; | ||
this.title = title; | ||
this.detail = detail; | ||
this.titleA = titleA; | ||
this.titleB = titleB; | ||
} | ||
} |
31 changes: 0 additions & 31 deletions
31
src/main/java/co/kr/jurumarble/vote/service/UpdateVoteServiceRequest.java
This file was deleted.
Oops, something went wrong.
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