Skip to content

Commit

Permalink
feat: 여행 TODO 생성 API 구현 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
SunwoongH committed Jan 8, 2024
1 parent 4fe26b9 commit a6e34b0
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.doorip.todo.api;

import lombok.RequiredArgsConstructor;
import org.doorip.common.ApiResponse;
import org.doorip.common.ApiResponseUtil;
import org.doorip.message.SuccessMessage;
import org.doorip.todo.dto.request.TodoCreateRequest;
import org.doorip.todo.service.TodoService;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@RequiredArgsConstructor
@RequestMapping("/api/todos")
@Controller
public class TodoApiController {
private final TodoService todoService;

@PostMapping
public ResponseEntity<ApiResponse<?>> createTripTodo(@RequestBody final TodoCreateRequest request) {
todoService.createTripTodo(request);
return ApiResponseUtil.success(SuccessMessage.CREATED);
}
}

0 comments on commit a6e34b0

Please sign in to comment.