Skip to content

Commit

Permalink
Merge pull request #103 from mummhy0811/main
Browse files Browse the repository at this point in the history
Fix: 퀴즈 관련 리턴에 유저 닉네임 추가
  • Loading branch information
mummhy0811 authored Nov 22, 2023
2 parents c6556da + f3c7ac1 commit 565423d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class QuizAnswerCheckDTO {

private Long quizAnswer_id;
private String user_id;
private String user_nickname;
private Integer quiz_ans;
private Integer quiz_state;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
public class QuizListDTO {
private Long quiz_id;
private String writer_id;
private String writer_nickname;
private String quiz_txt;
private String answer1;
private String answer2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public List<QuizAnswerCheckDTO> checkAnswer(Long quiz_id){
User answer = q.getUser();
quizAnswerCheckDTO.setQuizAnswer_id(q.getQuizAnswer_id());
quizAnswerCheckDTO.setUser_id(answer.getUser_id());
quizAnswerCheckDTO.setUser_nickname(answer.getUser_nickname());
quizAnswerCheckDTO.setQuiz_ans(q.getQuiz_ans());
quizAnswerCheckDTO.setQuiz_state(q.getQuiz_state());

Expand All @@ -136,9 +137,11 @@ public List<QuizListDTO> quizList(String family_id){
List<QuizListDTO> quizLists = new ArrayList<>();

for(Quiz q : quizList){
User user = q.getUser();
QuizListDTO quizListDTO = new QuizListDTO();
quizListDTO.setQuiz_id(q.getQuiz_id());
quizListDTO.setWriter_id(q.getUser().getUser_id());
quizListDTO.setWriter_id(user.getUser_id());
quizListDTO.setWriter_nickname(user.getUser_nickname());
quizListDTO.setQuiz_txt(q.getQuiz_txt());
quizListDTO.setAnswer1(q.getAnswer1());
quizListDTO.setAnswer2(q.getAnswer2());
Expand All @@ -152,6 +155,7 @@ public List<QuizListDTO> quizList(String family_id){
for (QuizAnswer qa : quizAnswers) {
QuizAnswerCheckDTO quizAnswerCheckDTO = new QuizAnswerCheckDTO();
User answer = qa.getUser();
quizAnswerCheckDTO.setUser_nickname(answer.getUser_nickname());
quizAnswerCheckDTO.setQuizAnswer_id(qa.getQuizAnswer_id());
quizAnswerCheckDTO.setUser_id(answer.getUser_id());
quizAnswerCheckDTO.setQuiz_ans(qa.getQuiz_ans());
Expand Down Expand Up @@ -182,6 +186,7 @@ public QuizListDTO todayQuiz(String family_id){
QuizListDTO quizListDTO = new QuizListDTO();
quizListDTO.setQuiz_id(q.getQuiz_id());
quizListDTO.setWriter_id(q.getUser().getUser_id());
quizListDTO.setWriter_nickname(q.getUser().getUser_nickname());
quizListDTO.setQuiz_txt(q.getQuiz_txt());
quizListDTO.setAnswer1(q.getAnswer1());
quizListDTO.setAnswer2(q.getAnswer2());
Expand All @@ -195,6 +200,7 @@ public QuizListDTO todayQuiz(String family_id){
for (QuizAnswer qa : quizAnswers) {
QuizAnswerCheckDTO quizAnswerCheckDTO = new QuizAnswerCheckDTO();
User answer = qa.getUser();
quizAnswerCheckDTO.setUser_nickname(answer.getUser_nickname());
quizAnswerCheckDTO.setQuizAnswer_id(qa.getQuizAnswer_id());
quizAnswerCheckDTO.setUser_id(answer.getUser_id());
quizAnswerCheckDTO.setQuiz_ans(qa.getQuiz_ans());
Expand Down

0 comments on commit 565423d

Please sign in to comment.