-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat-be: Email 전송 상태값 종류 추가 #1011
base: be/develop
Are you sure you want to change the base?
Conversation
1739435703.921449 |
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.
👍
비동기로 요청이 가고, 그 직후 PENDING 상태에서 추후 DELIVERED, FAILED로 상태가 바뀌는 지에 대한 테스트를 어떻게 작성할지 의견이 필요합니다~
"비동기로 작동하는지", 그리고 이메일 발송 "직후에" 상태가 변경되는지 검증하고 싶으신걸까요??
아니면, 단순히 이메일 발송 성공 여부에 따라 DELIVERED, FAILED로 잘 저장되는지를 검증하고 싶으신 건가요? 후자는 워낙 단순해서 아닐 거 같긴 합니다만. 😅
log.info("이메일 전송 실패: from={}, to={}, subject={}, error={}", from.getId(), to.getEmail(), subject, e.getMessage()); | ||
email.updateStatus(EmailStatus.FAILED); |
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.
[필수 반영x]
사소한 부분인데, 둘 순서를 바꾸는 게 아주 조오금 더 안정성 있지 않을까요? ㅎ ㅎ
로그에서도 상태를 안 찍고 있기도 하고, 그럴 일이 있을까 싶지만 왠지 상태를 바꾸고 나서 로깅 하는 게 안정적인 거 같아서요~
SET email_status = CASE | ||
WHEN email_status = '1' THEN 'DELIVERED' | ||
WHEN email_status = '0' THEN 'FAILED' | ||
ELSE 'PENDING' |
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.
'PENDING'은 필요 없을 거 같긴 한데, 혹시 모르니 해 놓는 게 좋을까요?
@@ -338,7 +338,7 @@ void read() { | |||
fieldWithPath("subject").description("이메일 제목"), | |||
fieldWithPath("content").description("이메일 본문"), | |||
fieldWithPath("createdDate").description("전송 날짜"), | |||
fieldWithPath("isSucceed").description("전송 성공 여부") | |||
fieldWithPath("status").description("이메일 상태 (PENDING, DELIVERED, FAILED)") |
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.
[필수 반영x]
이메일 상태 -> 이메일 전송 상태 로 하는 게 명확한 거 같아요 ㅎ ㅎ
ELSE 'PENDING' | ||
END; | ||
|
||
ALTER TABLE email MODIFY COLUMN email_status VARCHAR(20) NOT NULL DEFAULT 'PENDING'; |
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.
맨 위 alter table에 합치면 혹시 결과가 다른가요? ?
ALTER TABLE email CHANGE COLUMN is_succeed email_status VARCHAR(20) NOT NULL DEFAULT 'PENDING';
목적
현재 이메일 전송시 전송을 성공/실패 했는지만 Boolean 값으로 저장되고 있습니다.
이를 Enum을 사용하여 전송 상태값의 종류를 다양하게 만듭니다.(전송 중/ 전송 성공/ 전송 실패)
작업 세부사항
isSucceed
필드 변경참고 사항
PENDING
상태에서 추후DELIVERED
,FAILED
로 상태가 바뀌는 지에 대한 테스트를 어떻게 작성할지 의견이 필요합니다~EMAIL_SEND_STATUS
closes #1010