-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
137 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...main/java/ddingdong/ddingdongBE/domain/form/controller/dto/response/FormListResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package ddingdong.ddingdongBE.domain.form.controller.dto.response; | ||
|
||
import ddingdong.ddingdongBE.domain.form.service.dto.query.FormListQuery; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.LocalDate; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record FormListResponse( | ||
@Schema(description = "지원 폼지 ID", example = "1") | ||
Long formId, | ||
@Schema(description = "지원 폼지 제목", example = "폼지 제목입니다.") | ||
String title, | ||
@Schema(description = "지원 폼지 시작일", example = "2001-01-01") | ||
LocalDate startDate, | ||
@Schema(description = "지원 폼지 종료일", example = "2001-01-02") | ||
LocalDate endData, | ||
@Schema(description = "활성화 여부", example = "true") | ||
boolean isActive | ||
) { | ||
|
||
public static FormListResponse from(FormListQuery query) { | ||
return FormListResponse.builder() | ||
.formId(query.formId()) | ||
.title(query.title()) | ||
.startDate(query.startDate()) | ||
.endData(query.endData()) | ||
.isActive(query.isActive()) | ||
.build(); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/ddingdong/ddingdongBE/domain/form/repository/FormRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package ddingdong.ddingdongBE.domain.form.repository; | ||
|
||
import ddingdong.ddingdongBE.domain.club.entity.Club; | ||
import ddingdong.ddingdongBE.domain.form.entity.Form; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface FormRepository extends JpaRepository<Form, Long> { | ||
|
||
List<Form> findAllByClub(Club club); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/ddingdong/ddingdongBE/domain/form/service/dto/query/FormListQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ddingdong.ddingdongBE.domain.form.service.dto.query; | ||
|
||
import ddingdong.ddingdongBE.domain.form.entity.Form; | ||
import java.time.LocalDate; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record FormListQuery( | ||
Long formId, | ||
String title, | ||
LocalDate startDate, | ||
LocalDate endData, | ||
boolean isActive | ||
) { | ||
|
||
public static FormListQuery from(Form form, boolean isActive) { | ||
return FormListQuery.builder() | ||
.formId(form.getId()) | ||
.title(form.getTitle()) | ||
.startDate(form.getStartDate()) | ||
.endData(form.getEndDate()) | ||
.isActive(isActive) | ||
.build(); | ||
} | ||
|
||
} |