Skip to content

Commit

Permalink
fix 메일 오류 수정 (#38)
Browse files Browse the repository at this point in the history
* refactor: 필드 주입 대신 생성자 주입으로 변경

* refactor: 개행 및 EOL 추가

* refactor: 서류, 최종 메일 분리 및 비동기 처리

* refactor: 빌더 생성자로 변경

* test: displayName 추가

* fix: 스레드 작업 대기 시간 연장

* feat: 메일 예외 추가

* feat: 메일 병렬처리 추가

* fix: 대기시간 연장

* refactor: 메일 예약, 메일 전송 로직 분리

* fix: 메일 전송 테스트 비활성화

* fix: setter 추가

* feat: 서류 합격 메일 전송

* fix: 템플릿 정구 수
  • Loading branch information
ay-eonii authored Sep 8, 2024
1 parent ba26e6b commit f709875
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 282 deletions.
100 changes: 51 additions & 49 deletions src/main/java/land/leets/domain/application/domain/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,81 +21,83 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Entity(name = "applications")
@Builder
@Getter
@Setter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class Application extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@OneToOne
@JoinColumn(name = "uid")
private User user;
@OneToOne
@JoinColumn(name = "uid")
private User user;

@Column(nullable = false)
private String name;
@Column(nullable = false)
private String name;

@Column(nullable = false)
private String major;
@Column(nullable = false)
private String major;

@Column(nullable = false)
private String grade;
@Column(nullable = false)
private String grade;

@Column
private String project;
@Column
private String project;

@Column
private String algorithm;
@Column
private String algorithm;

@Column
private String portfolio;
@Column
private String portfolio;

@Column(nullable = false, columnDefinition = "char(10)")
@Enumerated(EnumType.STRING)
private Position position;
@Column(nullable = false, columnDefinition = "char(10)")
@Enumerated(EnumType.STRING)
private Position position;

@Column
private String career;
@Column
private String career;

@Column(nullable = false)
private String interviewDay;
@Column(nullable = false)
private String interviewDay;

@Column(nullable = false)
private String interviewTime;
@Column(nullable = false)
private String interviewTime;

@Column(nullable = false, columnDefinition = "text(600)")
private String motive;
@Column(nullable = false, columnDefinition = "text(600)")
private String motive;

@Column(nullable = false, columnDefinition = "text(600)")
private String expectation;
@Column(nullable = false, columnDefinition = "text(600)")
private String expectation;

@Column(nullable = false, columnDefinition = "text(600)")
private String capability;
@Column(nullable = false, columnDefinition = "text(600)")
private String capability;

@Column(nullable = false, columnDefinition = "text(600)")
private String conflict;
@Column(nullable = false, columnDefinition = "text(600)")
private String conflict;

@Column(nullable = false, columnDefinition = "text(600)")
private String passion;
@Column(nullable = false, columnDefinition = "text(600)")
private String passion;

@Column
private LocalDateTime appliedAt;
@Column
private LocalDateTime appliedAt;

@Builder.Default
@Column(columnDefinition = "char(10)")
@Enumerated(EnumType.STRING)
private ApplicationStatus applicationStatus = ApplicationStatus.PENDING;
@Builder.Default
@Column(columnDefinition = "char(10)")
@Enumerated(EnumType.STRING)
private ApplicationStatus applicationStatus = ApplicationStatus.PENDING;

@Column(columnDefinition = "char(10)")
@Enumerated(EnumType.STRING)
private SubmitStatus submitStatus;
@Column(columnDefinition = "char(10)")
@Enumerated(EnumType.STRING)
private SubmitStatus submitStatus;

public void updateInfo(LocalDateTime appliedAt) {
this.appliedAt = appliedAt;
}
public void updateInfo(LocalDateTime appliedAt) {
this.appliedAt = appliedAt;
}
}
32 changes: 17 additions & 15 deletions src/main/java/land/leets/domain/interview/domain/Interview.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package land.leets.domain.interview.domain;

import java.time.LocalDateTime;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
Expand All @@ -16,31 +18,31 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import lombok.Setter;

@Entity(name = "interviews")
@Builder
@Getter
@Setter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class Interview extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@OneToOne
private Application application;
@OneToOne
private Application application;

@Builder.Default
@Column(columnDefinition = "char(10)")
@Enumerated(EnumType.STRING)
private HasInterview hasInterview = HasInterview.PENDING;
@Builder.Default
@Column(columnDefinition = "char(10)")
@Enumerated(EnumType.STRING)
private HasInterview hasInterview = HasInterview.PENDING;

@Column(nullable = false)
private LocalDateTime fixedInterviewDate;
@Column(nullable = false)
private LocalDateTime fixedInterviewDate;

@Column(nullable = false)
private String place;
@Column(nullable = false)
private String place;
}
7 changes: 7 additions & 0 deletions src/main/java/land/leets/global/cron/SendMailCron.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ public void sendPaperMail() {
log.info("Send paper result mail successfully.");
}

@Scheduled(cron = "0 30 23 8 9 ?")
public void sendPassPaperMail() {
sendPaperMailImpl.execute(ApplicationStatus.PASS_PAPER);

log.info("Send paper result mail successfully.");
}

@Scheduled(cron = "0 0 10 12 9 ?")
public void sendFinalMail() {
for (ApplicationStatus status : ApplicationStatus.finals()) {
Expand Down
Loading

0 comments on commit f709875

Please sign in to comment.