-
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: Sending an authentication email to user #43
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
58909cb
feat: sent authentication email
Seokyeong237 689d8a5
feat: authenticate company email
Seokyeong237 d5c47a3
chore: deploy.yml
Seokyeong237 d34dfea
add: an example for swagger
Seokyeong237 2bb869b
refactor: ddd interface
Seokyeong237 0c7e1c3
del: unnecessary code
Seokyeong237 cb080f3
move: Emailmessage to infra
Seokyeong237 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
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
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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/fullcar/member/domain/blacklist/Blacklist.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,25 @@ | ||
package com.fullcar.member.domain.blacklist; | ||
|
||
import jakarta.persistence.EmbeddedId; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EntityListeners; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import static lombok.AccessLevel.PROTECTED; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = PROTECTED) | ||
@AllArgsConstructor(access = PROTECTED) | ||
@EntityListeners(AuditingEntityListener.class) | ||
@Builder | ||
public class Blacklist { | ||
@EmbeddedId | ||
private BlacklistId id; | ||
|
||
private String email; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/fullcar/member/domain/blacklist/BlacklistId.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,21 @@ | ||
package com.fullcar.member.domain.blacklist; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
import static lombok.AccessLevel.PROTECTED; | ||
|
||
@Embeddable | ||
@Getter | ||
@NoArgsConstructor(access = PROTECTED) | ||
@AllArgsConstructor | ||
public class BlacklistId implements Serializable { | ||
|
||
@Column(name = "id") | ||
private Long id; | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/fullcar/member/domain/blacklist/BlacklistRepository.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,17 @@ | ||
package com.fullcar.member.domain.blacklist; | ||
|
||
import com.fullcar.core.exception.CustomException; | ||
import com.fullcar.core.response.ErrorCode; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface BlacklistRepository extends JpaRepository<Blacklist, BlacklistId> { | ||
boolean existsByEmail(String email); | ||
|
||
default void findByEmailThrow(String email) { | ||
if (existsByEmail(email)) { | ||
throw new CustomException(ErrorCode.EMAIL_ADDRESS_IN_BLACKLIST); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/fullcar/member/domain/blacklist/service/BlacklistIdService.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,18 @@ | ||
package com.fullcar.member.domain.blacklist.service; | ||
|
||
import com.fullcar.core.id.SnowFlake; | ||
import com.fullcar.member.domain.blacklist.BlacklistId; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class BlacklistIdService { | ||
private final SnowFlake snowFlake; | ||
|
||
public BlacklistIdService() { | ||
snowFlake = new SnowFlake(255); | ||
} | ||
|
||
public BlacklistId nextId() { | ||
return new BlacklistId(snowFlake.nextId()); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/fullcar/member/domain/member/EmailMessage.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,12 @@ | ||
package com.fullcar.member.domain.member; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class EmailMessage { | ||
private String to; | ||
private String subject; | ||
private String message; | ||
} |
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
15 changes: 15 additions & 0 deletions
15
src/main/java/com/fullcar/member/presentation/member/dto/request/EmailRequestDto.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,15 @@ | ||
package com.fullcar.member.presentation.member.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class EmailRequestDto { | ||
@Schema(description = "νμ¬ μ΄λ©μΌ", example = "[email protected]") | ||
private String email; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,40 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org" lang="UTF-8"> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
</head> | ||
|
||
<body style="font-family: 'Noto Sans', 'Arial', 'sans-serif'; margin: 0; padding: 0;"> | ||
<div class="container" style="margin: auto;"> | ||
<div class="logo"> | ||
<img src="cid:image" alt="Fullcar λ‘κ³ "> | ||
</div> | ||
<p style="margin-top: 20px; padding: 0;">μλ νμΈμ.</p><br> | ||
<p style="margin-top: 10px;">νμ¬ λ©μΌ μΈμ¦μ ν΅ν μμ ν <span class="highlight" style="color: #6C7AF1; font-weight: bold;">μΉ΄ν μλΉμ€ νμΉ΄</span>μ λλ€.</p> | ||
<p style="margin-top: 10px; margin-bottom: 10px;">νμΉ΄ μ΄μ©μ μν΄ <span class="highlight" style="color: #6C7AF1; font-weight: bold;">μλ λ²νΌμ ν΄λ¦</span>ν΄ μΈμ¦μ μ§νν΄ μ£ΌμΈμ.</p> | ||
|
||
<script th:inline="javascript"> | ||
$("#bt").click(function() { | ||
alert('μ±κ³΅'); | ||
}); | ||
|
||
</script> | ||
|
||
<button type="button" id="bt" onclick="alert('μ±κ³΅')" style="display: inline-block; text-decoration: none; font-weight: 500; | ||
color: #fff; | ||
background-color: #6C7AF1; | ||
padding: 15px 36px; | ||
border-color: #6C7AF1; | ||
border-radius: 8px; | ||
font-size: 14px; | ||
margin-top: 20px; | ||
transition: background-color 0.3s;">νμ¬ λ©μΌ μΈμ¦νκΈ°</button> | ||
<div class="help-text"> | ||
<a href="#" style="display: block; color: #505967; margin-top: 20px; text-decoration: underline;">μΈμ¦μ΄ μ λμ§ μλμ?</a> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> | ||
|
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.
λ©μΌ μ μ‘μ μΈλΆμμ€ν μ ν΅ν΄ 보λ΄λ κ²μ΄κΈ° λλ¬Έμ μ κ·Έλ¦Όμ²λΌ λλ©μΈ μλΉμ€μμ λλ©μΈ κ΄μ μ μΈν°νμ΄μ€λ₯Ό μ μνκ³ MailClientμ κ°μ Infra μμμ κ°μ²΄λ₯Ό λ§λ€μ΄ μ²λ¦¬νλ κ²λ μ’μ κ² κ°μ΅λλ€!
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.
μ’μμ!!! λ°μ μλ£νμ΅λλ€ππ