Skip to content

Commit

Permalink
[FIX] E7-S3 맵핑 주소 변경 #99
Browse files Browse the repository at this point in the history
  • Loading branch information
nrudev committed Nov 21, 2021
1 parent b815818 commit 485ff62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@ public class CategoryController {

private final CategoryService categoryService;

@PostMapping("/category")
@PostMapping("/api/v1/category")
public ResponseEntity<CategoryDto> newCategory(@RequestBody CategorySaveRequestDto requestDto, @AuthenticationPrincipal PrincipalDetails principalDetails) {
CategoryDto newCategory = categoryService.create(requestDto, principalDetails.getAccount());

return new ResponseEntity<>(newCategory, HttpStatus.CREATED);
}

@GetMapping("/category")
@GetMapping("/api/v1/category")
public ResponseEntity<List<CategoryDto>> categoryList() {
return new ResponseEntity<>(categoryService.getList(), HttpStatus.OK);
}

@GetMapping("/category/{id}")
@GetMapping("/api/v1/category/{id}")
public ResponseEntity<CategoryDto> getOneCategory(@PathVariable Long id) {
return new ResponseEntity<>(categoryService.getDetail(id), HttpStatus.OK);
}

@PutMapping("/category/{id}")
@PutMapping("/api/v1/category/{id}")
public ResponseEntity<Long> updateCategory(@PathVariable Long id, @RequestBody CategoryUpdateRequestDto requestDto, @AuthenticationPrincipal PrincipalDetails principalDetails) {
Long updateResult = categoryService.update(id, requestDto, principalDetails.getAccount());
return new ResponseEntity<>(updateResult, HttpStatus.OK);
}

@PatchMapping("/category/{id}")
@PatchMapping("/api/v1/category/{id}")
public ResponseEntity<Long> deleteCategory(@PathVariable Long id) {
return new ResponseEntity<>(categoryService.delete(id), HttpStatus.OK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ public class MenuController {
@Autowired
MenuService menuService;

@PostMapping("/menu")
@PostMapping("/api/v1/menu")
public ResponseEntity<MenuDto> newMenu(@RequestBody MenuSaveRequestDto requestDto, @AuthenticationPrincipal PrincipalDetails principalDetails) {
MenuDto newMenu = menuService.create(requestDto, principalDetails.getAccount());
return new ResponseEntity<>(newMenu, HttpStatus.CREATED);
}

@GetMapping("/menu")
@GetMapping("/api/v1/menu")
public ResponseEntity<List<MenuDto>> menuList() {
return new ResponseEntity<>(menuService.getList(), HttpStatus.OK);
}

@GetMapping("/menu/{id}")
@GetMapping("/api/v1/menu/{id}")
public ResponseEntity<MenuDto> getOneMenu(@PathVariable Long id) {
return new ResponseEntity<>(menuService.getDetail(id), HttpStatus.OK);
}

@PutMapping("/menu/{id}")
@PutMapping("/api/v1/menu/{id}")
public ResponseEntity<Long> updateMenu(@PathVariable Long id, @RequestBody MenuUpdateRequestDto requestDto, @AuthenticationPrincipal PrincipalDetails principalDetails) {
return new ResponseEntity<>(menuService.update(id, requestDto, principalDetails.getAccount()), HttpStatus.OK);
}

@PatchMapping("/menu/{id}")
@PatchMapping("/api/v1/menu/{id}")
public ResponseEntity<Long> deleteMenu(@PathVariable Long id) {
return new ResponseEntity<>(menuService.delete(id), HttpStatus.OK);
}
Expand Down

0 comments on commit 485ff62

Please sign in to comment.