From f82ce3b7d5e52e143530214ed8e446375cb39cfc Mon Sep 17 00:00:00 2001 From: sunwoong Date: Thu, 4 Jan 2024 13:25:36 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=97=94=ED=8B=B0=ED=8B=B0=20=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4=20=EA=B5=AC=ED=98=84=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/doorip/user/domain/User.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 doorip-domain/src/main/java/org/doorip/user/domain/User.java diff --git a/doorip-domain/src/main/java/org/doorip/user/domain/User.java b/doorip-domain/src/main/java/org/doorip/user/domain/User.java new file mode 100644 index 0000000..abd5ea8 --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/user/domain/User.java @@ -0,0 +1,36 @@ +package org.doorip.user.domain; + +import jakarta.persistence.*; +import lombok.*; +import org.doorip.common.BaseTimeEntity; +import org.doorip.trip.domain.Participant; + +import java.util.ArrayList; +import java.util.List; + +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Builder(access = AccessLevel.PRIVATE) +@Getter +@Table(name = "users") +@Entity +public class User extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "user_id") + private Long id; + @Column(nullable = false) + private String name; + @Column(nullable = false) + private String intro; + private Integer result; + @Column(nullable = false) + private String platformId; + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private Platform platform; + private String refreshToken; + @Builder.Default + @OneToMany(mappedBy = "user", cascade = CascadeType.REMOVE) + private List participants = new ArrayList<>(); +} From 0066fdccb2c75e9af60031b25de2057e76a80f33 Mon Sep 17 00:00:00 2001 From: sunwoong Date: Thu, 4 Jan 2024 13:25:58 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=EC=97=AC=ED=96=89=20=EC=B0=B8?= =?UTF-8?q?=EC=97=AC=EC=9E=90=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=97=94?= =?UTF-8?q?=ED=8B=B0=ED=8B=B0=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/doorip/trip/domain/Participant.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 doorip-domain/src/main/java/org/doorip/trip/domain/Participant.java diff --git a/doorip-domain/src/main/java/org/doorip/trip/domain/Participant.java b/doorip-domain/src/main/java/org/doorip/trip/domain/Participant.java new file mode 100644 index 0000000..fd58ae8 --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/trip/domain/Participant.java @@ -0,0 +1,40 @@ +package org.doorip.trip.domain; + +import jakarta.persistence.*; +import lombok.*; +import org.doorip.common.BaseTimeEntity; +import org.doorip.todo.domain.Allocator; +import org.doorip.user.domain.User; + +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Builder(access = AccessLevel.PRIVATE) +@Getter +@Entity +public class Participant extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "participant_id") + private Long id; + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private Role role; + @Column(nullable = false) + private Integer styleA; + @Column(nullable = false) + private Integer styleB; + @Column(nullable = false) + private Integer styleC; + @Column(nullable = false) + private Integer styleD; + @Column(nullable = false) + private Integer styleE; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id") + private User user; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "trip_id") + private Trip trip; + @OneToOne(mappedBy = "participant", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) + private Allocator allocator; +} From d695db19c0726c5e07b0e5ce2586381e68a87ccc Mon Sep 17 00:00:00 2001 From: sunwoong Date: Thu, 4 Jan 2024 13:26:08 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EC=97=AC=ED=96=89=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=97=94=ED=8B=B0=ED=8B=B0=20=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4=20=EA=B5=AC=ED=98=84=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/doorip/trip/domain/Trip.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 doorip-domain/src/main/java/org/doorip/trip/domain/Trip.java diff --git a/doorip-domain/src/main/java/org/doorip/trip/domain/Trip.java b/doorip-domain/src/main/java/org/doorip/trip/domain/Trip.java new file mode 100644 index 0000000..265bf39 --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/trip/domain/Trip.java @@ -0,0 +1,36 @@ +package org.doorip.trip.domain; + +import jakarta.persistence.*; +import lombok.*; +import org.doorip.common.BaseTimeEntity; +import org.doorip.todo.domain.Todo; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; + +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Builder(access = AccessLevel.PRIVATE) +@Getter +@Entity +public class Trip extends BaseTimeEntity { + @Id + @GeneratedValue + @Column(name = "trip_id") + private Long id; + @Column(nullable = false) + private String title; + @Column(nullable = false) + private LocalDate startDate; + @Column(nullable = false) + private LocalDate endDate; + @Column(nullable = false) + private String code; + @Builder.Default + @OneToMany(mappedBy = "trip", cascade = CascadeType.REMOVE) + private List participants = new ArrayList<>(); + @Builder.Default + @OneToMany(mappedBy = "trip", cascade = CascadeType.REMOVE) + private List todos = new ArrayList<>(); +} From 376a9c5880e5c22b5a828944448bddc1b6feb93d Mon Sep 17 00:00:00 2001 From: sunwoong Date: Thu, 4 Jan 2024 13:26:29 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=EC=97=AC=ED=96=89=20TODO=20?= =?UTF-8?q?=EC=97=94=ED=8B=B0=ED=8B=B0=20=ED=81=B4=EB=9E=98=EC=8A=A4=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/doorip/todo/domain/Todo.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 doorip-domain/src/main/java/org/doorip/todo/domain/Todo.java diff --git a/doorip-domain/src/main/java/org/doorip/todo/domain/Todo.java b/doorip-domain/src/main/java/org/doorip/todo/domain/Todo.java new file mode 100644 index 0000000..560fcf7 --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/todo/domain/Todo.java @@ -0,0 +1,38 @@ +package org.doorip.todo.domain; + +import jakarta.persistence.*; +import lombok.*; +import org.doorip.common.BaseTimeEntity; +import org.doorip.trip.domain.Trip; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; + +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Builder(access = AccessLevel.PRIVATE) +@Getter +@Entity +public class Todo extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "todo_id") + private Long id; + @Column(nullable = false) + private String title; + private LocalDate endDate; + private String memo; + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private Secret secret; + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private Progress progress; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "trip_id") + private Trip trip; + @Builder.Default + @OneToMany(mappedBy = "todo", cascade = CascadeType.REMOVE) + private List allocators = new ArrayList<>(); +} From 0f3c7499c35f55da0d729af915d936ef230c002d Mon Sep 17 00:00:00 2001 From: sunwoong Date: Thu, 4 Jan 2024 13:26:39 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=EC=97=AC=ED=96=89=20TODO=20?= =?UTF-8?q?=EB=B0=B0=EC=A0=95=EC=9E=90=20=EC=97=94=ED=8B=B0=ED=8B=B0=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20=EA=B5=AC=ED=98=84=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/doorip/todo/domain/Allocator.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 doorip-domain/src/main/java/org/doorip/todo/domain/Allocator.java diff --git a/doorip-domain/src/main/java/org/doorip/todo/domain/Allocator.java b/doorip-domain/src/main/java/org/doorip/todo/domain/Allocator.java new file mode 100644 index 0000000..e246c1d --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/todo/domain/Allocator.java @@ -0,0 +1,24 @@ +package org.doorip.todo.domain; + +import jakarta.persistence.*; +import lombok.*; +import org.doorip.common.BaseTimeEntity; +import org.doorip.trip.domain.Participant; + +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Builder(access = AccessLevel.PRIVATE) +@Getter +@Entity +public class Allocator extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "allocator_id") + private Long id; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "participant_id") + private Todo todo; + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "todo_id") + private Participant participant; +} From c05b9698b450f72a2b192e1c2f26f563c06abb6c Mon Sep 17 00:00:00 2001 From: sunwoong Date: Thu, 4 Jan 2024 13:27:43 +0900 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=EB=8F=84=EB=A9=94=EC=9D=B8=20enum?= =?UTF-8?q?=20=EC=86=8D=EC=84=B1=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/doorip/todo/domain/Progress.java | 5 +++++ .../src/main/java/org/doorip/todo/domain/Secret.java | 5 +++++ doorip-domain/src/main/java/org/doorip/trip/domain/Role.java | 5 +++++ .../src/main/java/org/doorip/user/domain/Platform.java | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 doorip-domain/src/main/java/org/doorip/todo/domain/Progress.java create mode 100644 doorip-domain/src/main/java/org/doorip/todo/domain/Secret.java create mode 100644 doorip-domain/src/main/java/org/doorip/trip/domain/Role.java create mode 100644 doorip-domain/src/main/java/org/doorip/user/domain/Platform.java diff --git a/doorip-domain/src/main/java/org/doorip/todo/domain/Progress.java b/doorip-domain/src/main/java/org/doorip/todo/domain/Progress.java new file mode 100644 index 0000000..d90b40d --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/todo/domain/Progress.java @@ -0,0 +1,5 @@ +package org.doorip.todo.domain; + +public enum Progress { + INCOMPLETE, COMPLETE +} diff --git a/doorip-domain/src/main/java/org/doorip/todo/domain/Secret.java b/doorip-domain/src/main/java/org/doorip/todo/domain/Secret.java new file mode 100644 index 0000000..2ec6a7b --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/todo/domain/Secret.java @@ -0,0 +1,5 @@ +package org.doorip.todo.domain; + +public enum Secret { + OUR, MY +} diff --git a/doorip-domain/src/main/java/org/doorip/trip/domain/Role.java b/doorip-domain/src/main/java/org/doorip/trip/domain/Role.java new file mode 100644 index 0000000..cdbdfa7 --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/trip/domain/Role.java @@ -0,0 +1,5 @@ +package org.doorip.trip.domain; + +public enum Role { + HOST, PARTICIPATION +} diff --git a/doorip-domain/src/main/java/org/doorip/user/domain/Platform.java b/doorip-domain/src/main/java/org/doorip/user/domain/Platform.java new file mode 100644 index 0000000..c46c049 --- /dev/null +++ b/doorip-domain/src/main/java/org/doorip/user/domain/Platform.java @@ -0,0 +1,5 @@ +package org.doorip.user.domain; + +public enum Platform { + KAKAO, APPLE +}