-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from everymeals/feature/user-profile-create
- Loading branch information
Showing
16 changed files
with
404 additions
and
6 deletions.
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
21 changes: 21 additions & 0 deletions
21
src/main/java/everymeal/server/global/config/WebMvcConfig.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 everymeal.server.global.config; | ||
|
||
|
||
import everymeal.server.global.util.authresolver.UserJwtResolver; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.method.support.HandlerMethodArgumentResolver; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@RequiredArgsConstructor | ||
@Configuration | ||
public class WebMvcConfig implements WebMvcConfigurer { | ||
|
||
private final UserJwtResolver adminResolver; | ||
|
||
@Override | ||
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) { | ||
resolvers.add(adminResolver); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package everymeal.server.global.util; | ||
|
||
|
||
import jakarta.mail.MessagingException; | ||
import jakarta.mail.internet.MimeMessage; | ||
import jakarta.mail.internet.MimeMessage.RecipientType; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.mail.javamail.JavaMailSender; | ||
import org.springframework.stereotype.Component; | ||
|
||
@RequiredArgsConstructor | ||
@Component | ||
public class MailUtil { | ||
private final JavaMailSender javaMailSender; | ||
|
||
public void sendMail(String email, String title, String text) { | ||
try { | ||
MimeMessage mimeMessage = javaMailSender.createMimeMessage(); | ||
mimeMessage.setSubject(title); | ||
mimeMessage.setText(text); | ||
mimeMessage.setRecipients(RecipientType.TO, email); | ||
javaMailSender.send(mimeMessage); | ||
} catch (MessagingException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/everymeal/server/user/controller/dto/request/UserEmailAuthReq.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,22 @@ | ||
package everymeal.server.user.controller.dto.request; | ||
|
||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@Getter | ||
public class UserEmailAuthReq { | ||
|
||
@Email(message = "이메일 형식이 아닙니다.") | ||
@NotBlank(message = "이메일을 입력해주세요.") | ||
@Schema(description = "이메일", example = "[email protected]") | ||
private String email; | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/everymeal/server/user/controller/dto/request/UserEmailAuthVerifyReq.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,26 @@ | ||
package everymeal.server.user.controller.dto.request; | ||
|
||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Setter | ||
public class UserEmailAuthVerifyReq { | ||
|
||
@Schema( | ||
description = "이메일 인증 API에서 반환된 토큰 값", | ||
defaultValue = "eyBdvsjfgsdkgb", | ||
example = "eyBdvsjfgsdkgb") | ||
private String emailAuthToken; | ||
|
||
@Schema(description = "이메일 유저가 입력한 인증 값", defaultValue = "123456", example = "123456") | ||
private String emailAuthValue; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/everymeal/server/user/controller/dto/request/UserProfileCreateReq.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 everymeal.server.user.controller.dto.request; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
public class UserProfileCreateReq { | ||
|
||
private String nickName; | ||
private String profileImage; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/everymeal/server/user/controller/dto/response/UserEmailAuthRes.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,16 @@ | ||
package everymeal.server.user.controller.dto.response; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
@Setter | ||
@Builder | ||
public class UserEmailAuthRes { | ||
|
||
private String emailAuthToken; | ||
} |
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.