Skip to content

Commit

Permalink
♻️ refactor: url 변수 카멜 case로 변경
Browse files Browse the repository at this point in the history
+ 업데이트 mapping PutMapping으로 변경
  • Loading branch information
dong2ast committed Nov 7, 2023
1 parent a7745df commit 2bc2cd6
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -44,29 +45,29 @@ public ApiResponseDto<?> createGroupPray(@RequestBody GroupPrayRequestDto groupP
}

@Operation(summary = "모임 기도제목 수정")
@PostMapping("/update")
@PutMapping
public ApiResponseDto<?> updateGroupPray(@RequestBody GroupPrayUpdateDto groupPrayUpdateDto) {
groupPrayService.updateGroupPray(groupPrayUpdateDto);
return ApiResponseDto.success(SuccessStatus.UPDATE_GROUP_PRAY_SUCCESS,
SuccessStatus.UPDATE_GROUP_PRAY_SUCCESS.getMessage());
}

@Operation(summary = "모임 기도제목 조회")
@GetMapping("/{group-id}")
@GetMapping("/{groupId}")
@ApiResponse(
responseCode = "200",
description = "모임 기도제목 목록 반환",
content = @Content(schema = @Schema(implementation = GroupPrayResponseDto.class)))
public ApiResponseDto<List<GroupPrayResponseDto>> getGroupPray(
@PathVariable(name = "group-id") Long groupId,
@PathVariable(name = "groupId") Long groupId,
@Parameter(hidden = true) @AuthenticationPrincipal User user) {
return ApiResponseDto.success(SuccessStatus.GET_GROUP_PRAY_LIST_SUCCESS,
groupPrayService.getGroupPray(groupId, user.getUsername()));
}

@Operation(summary = "모임 기도제목 삭제")
@DeleteMapping("/{grouppray-id}")
public ApiResponseDto<?> deleteGroupPray(@PathVariable(name = "grouppray-id") Long id) {
@DeleteMapping("/{groupPrayId}")
public ApiResponseDto<?> deleteGroupPray(@PathVariable(name = "groupPrayId") Long id) {
groupPrayService.deleteGroupPray(id);
return ApiResponseDto.success(SuccessStatus.DELETE_GROUP_PRAY_SUCCESS,
SuccessStatus.DELETE_GROUP_PRAY_SUCCESS.getMessage());
Expand Down

0 comments on commit 2bc2cd6

Please sign in to comment.