From c001b86d46e05fe27eb527f0317165a7ee72100a Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:16:44 +0900 Subject: [PATCH 01/11] feat: Schedule entity --- .../schedule/persistence/ScheduleEntity.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleEntity.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleEntity.java b/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleEntity.java new file mode 100644 index 00000000..fa20aadf --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleEntity.java @@ -0,0 +1,46 @@ +package com.example.demo.schedule.persistence; + +import jakarta.persistence.*; +import lombok.*; + +import java.time.LocalDateTime; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +//@AllArgsConstructor(access = AccessLevel.PRIVATE) +@ToString +@Entity +public class ScheduleEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long eventId; + + @Column(nullable = false) + private String eventName; + + @Column(nullable = false) + private LocalDateTime eventStartDate; + private LocalDateTime eventEndDate; + + @Column(nullable = false) + private String eventInfo; + + @Column(nullable = false) + private String eventPlace; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private ScheduleType scheduleTypeType; + + @Builder + public ScheduleEntity(Long eventId, String eventName, LocalDateTime eventStartDate, LocalDateTime eventEndDate, String eventInfo, String eventPlace, ScheduleType eventType) { + //this.eventId = eventId; + this.eventName = eventName; + this.eventStartDate = eventStartDate; + this.eventEndDate = eventEndDate; + this.eventInfo = eventInfo; + this.eventPlace = eventPlace; + this.scheduleTypeType = eventType; + } +} From ab9acda790a6ca91ff6eca539f0224718786aa23 Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:19:57 +0900 Subject: [PATCH 02/11] =?UTF-8?q?feat:=20sprint=201-2=20schedule=20reposit?= =?UTF-8?q?ory=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/schedule/persistence/ScheduleRepository.java | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleRepository.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleRepository.java b/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleRepository.java new file mode 100644 index 00000000..9ead1027 --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleRepository.java @@ -0,0 +1,6 @@ +package com.example.demo.schedule.persistence; + +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ScheduleRepository extends JpaRepository { +} From ef83ae32b756154fa050c48cda28f9eecd7cef71 Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:20:55 +0900 Subject: [PATCH 03/11] =?UTF-8?q?feat:=20Schedule=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/demo/schedule/persistence/ScheduleType.java | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleType.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleType.java b/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleType.java new file mode 100644 index 00000000..8b620795 --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/persistence/ScheduleType.java @@ -0,0 +1,6 @@ +package com.example.demo.schedule.persistence; + +public enum ScheduleType { + PUBLIC, + PRIVATE +} From cb7293f664d81c32b88bc1b3ee63cfe0163e6e05 Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:22:12 +0900 Subject: [PATCH 04/11] =?UTF-8?q?feat:=20=EC=9D=BC=EC=A0=95=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=9A=94=EC=B2=AD=20dto=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/CreateScheduleRequest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/application/dto/CreateScheduleRequest.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/application/dto/CreateScheduleRequest.java b/BE/error/src/main/java/com/example/demo/schedule/application/dto/CreateScheduleRequest.java new file mode 100644 index 00000000..b320eede --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/application/dto/CreateScheduleRequest.java @@ -0,0 +1,22 @@ +package com.example.demo.schedule.application.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +@Builder(toBuilder = true) +public class CreateScheduleRequest { + + private String eventName; + private LocalDateTime eventStartDate; + private LocalDateTime eventEndDate; + private String eventInfo; + private String eventPlace; + +} From 0dc731496242ee87715e1c0b60e72e70e740d19a Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:22:55 +0900 Subject: [PATCH 05/11] =?UTF-8?q?feat:=20=EC=9B=94=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20dto=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/MonthCalendarResponse.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/application/dto/MonthCalendarResponse.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/application/dto/MonthCalendarResponse.java b/BE/error/src/main/java/com/example/demo/schedule/application/dto/MonthCalendarResponse.java new file mode 100644 index 00000000..ec01da96 --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/application/dto/MonthCalendarResponse.java @@ -0,0 +1,19 @@ +package com.example.demo.schedule.application.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +@Builder(toBuilder = true) +public class MonthCalendarResponse { + private Long eventId; + private String eventName; + private LocalDateTime eventStartDate; + +} From 6d23d7578a29976323c6869ac0be957841d90dad Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:23:28 +0900 Subject: [PATCH 06/11] =?UTF-8?q?feat:=20=EC=9D=BC=EC=A0=95=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EC=9A=94=EC=B2=AD=20dto=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/UpdateScheduleRequest.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/application/dto/UpdateScheduleRequest.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/application/dto/UpdateScheduleRequest.java b/BE/error/src/main/java/com/example/demo/schedule/application/dto/UpdateScheduleRequest.java new file mode 100644 index 00000000..a34b4a95 --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/application/dto/UpdateScheduleRequest.java @@ -0,0 +1,25 @@ +package com.example.demo.schedule.application.dto; + + +import com.example.demo.schedule.persistence.ScheduleType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +@Builder(toBuilder = true) +public class UpdateScheduleRequest { + private Long eventId; + private String eventName; + private LocalDateTime eventStartDate; + private LocalDateTime eventEndDate; + private String eventInfo; + private String eventPlace; + private ScheduleType eventType; +} + From 8762935325c69fe44e295af81bc639d19fd177f2 Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:24:01 +0900 Subject: [PATCH 07/11] =?UTF-8?q?feat:=20=EB=85=84=EB=8F=84=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=9D=91=EB=8B=B5=20dto=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/dto/YearCalendarResponse.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/application/dto/YearCalendarResponse.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/application/dto/YearCalendarResponse.java b/BE/error/src/main/java/com/example/demo/schedule/application/dto/YearCalendarResponse.java new file mode 100644 index 00000000..ca057aca --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/application/dto/YearCalendarResponse.java @@ -0,0 +1,17 @@ +package com.example.demo.schedule.application.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +@Builder(toBuilder = true) +public class YearCalendarResponse { + private Long eventId; + private LocalDateTime eventStartDate; +} From e03f53700cec9dc7a9dc15f38d4bb17cd19995f9 Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:25:14 +0900 Subject: [PATCH 08/11] =?UTF-8?q?feat:=20=EC=9D=BC=EC=A0=95=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=ED=9B=84=20=EC=9D=91=EB=8B=B5=20dto=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/dto/CreateScheduleResponse.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/application/dto/CreateScheduleResponse.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/application/dto/CreateScheduleResponse.java b/BE/error/src/main/java/com/example/demo/schedule/application/dto/CreateScheduleResponse.java new file mode 100644 index 00000000..c83f7a1c --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/application/dto/CreateScheduleResponse.java @@ -0,0 +1,12 @@ +package com.example.demo.schedule.application.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +@Builder(toBuilder = true) +public class CreateScheduleResponse { private Long eventId;} From c8eef2d855945ff105893a294947171ccfa41212 Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:26:00 +0900 Subject: [PATCH 09/11] =?UTF-8?q?feat:=20=ED=8A=B9=EC=A0=95=20=EC=9D=BC?= =?UTF-8?q?=EC=A0=95=20=EC=A1=B0=ED=9A=8C=20=EC=9D=91=EB=8B=B5=20dto=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/SpecificScheduleResopnse.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/application/dto/SpecificScheduleResopnse.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/application/dto/SpecificScheduleResopnse.java b/BE/error/src/main/java/com/example/demo/schedule/application/dto/SpecificScheduleResopnse.java new file mode 100644 index 00000000..09efd251 --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/application/dto/SpecificScheduleResopnse.java @@ -0,0 +1,20 @@ +package com.example.demo.schedule.application.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +@Builder(toBuilder = true) +public class SpecificScheduleResopnse { + private Long eventId; + private String eventName; + private String eventInfo; + private LocalDateTime eventStartDate; + private LocalDateTime eventEndDate; +} From 06dff0d3f5de2ba12766915bb0dc666863bec5d1 Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Wed, 20 Mar 2024 21:26:38 +0900 Subject: [PATCH 10/11] =?UTF-8?q?feat:=20=EC=A3=BC=20=EB=8B=A8=EC=9C=84=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=9D=91=EB=8B=B5=20dto=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/WeekDayCalendarResponse.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 BE/error/src/main/java/com/example/demo/schedule/application/dto/WeekDayCalendarResponse.java diff --git a/BE/error/src/main/java/com/example/demo/schedule/application/dto/WeekDayCalendarResponse.java b/BE/error/src/main/java/com/example/demo/schedule/application/dto/WeekDayCalendarResponse.java new file mode 100644 index 00000000..81cefce2 --- /dev/null +++ b/BE/error/src/main/java/com/example/demo/schedule/application/dto/WeekDayCalendarResponse.java @@ -0,0 +1,19 @@ +package com.example.demo.schedule.application.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +@Builder(toBuilder = true) +public class WeekDayCalendarResponse { + private Long eventId; + private String eventName; + private LocalDateTime eventStartDate; + private LocalDateTime eventEndDate; +} From f6b4b376335ad8705c0ab9793ecec52f198a4a1f Mon Sep 17 00:00:00 2001 From: capDoYeonLee Date: Sat, 23 Mar 2024 23:44:29 +0900 Subject: [PATCH 11/11] =?UTF-8?q?feat:=20=EC=9D=BC=EC=A0=95=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1,=20=EC=A1=B0=ED=9A=8C,=20=EC=88=98=EC=A0=95,=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20controller=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B5=AC=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); + } + +}