diff --git a/src/main/java/org/sopt/sopkerton/program/domain/Employment.java b/src/main/java/org/sopt/sopkerton/program/domain/Employment.java deleted file mode 100644 index 2c01d35..0000000 --- a/src/main/java/org/sopt/sopkerton/program/domain/Employment.java +++ /dev/null @@ -1,15 +0,0 @@ -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 index e8fd2a3..f839c10 100644 --- a/src/main/java/org/sopt/sopkerton/program/domain/Program.java +++ b/src/main/java/org/sopt/sopkerton/program/domain/Program.java @@ -19,12 +19,10 @@ @Getter @Entity -@Inheritance(strategy = InheritanceType.SINGLE_TABLE) -@DiscriminatorColumn(name = "program_type") @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "programs") -public abstract class Program extends BaseEntity { +public class Program extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "program_id") @@ -34,7 +32,9 @@ public abstract class Program extends BaseEntity { private String title; private String imageUrl; + private String type; + @Enumerated(value = EnumType.STRING) private Status status; @@ -46,4 +46,7 @@ public abstract class Program extends BaseEntity { @Column(nullable = false) private String content; + + private int volunteerHours; + private int salary; } diff --git a/src/main/java/org/sopt/sopkerton/program/domain/Status.java b/src/main/java/org/sopt/sopkerton/program/domain/Status.java index 621c9af..551bf3b 100644 --- a/src/main/java/org/sopt/sopkerton/program/domain/Status.java +++ b/src/main/java/org/sopt/sopkerton/program/domain/Status.java @@ -7,5 +7,8 @@ @Getter @RequiredArgsConstructor(access = AccessLevel.PRIVATE) public enum Status { - REGISTER, DONE; + REGISTER("지원"), + DONE("완료"); + + private final String value; } diff --git a/src/main/java/org/sopt/sopkerton/program/domain/Volunteering.java b/src/main/java/org/sopt/sopkerton/program/domain/Volunteering.java deleted file mode 100644 index d19fa8f..0000000 --- a/src/main/java/org/sopt/sopkerton/program/domain/Volunteering.java +++ /dev/null @@ -1,14 +0,0 @@ -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; -} diff --git a/src/main/java/org/sopt/sopkerton/program/dto/response/ProgramListResponse.java b/src/main/java/org/sopt/sopkerton/program/dto/response/ProgramListResponse.java index 707e054..1e43bdb 100644 --- a/src/main/java/org/sopt/sopkerton/program/dto/response/ProgramListResponse.java +++ b/src/main/java/org/sopt/sopkerton/program/dto/response/ProgramListResponse.java @@ -9,6 +9,7 @@ public record ProgramListResponse( String title, String registerAt, String imageUrl, + String status, String Region ) { diff --git a/src/main/java/org/sopt/sopkerton/program/service/ProgramService.java b/src/main/java/org/sopt/sopkerton/program/service/ProgramService.java index bc29012..9aca4db 100644 --- a/src/main/java/org/sopt/sopkerton/program/service/ProgramService.java +++ b/src/main/java/org/sopt/sopkerton/program/service/ProgramService.java @@ -24,6 +24,7 @@ public List getProgramListByProgramType(String programType) program.getTitle(), formatToLocalDate(program.getRegisterAt()), program.getImageUrl(), + program.getStatus().getValue(), program.getRegion() )) .collect(Collectors.toList());