diff --git a/README.md b/README.md index 1394388..48c1b5d 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ 이러한 사회적 낙인은 범죄자들이 방치되며 재범으로 이어지는 악순환을 반복시킨다.
따라서 우리는 이들의 변화 의지를 일으켜 일상을 회복하도록 돕고, 더 나은 사회를 만드는 것에 이바지하려 한다. +
## 📌 Tech Stacks @@ -43,6 +44,7 @@ - **Version Control** : Git +
diff --git a/src/main/java/org/sopt/sopkerton/common/domain/BaseEntity.java b/src/main/java/org/sopt/sopkerton/common/domain/BaseEntity.java index b4f3be6..01ec6c3 100644 --- a/src/main/java/org/sopt/sopkerton/common/domain/BaseEntity.java +++ b/src/main/java/org/sopt/sopkerton/common/domain/BaseEntity.java @@ -1,6 +1,5 @@ package org.sopt.sopkerton.common.domain; -import jakarta.persistence.Column; import jakarta.persistence.EntityListeners; import jakarta.persistence.MappedSuperclass; import java.time.LocalDateTime; @@ -14,10 +13,8 @@ @EntityListeners(AuditingEntityListener.class) public class BaseEntity { @CreatedDate - @Column(name = "register_at") private LocalDateTime registerAt; @LastModifiedDate - @Column(name = "done_at") private LocalDateTime doneAt; } diff --git a/src/main/java/org/sopt/sopkerton/program/domain/Category.java b/src/main/java/org/sopt/sopkerton/program/domain/Category.java new file mode 100644 index 0000000..2a10653 --- /dev/null +++ b/src/main/java/org/sopt/sopkerton/program/domain/Category.java @@ -0,0 +1,14 @@ +package org.sopt.sopkerton.program.domain; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor(access = AccessLevel.PRIVATE) +public enum Category { + VOLUNTEERING("봉사"), + EMPLOYMENT("취업"); + + private final String value; +} diff --git a/src/main/java/org/sopt/sopkerton/program/domain/Employment.java b/src/main/java/org/sopt/sopkerton/program/domain/Employment.java new file mode 100644 index 0000000..2c01d35 --- /dev/null +++ b/src/main/java/org/sopt/sopkerton/program/domain/Employment.java @@ -0,0 +1,15 @@ +package org.sopt.sopkerton.program.domain; + +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; + + +@Entity +@DiscriminatorValue("EMPLOYMENT") +@NoArgsConstructor +@AllArgsConstructor +public class Employment extends Program{ + private int salary; +} diff --git a/src/main/java/org/sopt/sopkerton/program/domain/Program.java b/src/main/java/org/sopt/sopkerton/program/domain/Program.java new file mode 100644 index 0000000..31ab2e4 --- /dev/null +++ b/src/main/java/org/sopt/sopkerton/program/domain/Program.java @@ -0,0 +1,47 @@ +package org.sopt.sopkerton.program.domain; + +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.Table; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.sopt.sopkerton.common.domain.BaseEntity; + +@Getter +@Entity +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PROTECTED) +@Table(name = "programs") +public abstract class Program extends BaseEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(nullable = false) + private String title; + + @Enumerated(EnumType.STRING) + @Column(nullable = false) + private Category category; + + @Column(nullable = false) + private String organizationName; + + @Column(nullable = false) + private String region; + + @Column(nullable = false) + private String content; +} diff --git a/src/main/java/org/sopt/sopkerton/program/domain/Volunteering.java b/src/main/java/org/sopt/sopkerton/program/domain/Volunteering.java new file mode 100644 index 0000000..d19fa8f --- /dev/null +++ b/src/main/java/org/sopt/sopkerton/program/domain/Volunteering.java @@ -0,0 +1,14 @@ +package org.sopt.sopkerton.program.domain; + +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; + +@Entity +@DiscriminatorValue("VOLUNTEERING") +@NoArgsConstructor +@AllArgsConstructor +public class Volunteering extends Program{ + private int volunteerHours; +}