From 54fd0fbe51e3dabed22cf53ed81df37348a57817 Mon Sep 17 00:00:00 2001 From: zini9188 Date: Fri, 27 Oct 2023 17:21:45 +0900 Subject: [PATCH] feat : add entity --- .../com/tgd/trip/attraction/Attraction.java | 24 ++++++++++++++++++ .../java/com/tgd/trip/attraction/Gugun.java | 19 ++++++++++++++ .../java/com/tgd/trip/attraction/Sido.java | 17 +++++++++++++ .../java/com/tgd/trip/schedule/Schedule.java | 21 ++++++++++++++++ src/main/java/com/tgd/trip/user/User.java | 25 +++++++++++++++++++ 5 files changed, 106 insertions(+) create mode 100644 src/main/java/com/tgd/trip/attraction/Attraction.java create mode 100644 src/main/java/com/tgd/trip/attraction/Gugun.java create mode 100644 src/main/java/com/tgd/trip/attraction/Sido.java create mode 100644 src/main/java/com/tgd/trip/schedule/Schedule.java create mode 100644 src/main/java/com/tgd/trip/user/User.java diff --git a/src/main/java/com/tgd/trip/attraction/Attraction.java b/src/main/java/com/tgd/trip/attraction/Attraction.java new file mode 100644 index 0000000..6a43933 --- /dev/null +++ b/src/main/java/com/tgd/trip/attraction/Attraction.java @@ -0,0 +1,24 @@ +package com.tgd.trip.attraction; + +import lombok.Getter; +import lombok.Setter; + +import javax.persistence.*; + +@Entity +@Getter +@Setter +public class Attraction { + + @Id + private Long id; + @Column(columnDefinition = "TEXT") + private String title; + private String overview; + private String address; + private String zipCode; + private String tel; + private String imgUrl; + private Double latitude; + private Double longitude; +} diff --git a/src/main/java/com/tgd/trip/attraction/Gugun.java b/src/main/java/com/tgd/trip/attraction/Gugun.java new file mode 100644 index 0000000..fcfcff8 --- /dev/null +++ b/src/main/java/com/tgd/trip/attraction/Gugun.java @@ -0,0 +1,19 @@ +package com.tgd.trip.attraction; + +import lombok.*; + +import javax.persistence.*; + +@Entity +@Getter +@Setter +@NoArgsConstructor +public class Gugun { + + @Id + private Long code; + private String name; + @ManyToOne + @JoinColumn(name = "sido_code") + private Sido sido; +} diff --git a/src/main/java/com/tgd/trip/attraction/Sido.java b/src/main/java/com/tgd/trip/attraction/Sido.java new file mode 100644 index 0000000..1c32166 --- /dev/null +++ b/src/main/java/com/tgd/trip/attraction/Sido.java @@ -0,0 +1,17 @@ +package com.tgd.trip.attraction; + +import lombok.*; + +import javax.persistence.Entity; +import javax.persistence.Id; + +@Entity +@Getter +@Setter +@NoArgsConstructor +public class Sido { + + @Id + private Long code; + private String name; +} diff --git a/src/main/java/com/tgd/trip/schedule/Schedule.java b/src/main/java/com/tgd/trip/schedule/Schedule.java new file mode 100644 index 0000000..e6d3734 --- /dev/null +++ b/src/main/java/com/tgd/trip/schedule/Schedule.java @@ -0,0 +1,21 @@ +package com.tgd.trip.schedule; + +import lombok.*; + +import javax.persistence.Entity; +import javax.persistence.Id; + +@Getter +@Setter +@Entity +@NoArgsConstructor +public class Schedule { + + @Id + private Long scheduleId; + private String title; + private String content; + private Long like; + private String imgUrl; + private boolean viewYn; +} diff --git a/src/main/java/com/tgd/trip/user/User.java b/src/main/java/com/tgd/trip/user/User.java new file mode 100644 index 0000000..e2eb69f --- /dev/null +++ b/src/main/java/com/tgd/trip/user/User.java @@ -0,0 +1,25 @@ +package com.tgd.trip.user; + +import lombok.*; + +import javax.persistence.*; +import java.time.LocalDate; + +@Entity +@Getter +@Setter +@NoArgsConstructor +public class User { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long userId; + private String password; + private String name; + private String email; + private String role; + private String status; + private String provider; + private String providerId; + private LocalDate birth; +}