generated from Bamdoliro/repository-generator
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[새기능]전체 입학등록원 및 금연서약서 조회
- Loading branch information
Showing
16 changed files
with
566 additions
and
196 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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/bamdoliro/maru/application/form/EnterFormUseCase.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,29 @@ | ||
package com.bamdoliro.maru.application.form; | ||
|
||
import com.bamdoliro.maru.domain.form.domain.Form; | ||
import com.bamdoliro.maru.domain.form.exception.InvalidFormStatusException; | ||
import com.bamdoliro.maru.domain.form.service.FormFacade; | ||
import com.bamdoliro.maru.domain.user.domain.User; | ||
import com.bamdoliro.maru.shared.annotation.UseCase; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@RequiredArgsConstructor | ||
@UseCase | ||
public class EnterFormUseCase { | ||
|
||
private final FormFacade formFacade; | ||
|
||
@Transactional | ||
public void execute(User user) { | ||
Form form = formFacade.getForm(user); | ||
validate(form); | ||
|
||
form.enter(); | ||
} | ||
|
||
private void validate(Form form) { | ||
if(!form.isPassedNow() && !form.isEntered()) | ||
throw new InvalidFormStatusException(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/bamdoliro/maru/application/form/QueryAdmissionAndPledgeUrlUseCase.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,28 @@ | ||
package com.bamdoliro.maru.application.form; | ||
|
||
import com.bamdoliro.maru.infrastructure.persistence.form.FormRepository; | ||
import com.bamdoliro.maru.infrastructure.s3.FileService; | ||
import com.bamdoliro.maru.infrastructure.s3.constants.FolderConstant; | ||
import com.bamdoliro.maru.presentation.form.dto.response.AdmissionAndPledgeUrlResponse; | ||
import com.bamdoliro.maru.presentation.form.dto.response.FormUrlResponse; | ||
import com.bamdoliro.maru.shared.annotation.UseCase; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@RequiredArgsConstructor | ||
@UseCase | ||
public class QueryAdmissionAndPledgeUrlUseCase { | ||
|
||
private final FormRepository formRepository; | ||
private final FileService fileService; | ||
|
||
public List<AdmissionAndPledgeUrlResponse> execute(List<Long> formIdList) { | ||
return formRepository.findFormUrlByFormIdList(formIdList).stream() | ||
.map(vo -> new AdmissionAndPledgeUrlResponse( | ||
vo.getExaminationNumber(), | ||
vo.getName(), | ||
fileService.getPresignedUrl(FolderConstant.ADMISSION_AND_PLEDGE, vo.getUuid()).getDownloadUrl() | ||
)).toList(); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...java/com/bamdoliro/maru/presentation/form/dto/response/AdmissionAndPledgeUrlResponse.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,14 @@ | ||
package com.bamdoliro.maru.presentation.form.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class AdmissionAndPledgeUrlResponse { | ||
|
||
private Long examinationNumber; | ||
private String name; | ||
private String admissionAndPledgeUrl; | ||
|
||
} |
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
Oops, something went wrong.