-
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.
- Loading branch information
1 parent
70a382f
commit b01863b
Showing
8 changed files
with
111 additions
and
6 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
23 changes: 23 additions & 0 deletions
23
...ava/com/lovely4k/backend/question/controller/request/CreateServerQuestionFormRequest.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,23 @@ | ||
package com.lovely4k.backend.question.controller.request; | ||
|
||
import com.lovely4k.backend.question.service.request.CreateServerQuestionFormServiceRequest; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record CreateServerQuestionFormRequest( | ||
@NotBlank(message = "질문 내용은 비어 있을 수 없습니다.") | ||
String questionContent, | ||
|
||
@NotBlank(message = "첫 번째 선택지는 비어 있을 수 없습니다.") | ||
String firstChoice, | ||
|
||
@NotBlank(message = "두 번째 선택지는 비어 있을 수 없습니다.") | ||
String secondChoice, | ||
|
||
String thirdChoice, | ||
String fourthChoice, | ||
Long questionDay | ||
) { | ||
public CreateServerQuestionFormServiceRequest toServiceRequest() { | ||
return new CreateServerQuestionFormServiceRequest(questionContent, firstChoice, secondChoice, thirdChoice, fourthChoice, questionDay); | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
...com/lovely4k/backend/question/service/request/CreateServerQuestionFormServiceRequest.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,20 @@ | ||
package com.lovely4k.backend.question.service.request; | ||
|
||
import com.lovely4k.backend.question.QuestionChoices; | ||
import com.lovely4k.backend.question.QuestionForm; | ||
import com.lovely4k.backend.question.QuestionFormType; | ||
|
||
public record CreateServerQuestionFormServiceRequest( | ||
String questionContent, | ||
String firstChoice, | ||
String secondChoice, | ||
String thirdChoice, | ||
String fourthChoice, | ||
Long questionDay | ||
) { | ||
public QuestionForm toEntity() { | ||
QuestionChoices questionChoices = QuestionChoices.create(firstChoice, secondChoice, thirdChoice, fourthChoice); | ||
|
||
return QuestionForm.create(null, questionContent, questionChoices, questionDay, QuestionFormType.SERVER); | ||
} | ||
} |
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