-
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 #228 from tukcomCD2024/Backend#225/quiz
Backend#225/quiz
- Loading branch information
Showing
14 changed files
with
425 additions
and
51 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
.../src/main/java/com/Backend/shareNote/domain/Oraganization/DTOs/quizdto/QuizCreateDTO.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,17 @@ | ||
package com.Backend.shareNote.domain.Oraganization.DTOs.quizdto; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class QuizCreateDTO { | ||
private String organizationId; | ||
private String noteId; | ||
private String userId; | ||
private String quizType; | ||
private String problem; | ||
private Integer answer; | ||
private List<String> problems; | ||
private String quizTitle; | ||
} |
11 changes: 11 additions & 0 deletions
11
.../src/main/java/com/Backend/shareNote/domain/Oraganization/DTOs/quizdto/QuizDeleteDTO.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,11 @@ | ||
package com.Backend.shareNote.domain.Oraganization.DTOs.quizdto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class QuizDeleteDTO { | ||
private String organizationId; | ||
private String noteId; | ||
private String userId; | ||
private String quizId; | ||
} |
11 changes: 11 additions & 0 deletions
11
...c/main/java/com/Backend/shareNote/domain/Oraganization/DTOs/quizdto/QuizDetailReqDTO.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,11 @@ | ||
package com.Backend.shareNote.domain.Oraganization.DTOs.quizdto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class QuizDetailReqDTO { | ||
private String organizationId; | ||
private String noteId; | ||
private String userId; | ||
private String quizId; | ||
} |
16 changes: 16 additions & 0 deletions
16
...c/main/java/com/Backend/shareNote/domain/Oraganization/DTOs/quizdto/QuizDetailResDTO.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,16 @@ | ||
package com.Backend.shareNote.domain.Oraganization.DTOs.quizdto; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
public class QuizDetailResDTO { | ||
private String quizTitle; | ||
private String quizType; | ||
private String noteName; // 노트 이름 | ||
private List<String> problems; | ||
private Integer correct; | ||
} |
11 changes: 11 additions & 0 deletions
11
.../src/main/java/com/Backend/shareNote/domain/Oraganization/DTOs/quizdto/QuizSearchDTO.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,11 @@ | ||
package com.Backend.shareNote.domain.Oraganization.DTOs.quizdto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class QuizSearchDTO { | ||
private String quizId; | ||
private String quizTitle; | ||
private Integer correct; | ||
private String nickname; | ||
} |
13 changes: 13 additions & 0 deletions
13
...e/src/main/java/com/Backend/shareNote/domain/Oraganization/DTOs/quizdto/QuizSolveDTO.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,13 @@ | ||
package com.Backend.shareNote.domain.Oraganization.DTOs.quizdto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class QuizSolveDTO { | ||
private String organizationId; | ||
private String noteId; | ||
private String userId; | ||
private String quizId; | ||
private Integer answer; | ||
private String nickname; | ||
} |
40 changes: 40 additions & 0 deletions
40
...e/src/main/java/com/Backend/shareNote/domain/Oraganization/controller/QuizController.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,40 @@ | ||
package com.Backend.shareNote.domain.Oraganization.controller; | ||
|
||
import com.Backend.shareNote.domain.Oraganization.DTOs.quizdto.*; | ||
import com.Backend.shareNote.domain.Oraganization.service.QuizService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api") | ||
public class QuizController { | ||
private final QuizService quizService; | ||
@PostMapping("/quiz") | ||
public ResponseEntity<Object> createQuiz(@RequestBody QuizCreateDTO quizCreateDTO){ | ||
return quizService.createQuiz(quizCreateDTO); | ||
} | ||
|
||
@PostMapping("/quiz-solutions") | ||
public ResponseEntity<Object> createQuizSolutions(@RequestBody QuizSolveDTO quizCreateDTO){ | ||
return quizService.createQuizSolutions(quizCreateDTO); | ||
} | ||
|
||
@GetMapping("/quiz/{organizationId}/{noteId}/{userId}") | ||
public ResponseEntity<?> getQuiz(@PathVariable String organizationId, @PathVariable String noteId, @PathVariable String userId){ | ||
return quizService.getQuiz(organizationId, noteId, userId); | ||
} | ||
|
||
@PostMapping("/quiz/detail") | ||
public ResponseEntity<?> getQuizDetail(@RequestBody QuizDetailReqDTO quizDetailReqDTO){ | ||
return quizService.getQuizDetail(quizDetailReqDTO); | ||
} | ||
|
||
@DeleteMapping("/quiz") | ||
public ResponseEntity<?> deleteQuiz(@RequestBody QuizDeleteDTO quizDeleteDTO){ | ||
return quizService.deleteQuiz(quizDeleteDTO); | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
...e/src/main/java/com/Backend/shareNote/domain/Oraganization/repository/QuizRepository.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,9 @@ | ||
package com.Backend.shareNote.domain.Oraganization.repository; | ||
|
||
import com.Backend.shareNote.domain.Oraganization.entity.Organization; | ||
import org.springframework.data.mongodb.repository.MongoRepository; | ||
import org.springframework.stereotype.Repository; | ||
@Repository | ||
public interface QuizRepository extends MongoRepository<Organization.Quiz, String>{ | ||
} | ||
|
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
Oops, something went wrong.