-
Notifications
You must be signed in to change notification settings - Fork 0
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: include receiver name into mail registration #31
Merged
ekgns33
merged 6 commits into
develop
from
feat/include-receiver-name-into-mail-registration
Aug 21, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b4211d3
fix: 확률적으로 실패하던 Test Case 보완
goldentrash 8c048ea
feat: `EmailReceiver`에 이름 정보가 누락되어 있던 문제 해결
goldentrash 5bc99c3
feat: `{이름}`을 통해 대상 이름을 이메일 양식에 포함할 수 있도록 기능 추가
goldentrash 4595718
test: 수정 사항 반영 (이메일 수신자에 이름 속성 추가)
goldentrash 3c2bf49
refactor: 이름 토큰(`{이름}`)을 상수로 정의, 메서드 분리
goldentrash 632c584
test: 이름 토큰(`{이름}`) 치환 동작 확인 테스트 작성
goldentrash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
37 changes: 37 additions & 0 deletions
37
src/main/java/gdsc/konkuk/platformcore/controller/email/dtos/EmailReceiverInfo.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,37 @@ | ||
package gdsc.konkuk.platformcore.controller.email.dtos; | ||
|
||
import gdsc.konkuk.platformcore.domain.email.entity.EmailReceiver; | ||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class EmailReceiverInfo { | ||
@NotEmpty @Email | ||
private String email; | ||
|
||
@NotEmpty private String name; | ||
|
||
@Builder | ||
public EmailReceiverInfo(String email, String name) { | ||
this.email = email; | ||
this.name = name; | ||
} | ||
|
||
public static EmailReceiver toValueObject(EmailReceiverInfo info) { | ||
return EmailReceiver.builder() | ||
.email(info.getEmail()) | ||
.name(info.getName()) | ||
.build(); | ||
} | ||
|
||
public static EmailReceiverInfo fromValueObject(EmailReceiver emailReceiver) { | ||
return EmailReceiverInfo.builder() | ||
.email(emailReceiver.getEmail()) | ||
.name(emailReceiver.getName()) | ||
.build(); | ||
} | ||
} |
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
38 changes: 38 additions & 0 deletions
38
src/main/java/gdsc/konkuk/platformcore/domain/email/entity/EmailReceiver.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,38 @@ | ||
package gdsc.konkuk.platformcore.domain.email.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Embeddable | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class EmailReceiver { | ||
@Column(name = "receiver_email") | ||
private String email; | ||
|
||
@Column(name = "receiver_name") | ||
private String name; | ||
|
||
@Builder | ||
public EmailReceiver(String email, String name) { | ||
this.email = email; | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return (this.email + this.name).hashCode(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
EmailReceiver that = (EmailReceiver) o; | ||
return email.equals(that.email) && name.equals(that.name); | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Setter를 열어둘 필요가 있을까요? VO라는점을 생각해보는게 어때요
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.
EmailReceiverInfo
는 DTO입니다. VO인EmailReceiver
는 확인해보니 Setter를 열어두지 않았더군욥