Skip to content

Commit

Permalink
οΏ½πŸ”— :: (#857) μ•Œλ¦Ό 메세지 μ„€μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
4mjeo authored Nov 22, 2024
2 parents 30df51b + 14b42f5 commit 3b1e009
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ public void onSingleApplicationStatusChanged(ApplicationsStatusChangedEvent even
event.getApplications().stream().map(Application::getRecruitmentId).toList()
);
for (Application application : event.getApplications()) {
String content = "μ§€μ›μ„œ μƒνƒœκ°€ " + event.getStatus().getName() + "으둜 λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€.";

String companyName = companyNameMap.get(application.getRecruitmentId());
if (event.getStatus() == ApplicationStatus.PASS) {
content = companyName + "에 ν•©κ²©ν•˜μ…¨μŠ΅λ‹ˆλ‹€.";
}

ApplicationMessage notificationMessage = ApplicationMessage.of(event, companyName);

Notification notification = Notification.builder()
.title("κ²°κ³Ό λ³΄λŸ¬κ°€κΈ°")
.content(content)
.title(notificationMessage.getTitle())
.content(notificationMessage.getContent())
.userId(application.getStudentId())
.topic(Topic.APPLICATION)
.detailId(application.getId())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package team.retum.jobis.event.application;

import lombok.AllArgsConstructor;
import lombok.Getter;
import team.retum.jobis.domain.application.event.ApplicationsStatusChangedEvent;

@Getter
@AllArgsConstructor
public class ApplicationMessage {
private final String title;
private final String content;

public static ApplicationMessage of(ApplicationsStatusChangedEvent event, String companyName) {
String title;
String content;

switch (event.getStatus()) {
case REQUESTED:
title = "μ§€μ›μ„œ 제좜 μ™„λ£Œ";
content = "μ§€μ›μ„œκ°€ μ œμΆœλ˜μ—ˆμŠ΅λ‹ˆλ‹€. κ²€ν† κ°€ 진행될 μ˜ˆμ •μž…λ‹ˆλ‹€. 쑰금만 κΈ°λ‹€λ € μ£Όμ„Έμš”!";
break;

case APPROVED:
title = "μ§€μ›μ„œκ°€ μŠΉμΈλ˜μ—ˆμŠ΅λ‹ˆλ‹€!";
content = "μ§€μ›μ„œκ°€ μŠΉμΈλ˜μ—ˆμ–΄μš”. 곧 νšŒμ‚¬μ— 전솑될 κ±°μ˜ˆμš”!";
break;

case SEND:
title = "μ§€μ›μ„œ 전솑 μ™„λ£Œ";
content = "'" + companyName + "'에 μ§€μ›μ„œκ°€ μ„±κ³΅μ μœΌλ‘œ μ „μ†‘λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 쒋은 κ²°κ³Όλ₯Ό κΈ°μ›ν•©λ‹ˆλ‹€!";
break;

case PROCESSING:
title = "μ§€μ›μ„œκ°€ μ§„ν–‰μ€‘μž…λ‹ˆλ‹€";
content = "'" + companyName + "'μ—μ„œ μ§€μ›μ„œλ₯Ό κ²€ν†  μ€‘μž…λ‹ˆλ‹€. 진행 상황을 계속 확인해 μ£Όμ„Έμš”.";
break;

case FAILED:
title = companyName + "μ§€μ›μ„œ νƒˆλ½";
content = "μ•„μ‰½κ²Œλ„ '" + companyName + "'의 μ§€μ›μ—μ„œ νƒˆλ½ν•˜μ…¨μŠ΅λ‹ˆλ‹€. λ‹€μŒ κΈ°νšŒμ— 더 쒋은 κ²°κ³Όκ°€ 있길 λ°”λžλ‹ˆλ‹€.";
break;

case PASS:
title = "(μ·¨λ½€) " + companyName + "에 ν•©κ²©ν•˜μ…¨μŠ΅λ‹ˆλ‹€!! πŸ₯³";
content = "합격을 μ§„μ‹¬μœΌλ‘œ μΆ•ν•˜λ“œλ¦½λ‹ˆλ‹€.";
break;

case FIELD_TRAIN:
title = "ν˜„μž₯μ‹€μŠ΅μ΄ ν™•μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€!";
content = "'" + companyName + "'μ—μ„œ ν˜„μž₯μ‹€μŠ΅μ΄ ν™•μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μƒˆλ‘œμš΄ κ²½ν—˜μ„ 톡해 μ„±μž₯ν•˜μ‹œκΈΈ λ°”λžλ‹ˆλ‹€!";
break;

case ACCEPTANCE:
title = "κ·Όλ‘œκ³„μ•½μ΄ μ²΄κ²°λ˜μ—ˆμŠ΅λ‹ˆλ‹€!";
content = "'" + companyName + "'과의 κ·Όλ‘œκ³„μ•½μ΄ μ²΄κ²°λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μƒˆλ‘œμš΄ 여정을 μ‘μ›ν•©λ‹ˆλ‹€!";
break;

case REJECTED:
title = "μ§€μ›μ„œκ°€ λ°˜λ €λ˜μ—ˆμŠ΅λ‹ˆλ‹€.";
content = "μ§€μ›μ„œκ°€ '" + companyName + "'에 μ˜ν•΄ λ°˜λ €λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ§€μ›μ„œ λ‚΄μš©μ„ λ‹€μ‹œ ν™•μΈν•˜κ³  μˆ˜μ • ν›„ μž¬μ œμΆœν•΄ μ£Όμ„Έμš”.";
break;

default:
title = "μ§€μ›μ„œ μƒνƒœκ°€ λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€";
content = "μ§€μ›μ„œ μƒνƒœκ°€ " + event.getStatus().getName() + "으둜 λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€.";
break;
}

return new ApplicationMessage(title, content);
}
}

0 comments on commit 3b1e009

Please sign in to comment.