diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..fc021e7 Binary files /dev/null and b/.DS_Store differ diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..69cf241 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +## 요약 (Summary) +- [x] 작업 내용 요약 + +## 🔑 변경 사항 (Key Changes) + +- 변경 사항 작성 + +## 📝 리뷰 요구사항 (To Reviewers) + +- [ ] 리뷰 요구사항 작성 + +## 확인 방법 diff --git a/.gitignore b/.gitignore index 1071a26..feddecf 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ out/ ### VS Code ### .vscode/ +### macOS ### +.DS_Store \ No newline at end of file diff --git a/.gradle/8.9/checksums/md5-checksums.bin b/.gradle/8.9/checksums/md5-checksums.bin new file mode 100644 index 0000000..a46a08b Binary files /dev/null and b/.gradle/8.9/checksums/md5-checksums.bin differ diff --git a/.gradle/8.9/checksums/sha1-checksums.bin b/.gradle/8.9/checksums/sha1-checksums.bin new file mode 100644 index 0000000..c84a8d9 Binary files /dev/null and b/.gradle/8.9/checksums/sha1-checksums.bin differ diff --git a/settings.gradle b/settings.gradle index 0a383dd..c2e9956 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ rootProject.name = 'demo' +include 'github' + diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..97b860f Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/main/java/com/example/likelion12/domain/ActivityRegion.java b/src/main/java/com/example/likelion12/domain/ActivityRegion.java new file mode 100644 index 0000000..20ed722 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/ActivityRegion.java @@ -0,0 +1,39 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class ActivityRegion extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "activity_region_id", nullable = false) + private long activityRegionId; + + @Column(nullable = false) + private String activityRegionName; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + @JsonIgnore + @OneToMany(mappedBy = "activityRegion") + private List crewList = new ArrayList<>(); + + @JsonIgnore + @OneToMany(mappedBy = "activityRegion") + private List socialringList = new ArrayList<>(); +} diff --git a/src/main/java/com/example/likelion12/domain/Crew.java b/src/main/java/com/example/likelion12/domain/Crew.java new file mode 100644 index 0000000..ce33c97 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/Crew.java @@ -0,0 +1,76 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseGender; +import com.example.likelion12.domain.base.BaseLevel; +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +import static jakarta.persistence.FetchType.LAZY; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class Crew extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "crew_id", nullable = false) + private long crewId; + + @Column(nullable = false) + private String crewName; + + private String crewImg; + + @Column(nullable = false) + private int totalRecruits; + + @Column(nullable = false) + private int crewCost; + + @Column(nullable = false) + private String comment; + + @Column(nullable = false) + private String commentSimple; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseGender gender; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseLevel level; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + @JsonIgnore + @OneToMany(mappedBy = "crew") + private List memberCrewList = new ArrayList<>(); + + /** 체육시설 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "facility_id") + private Facility facility; + + /** 활동지역 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "activity_region_id") + private ActivityRegion activityRegion; + + /** 운동종목 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "exercise_id") + private Exercise exercise; +} diff --git a/src/main/java/com/example/likelion12/domain/Exercise.java b/src/main/java/com/example/likelion12/domain/Exercise.java new file mode 100644 index 0000000..b7f1f44 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/Exercise.java @@ -0,0 +1,39 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class Exercise extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "exercise_id", nullable = false) + private long exerciseId; + + @Column(nullable = false) + private String exerciseName; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + @JsonIgnore + @OneToMany(mappedBy = "exercise") + private List crewList = new ArrayList<>(); + + @JsonIgnore + @OneToMany(mappedBy = "exercise") + private List socialringList = new ArrayList<>(); +} diff --git a/src/main/java/com/example/likelion12/domain/Facility.java b/src/main/java/com/example/likelion12/domain/Facility.java new file mode 100644 index 0000000..ae45590 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/Facility.java @@ -0,0 +1,56 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +import static jakarta.persistence.FetchType.LAZY; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class Facility extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "facility_id", nullable = false) + private long facilityId; + + @Column(nullable = false) + private String facilityName; + + @Column(nullable = false) + private String facilityAddress; + + private String facilityPhone; + private String facilitySize; + private String administer; + private LocalDateTime weekday; + private LocalDateTime weekend; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + @JsonIgnore + @OneToMany(mappedBy = "facility") + private List reviewList = new ArrayList<>(); + + @JsonIgnore + @OneToMany(mappedBy = "facility") + private List socialringList = new ArrayList<>(); + + @JsonIgnore + @OneToMany(mappedBy = "facility") + private List crewList = new ArrayList<>(); +} diff --git a/src/main/java/com/example/likelion12/domain/Member.java b/src/main/java/com/example/likelion12/domain/Member.java new file mode 100644 index 0000000..8a6266d --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/Member.java @@ -0,0 +1,60 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import com.example.likelion12.domain.base.BaseGender; +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class Member extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "member_id", nullable = false) + private long memberId; + + @Column(nullable = false) + private String memberName; + + @Column(nullable = false) + private String id; + + @Column(nullable = false) + private String password; + + private String memberImg; + + @Column(nullable = false) + private String memberPhone; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseGender gender; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + @JsonIgnore + @OneToMany(mappedBy = "member") + private List reviewList = new ArrayList<>(); + + @JsonIgnore + @OneToMany(mappedBy = "member") + private List memerSocialringList = new ArrayList<>(); + + @JsonIgnore + @OneToMany(mappedBy = "member") + private List memberCrewList = new ArrayList<>(); + +} diff --git a/src/main/java/com/example/likelion12/domain/MemberCrew.java b/src/main/java/com/example/likelion12/domain/MemberCrew.java new file mode 100644 index 0000000..d0e8935 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/MemberCrew.java @@ -0,0 +1,42 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseRole; +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import static jakarta.persistence.FetchType.LAZY; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class MemberCrew extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "member_crew_id", nullable = false) + private long memberCrewId; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseRole role; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + /** 크루 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "crew_id") + private Crew crew; + + /** 멤버 와의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "member_id") + private Member member; + +} diff --git a/src/main/java/com/example/likelion12/domain/MemberSocialring.java b/src/main/java/com/example/likelion12/domain/MemberSocialring.java new file mode 100644 index 0000000..264b57a --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/MemberSocialring.java @@ -0,0 +1,42 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseRole; +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import static jakarta.persistence.FetchType.LAZY; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class MemberSocialring extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "member_socialring_id", nullable = false) + private long memberSocialringId; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseRole role; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + /** 크루 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "socialring_id") + private Socialring socialring; + + /** 멤버 와의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "member_id") + private Member member; + +} diff --git a/src/main/java/com/example/likelion12/domain/Review.java b/src/main/java/com/example/likelion12/domain/Review.java new file mode 100644 index 0000000..abf39ab --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/Review.java @@ -0,0 +1,42 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import static jakarta.persistence.FetchType.LAZY; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class Review extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "review_id", nullable = false) + private long reviewId; + + @Column(nullable = false) + private String comment; + + @Column(nullable = false) + private int ranking; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + /** 멤버 와의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "member_id") + private Member member; + + /** 체육시설 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "facility_id") + private Facility facility; +} diff --git a/src/main/java/com/example/likelion12/domain/Socialring.java b/src/main/java/com/example/likelion12/domain/Socialring.java new file mode 100644 index 0000000..8468678 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/Socialring.java @@ -0,0 +1,80 @@ +package com.example.likelion12.domain; + +import com.example.likelion12.domain.base.BaseGender; +import com.example.likelion12.domain.base.BaseLevel; +import com.example.likelion12.domain.base.BaseStatus; +import com.example.likelion12.domain.base.BaseTime; +import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +import static jakarta.persistence.FetchType.LAZY; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor +public class Socialring extends BaseTime { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "socialring_id", nullable = false) + private long socialringId; + + @Column(nullable = false) + private String socialringName; + + private String socialringImg; + + @Column(nullable = false) + private int totalRecruits; + + @Column(nullable = false) + private LocalDateTime socialringDate; + + @Column(nullable = false) + private int socialringCost; + + @Column(nullable = false) + private String comment; + + @Column(nullable = false) + private String commentSimple; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseGender gender; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseLevel level; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private BaseStatus status; + + @JsonIgnore + @OneToMany(mappedBy = "socialring") + private List memberSocialringList = new ArrayList<>(); + + /** 체육시설 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "facility_id") + private Facility facility; + + /** 활동지역 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "activity_region_id") + private ActivityRegion activityRegion; + + /** 운동종목 과의 연관관계의 주인 */ + @ManyToOne(fetch = LAZY) + @JoinColumn(name = "exercise_id") + private Exercise exercise; +} diff --git a/src/main/java/com/example/likelion12/domain/base/BaseGender.java b/src/main/java/com/example/likelion12/domain/base/BaseGender.java new file mode 100644 index 0000000..5730863 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/base/BaseGender.java @@ -0,0 +1,6 @@ +package com.example.likelion12.domain.base; + +public enum BaseGender { + F, M, U + +} diff --git a/src/main/java/com/example/likelion12/domain/base/BaseLevel.java b/src/main/java/com/example/likelion12/domain/base/BaseLevel.java new file mode 100644 index 0000000..aae816d --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/base/BaseLevel.java @@ -0,0 +1,5 @@ +package com.example.likelion12.domain.base; + +public enum BaseLevel { + S, A, B, C; +} diff --git a/src/main/java/com/example/likelion12/domain/base/BaseRole.java b/src/main/java/com/example/likelion12/domain/base/BaseRole.java new file mode 100644 index 0000000..9b5cfcc --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/base/BaseRole.java @@ -0,0 +1,6 @@ +package com.example.likelion12.domain.base; + +public enum BaseRole { + CAPTAIN, + CREW +} diff --git a/src/main/java/com/example/likelion12/domain/base/BaseStatus.java b/src/main/java/com/example/likelion12/domain/base/BaseStatus.java new file mode 100644 index 0000000..4d35fa7 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/base/BaseStatus.java @@ -0,0 +1,6 @@ +package com.example.likelion12.domain.base; + +public enum BaseStatus { + ACTIVE, + DELETE +} diff --git a/src/main/java/com/example/likelion12/domain/base/BaseTime.java b/src/main/java/com/example/likelion12/domain/base/BaseTime.java new file mode 100644 index 0000000..202a913 --- /dev/null +++ b/src/main/java/com/example/likelion12/domain/base/BaseTime.java @@ -0,0 +1,23 @@ +package com.example.likelion12.domain.base; + +import jakarta.persistence.Column; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.MappedSuperclass; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import java.time.LocalDateTime; + +@MappedSuperclass +@EntityListeners(AuditingEntityListener.class) +public class BaseTime { + + @CreatedDate + @Column(nullable = false) + private LocalDateTime createdAt; + + @LastModifiedDate + private LocalDateTime modifiedAt; + +}