Skip to content

Commit

Permalink
feat: 여행 TODO 수정 API 구현 (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
SunwoongH committed Mar 4, 2024
1 parent ee9012e commit eb21f35
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.doorip.common.ApiResponseUtil;
import org.doorip.common.BaseResponse;
import org.doorip.message.SuccessMessage;
import org.doorip.trip.dto.request.TodoCreateRequest;
import org.doorip.trip.dto.request.TodoCreateAndUpdateRequest;
import org.doorip.trip.dto.response.TodoDetailGetResponse;
import org.doorip.trip.dto.response.TodoGetResponse;
import org.doorip.trip.service.TodoService;
Expand All @@ -25,7 +25,7 @@ public class TodoApiController implements TodoApi {
@Override
public ResponseEntity<BaseResponse<?>> createTripTodo(@UserId final Long userId,
@PathVariable final Long tripId,
@RequestBody final TodoCreateRequest request) {
@RequestBody final TodoCreateAndUpdateRequest request) {
todoService.createTripTodo(userId, tripId, request);
return ApiResponseUtil.success(SuccessMessage.CREATED);
}
Expand All @@ -49,6 +49,15 @@ public ResponseEntity<BaseResponse<?>> getTripTodo(@UserId final Long userId,
return ApiResponseUtil.success(SuccessMessage.OK, response);
}

@PatchMapping("/{tripId}/todos/{todoId}")
public ResponseEntity<BaseResponse<?>> updateTripTodo(@UserId final Long userId,
@PathVariable final Long tripId,
@PathVariable final Long todoId,
@RequestBody final TodoCreateAndUpdateRequest request) {
todoService.updateTripTodo(userId, tripId, todoId, request);
return ApiResponseUtil.success(SuccessMessage.OK);
}

@DeleteMapping("/todos/{todoId}")
@Override
public ResponseEntity<BaseResponse<?>> deleteTripTodo(@PathVariable final Long todoId) {
Expand Down

0 comments on commit eb21f35

Please sign in to comment.