From f6b4b376335ad8705c0ab9793ecec52f198a4a1f Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Sat, 23 Mar 2024 23:44:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9D=BC=EC=A0=95=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?,=20=EC=A1=B0=ED=9A=8C,=20=EC=88=98=EC=A0=95,=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20controller=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ScheduleController.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/presentation/ScheduleController.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/presentation/ScheduleController.java b/BE/error/src/main/java/com/example/demo/schedule/presentation/ScheduleController.java new file mode 100644 index 00000000..4985ebb9 --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/presentation/ScheduleController.java @@ -0,0 +1,56 @@ +package com.example.demo.schedule.presentation; + +import com.example.demo.common.presentation.response.ApiResponse; +import com.example.demo.common.presentation.response.ApiResponseBody.SuccessBody; +import com.example.demo.common.presentation.response.ApiResponseGenerator; +import com.example.demo.common.presentation.response.MessageCode; +import com.example.demo.schedule.application.dto.CreateScheduleRequest; +import com.example.demo.schedule.application.dto.UpdateScheduleRequest; +import com.example.demo.schedule.application.dto.YearCalendarResponse; +import com.sun.net.httpserver.Authenticator; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/api") +public class ScheduleController { + + @PostMapping("/calendar") + public ApiResponse> create( + @RequestBody CreateScheduleRequest createScheduleRequest) { + // 일정 생성하는 service logic + return ApiResponseGenerator.success(HttpStatus.OK, MessageCode.CREATE); + } + + @GetMapping("/calendar/{eventId}") + public ApiResponse> getSpecificCalendar ( + @PathVariable("eventId") Long eventId) { + // specific response 담아서 리턴 logic + return ApiResponseGenerator.success(response, HttpStatus.OK, MessageCode.GET); + } + + @GetMapping("/calendar") + public ApiResponse> getTypeCalendar ( + @RequestParam("period") String type) { + // type 별 response 담아서 리턴 logic + return ApiResponseGenerator.success(response, HttpStatus.OK, MessageCode.GET); + } + + @PutMapping("/calendar/{eventId}") + public ApiResponse> update( + @RequestBody UpdateScheduleRequest updateScheduleRequest, + @PathVariable("eventId") Long eventId) { + // 수정하는 logic + return ApiResponseGenerator.success(HttpStatus.OK, MessageCode.UPDATE); + } + + @DeleteMapping("/calendar/{eventId}") + public ApiResponse> delete( + @PathVariable("eventId") Long eventId) { + // 일정 삭제하는 logic + return return ApiResponseGenerator.success(HttpStatus.OK, MessageCode.DELETE); + } + +}