-
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 #32 from KusitmsHDmedi/feature/30-survey
[feat] 설문조사 세부 내용 api 구현
- Loading branch information
Showing
9 changed files
with
152 additions
and
12 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
15 changes: 13 additions & 2 deletions
15
src/main/java/com/kusithm/hdmedi_server/domain/survey/domain/EachSurvey.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
22 changes: 22 additions & 0 deletions
22
...main/java/com/kusithm/hdmedi_server/domain/survey/dto/response/SurveyDetailResultDto.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,22 @@ | ||
package com.kusithm.hdmedi_server.domain.survey.dto.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Builder | ||
@Getter | ||
public class SurveyDetailResultDto { | ||
private int parentsScore; | ||
private String parentsMessage; | ||
private int teacherScore; | ||
private String teacherMessage; | ||
|
||
public static SurveyDetailResultDto of(int parentsScore, String parentsMessage, int teacherScore, String teacherMessage){ | ||
return SurveyDetailResultDto.builder() | ||
.parentsScore(parentsScore) | ||
.parentsMessage(parentsMessage) | ||
.teacherScore(teacherScore) | ||
.teacherMessage(teacherMessage) | ||
.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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/kusithm/hdmedi_server/global/common/MessageSourceProvider.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,27 @@ | ||
package com.kusithm.hdmedi_server.global.common; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.context.MessageSource; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Locale; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@Component | ||
public class MessageSourceProvider { | ||
private final MessageSource messageSource; | ||
|
||
public String getEmergencyContent() { | ||
return messageSource.getMessage("emergency.content", null, Locale.KOREA); | ||
} | ||
|
||
public String getNonEmergencyContent() { | ||
return messageSource.getMessage("non.emergency.content", null, Locale.KOREA); | ||
} | ||
|
||
public String getNonSurveyContent() { | ||
return messageSource.getMessage("non.Survey.content", null, Locale.KOREA); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/kusithm/hdmedi_server/global/config/MessageConfig.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,18 @@ | ||
package com.kusithm.hdmedi_server.global.config; | ||
|
||
import org.springframework.context.MessageSource; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.support.ResourceBundleMessageSource; | ||
|
||
@Configuration | ||
public class MessageConfig { | ||
@Bean | ||
public MessageSource messageSource() { | ||
ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); | ||
messageSource.setBasenames("messages"); | ||
messageSource.setDefaultEncoding("UTF-8"); | ||
|
||
return messageSource; | ||
} | ||
} |
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,3 @@ | ||
emergency.content = ????? ? ???? ??? ???? ????. ??? ?? ???? ??? ????? ????? ??? ?? ??? ?? ?? ???? ?? ?? ????? ???? ??? ??? ??? ??? ???? ??? ??? ?? ???? ??? ?? ?? ????. | ||
non.emergency.content = ?? ??? ?? ????. ??? ??? ???? ??? ??? ?? ? ???? ???? ??? ??? ?? ?? ??????. ADHD? ?? ? ??? ??? ???? ?? www.adhd.or.kr? ?????! | ||
non.Survey.content = ???? ??? ????? ???? ???? ?????? |