Modify Endpoint URI
This commit is contained in:
@@ -16,17 +16,17 @@ public class EnumsController {
|
||||
|
||||
private final EnumMapperFactory enumMapperFactory;
|
||||
|
||||
@GetMapping("/enums/quiz/category")
|
||||
@GetMapping("/enums/quiz-categories")
|
||||
public ResponseEntity<List<EnumMapperValue>> getQuizCategoryList() {
|
||||
return ResponseEntity.ok(enumMapperFactory.get(EnumMapperKey.QUIZ_CATEGORY));
|
||||
}
|
||||
|
||||
@GetMapping("/enums/quiz/level")
|
||||
@GetMapping("/enums/quiz-levels")
|
||||
public ResponseEntity<List<EnumMapperValue>> getQuizLevelList() {
|
||||
return ResponseEntity.ok(enumMapperFactory.get(EnumMapperKey.QUIZ_LEVEL));
|
||||
}
|
||||
|
||||
@GetMapping("/enums/quiz/day")
|
||||
@GetMapping("/enums/quiz-days")
|
||||
public ResponseEntity<List<EnumMapperValue>> getQuizDayList() {
|
||||
return ResponseEntity.ok(enumMapperFactory.get(EnumMapperKey.QUIZ_DAY));
|
||||
}
|
||||
|
||||
@@ -13,10 +13,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.File;
|
||||
@@ -49,7 +46,13 @@ public class QuizController {
|
||||
.build();
|
||||
}
|
||||
|
||||
@GetMapping("/quiz/category")
|
||||
@GetMapping("/quiz/{id}")
|
||||
public ResponseEntity<Void> addQuiz(@PathVariable String id) {
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.build();
|
||||
}
|
||||
|
||||
@GetMapping("/quiz/categories")
|
||||
public ResponseEntity<QuizCategoryResponseHolder> getQuizCategoryList() {
|
||||
final QuizCategoryResponseHolder response = QuizCategoryResponseHolder.builder()
|
||||
.categoryList(quizService.getQuizCategoryList())
|
||||
|
||||
@@ -41,7 +41,7 @@ class EnumsControllerTest {
|
||||
@Test
|
||||
public void getEnumsQuizCategoryList() throws Exception {
|
||||
// given
|
||||
final String url = "/enums/quiz/category";
|
||||
final String url = "/enums/quiz-categories";
|
||||
|
||||
// when
|
||||
final ResultActions result = mockMvc.perform(
|
||||
@@ -57,7 +57,7 @@ class EnumsControllerTest {
|
||||
@Test
|
||||
public void getEnumsQuizLevelList() throws Exception {
|
||||
// given
|
||||
final String url = "/enums/quiz/level";
|
||||
final String url = "/enums/quiz-levels";
|
||||
|
||||
// when
|
||||
final ResultActions result = mockMvc.perform(
|
||||
@@ -73,7 +73,7 @@ class EnumsControllerTest {
|
||||
@Test
|
||||
public void getEnumsQuizDayList() throws Exception {
|
||||
// given
|
||||
final String url = "/enums/quiz/day";
|
||||
final String url = "/enums/quiz-days";
|
||||
|
||||
// when
|
||||
final ResultActions result = mockMvc.perform(
|
||||
|
||||
@@ -66,7 +66,7 @@ class QuizControllerTest {
|
||||
@Test
|
||||
public void getQuizCategory() throws Exception {
|
||||
// given
|
||||
final String url = "/quiz/category";
|
||||
final String url = "/quiz/categories";
|
||||
final long count = 15L;
|
||||
|
||||
final QuizCategoryResponse quizCategoryResponse = QuizCategoryResponse.builder()
|
||||
|
||||
Reference in New Issue
Block a user