-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] 메일 발송 기능 구현 #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
58648bf
31f5121
40d8713
ff4cfad
82c0d1a
db28bfc
52651c0
8e3cfac
79d3fd5
6bc4251
64e7268
272bd01
526448a
b0bf4ea
b834817
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,20 @@ | ||
| package dmu.dasom.api.domain.applicant.repository; | ||
|
|
||
| import dmu.dasom.api.domain.applicant.entity.Applicant; | ||
| import dmu.dasom.api.domain.applicant.enums.ApplicantStatus; | ||
| import org.springframework.data.domain.Page; | ||
| import org.springframework.data.domain.Pageable; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Query; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public interface ApplicantRepository extends JpaRepository<Applicant, Long> { | ||
|
|
||
| @Query("SELECT a FROM Applicant a ORDER BY a.id DESC") | ||
| Page<Applicant> findAllWithPageRequest(final Pageable pageable); | ||
|
|
||
| // 상태별 지원자 조회 | ||
| List<Applicant> findByStatus(ApplicantStatus status); | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,7 +79,7 @@ public ResponseEntity<ApplicantDetailsResponseDto> updateApplicantStatus(@PathVa | |
| return ResponseEntity.ok(applicantService.updateApplicantStatus(id, request)); | ||
| } | ||
|
|
||
| @Operation(summary = "지원자 메일 전송") | ||
| @Operation(summary = "서류 결과 메일 전송") | ||
|
||
| @ApiResponses(value = { | ||
| @ApiResponse(responseCode = "200", description = "메일 전송 성공"), | ||
| @ApiResponse(responseCode = "400", description = "잘못된 요청", | ||
|
|
@@ -89,15 +89,37 @@ public ResponseEntity<ApplicantDetailsResponseDto> updateApplicantStatus(@PathVa | |
| examples = { | ||
| @ExampleObject( | ||
| name = "전송 실패", | ||
| value = "{ \"code\": \"C013\", \"message\": \"이메일 전송에 실패하였습니다.\" }" | ||
| value = "{ \"code\": \"C014\", \"message\": \"이메일 전송에 실패하였습니다.\" }" | ||
| ) | ||
| } | ||
| ) | ||
| ) | ||
| }) | ||
| @PostMapping("/applicants/send-email") | ||
| public ResponseEntity<String> sendEmailsToApplicants() { | ||
| applicantService.sendEmailsToApplicants(); | ||
| @PostMapping("/applicants/send-document-pass-email") | ||
| public ResponseEntity<String> sendDocumentPassEmails() { | ||
| applicantService.sendDocumentPassEmailsToApplicants(); | ||
| return ResponseEntity.ok("이메일 전송 성공"); | ||
| } | ||
|
|
||
| @Operation(summary = "최종 결과 메일 전송") | ||
| @ApiResponses(value = { | ||
| @ApiResponse(responseCode = "200", description = "메일 전송 성공"), | ||
| @ApiResponse(responseCode = "400", description = "잘못된 요청", | ||
| content = @Content( | ||
| mediaType = "application/json", | ||
| schema = @Schema(implementation = ErrorResponse.class), | ||
| examples = { | ||
| @ExampleObject( | ||
| name = "전송 실패", | ||
| value = "{ \"code\": \"C014\", \"message\": \"이메일 전송에 실패하였습니다.\" }" | ||
| ) | ||
| } | ||
| ) | ||
| ) | ||
| }) | ||
| @PostMapping("/applicants/send-final-pass-email") | ||
| public ResponseEntity<String> sendFinalPassEmail(){ | ||
| applicantService.sendFinalPassEmailsToDocumentPassApplicants(); | ||
| return ResponseEntity.ok("이메일 전송 성공"); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AdminController 코멘트와 마찬가지로
메일 발송메소드를 하나로 정의하고 발송 타입에 따라 다르게 동작되도록 구현하면 좋을 것 같습니다.