From d44a546ecde268341625dceed6f9d5b6c19ace80 Mon Sep 17 00:00:00 2001 From: mng990 Date: Mon, 4 Nov 2024 13:49:10 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20username,=20membername=20->=20nickn?= =?UTF-8?q?ame=EC=9C=BC=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/build.gradle | 1 + .../common/config/PropertiesConfig.java | 4 +++- .../backend/common/mapper/MemberMapper.java | 4 ++-- .../backend/common/mapper/PostMapper.java | 2 +- .../common/properties/SMTPProperties.java | 22 ++++++++++++++++++ .../loginFilter/CustomUserDetailsService.java | 6 ++--- .../comment/dto/response/CommentResponse.java | 2 +- .../domains/comment/entity/ChildComment.java | 10 ++++---- .../domains/comment/entity/ParentComment.java | 10 ++++---- .../comment/mapper/ChildCommentMapper.java | 2 +- .../comment/mapper/ParentCommentMapper.java | 2 +- .../member/controller/MemberController.java | 12 ++++++++++ .../dto/CreateProfileImageUrlRequest.java | 2 +- .../dto/SendTemproraryPasswordRequest.java | 8 +++++++ .../domains/member/dto/SignUpRequest.java | 4 ++-- .../backend/domains/member/entity/Member.java | 10 ++++---- .../member/repository/MemberRepository.java | 2 +- .../domains/member/service/MemberService.java | 23 ++++++++++++++----- .../domains/post/dto/SinglePostResponse.java | 2 +- .../FindPostAndCommentsByIdResponse.java | 10 ++++---- .../dto/SummaryAndJudgementRequest.java | 2 +- .../service/PrivatePostService.java | 2 +- .../backend/infrastructure/s3/S3Service.java | 4 ++-- .../infrastructure/smtp/MailService.java | 11 +++++++++ .../util/memberLoader/MemberLoader.java | 4 ++-- 25 files changed, 114 insertions(+), 47 deletions(-) create mode 100644 backend/src/main/java/aimo/backend/common/properties/SMTPProperties.java create mode 100644 backend/src/main/java/aimo/backend/domains/member/dto/SendTemproraryPasswordRequest.java create mode 100644 backend/src/main/java/aimo/backend/infrastructure/smtp/MailService.java diff --git a/backend/build.gradle b/backend/build.gradle index 531dac0..3041f6c 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -35,6 +35,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'com.sun.mail:javax.mail:1.6.2' implementation 'io.netty:netty-all:4.1.75.Final' implementation 'org.springframework.boot:spring-boot-starter-websocket' implementation 'org.springframework.boot:spring-boot-starter-webflux' diff --git a/backend/src/main/java/aimo/backend/common/config/PropertiesConfig.java b/backend/src/main/java/aimo/backend/common/config/PropertiesConfig.java index fa1a52a..c4e7344 100644 --- a/backend/src/main/java/aimo/backend/common/config/PropertiesConfig.java +++ b/backend/src/main/java/aimo/backend/common/config/PropertiesConfig.java @@ -7,6 +7,7 @@ import aimo.backend.common.properties.CorsProperties; import aimo.backend.common.properties.JwtProperties; import aimo.backend.common.properties.S3Properties; +import aimo.backend.common.properties.SMTPProperties; import aimo.backend.common.properties.SecurityProperties; @Configuration @@ -15,7 +16,8 @@ SecurityProperties.class, CorsProperties.class, AiServerProperties.class, - S3Properties.class + S3Properties.class, + SMTPProperties.class }) public class PropertiesConfig { } diff --git a/backend/src/main/java/aimo/backend/common/mapper/MemberMapper.java b/backend/src/main/java/aimo/backend/common/mapper/MemberMapper.java index 2dbb0f9..fec9aae 100644 --- a/backend/src/main/java/aimo/backend/common/mapper/MemberMapper.java +++ b/backend/src/main/java/aimo/backend/common/mapper/MemberMapper.java @@ -19,7 +19,7 @@ public class MemberMapper { public Member signUpMemberEntity(SignUpRequest signUpRequest) { return Member .builder() - .memberName(signUpRequest.memberName()) + .nickname(signUpRequest.nickname()) .password(passwordEncoder.encode(signUpRequest.password())) .email(signUpRequest.email()) .memberRole(MemberRole.USER) @@ -31,7 +31,7 @@ public Member signUpMemberEntity(SignUpRequest signUpRequest) { public FindMyInfoResponse toFindMyInfoResponse(Member member) { return new FindMyInfoResponse( - member.getMemberName(), + member.getNickname(), member.getEmail(), member.getProfileImage().getUrl() ); diff --git a/backend/src/main/java/aimo/backend/common/mapper/PostMapper.java b/backend/src/main/java/aimo/backend/common/mapper/PostMapper.java index 23784ae..20448fa 100644 --- a/backend/src/main/java/aimo/backend/common/mapper/PostMapper.java +++ b/backend/src/main/java/aimo/backend/common/mapper/PostMapper.java @@ -81,7 +81,7 @@ public static FindPostAndCommentsByIdResponse toFindPostAndCommentsByIdResponse( return new FindPostAndCommentsByIdResponse( post.getMember() == member, post.getTitle(), - post.getMember().getMemberName(), + post.getMember().getNickname(), post.getSummaryAi(), post.getPostLikesCount(), post.getPostViewsCount(), diff --git a/backend/src/main/java/aimo/backend/common/properties/SMTPProperties.java b/backend/src/main/java/aimo/backend/common/properties/SMTPProperties.java new file mode 100644 index 0000000..3b8dede --- /dev/null +++ b/backend/src/main/java/aimo/backend/common/properties/SMTPProperties.java @@ -0,0 +1,22 @@ +package aimo.backend.common.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@ConfigurationProperties(prefix = "mail.smtp") +public class SMTPProperties { + private String host; + private int port; + private String protocol; + private String auth; + private String starttlsEnable; + private String debug; + private String from; + private String fromName; + private String subject; + private String content; +} diff --git a/backend/src/main/java/aimo/backend/domains/auth/security/loginFilter/CustomUserDetailsService.java b/backend/src/main/java/aimo/backend/domains/auth/security/loginFilter/CustomUserDetailsService.java index 4d8dacd..a58e51a 100644 --- a/backend/src/main/java/aimo/backend/domains/auth/security/loginFilter/CustomUserDetailsService.java +++ b/backend/src/main/java/aimo/backend/domains/auth/security/loginFilter/CustomUserDetailsService.java @@ -17,15 +17,15 @@ public class CustomUserDetailsService implements UserDetailsService { private final MemberService memberService; @Override - public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { - Member member = memberService.findByEmail(username) + public UserDetails loadUserByUsername(String nickname) throws UsernameNotFoundException { + Member member = memberService.findByEmail(nickname) .orElseThrow(() -> new UsernameNotFoundException("해당하는 회원을 찾을 수 없습니다.")); String pw = member.getPassword(); String role = member.getRole().getValue(); return User.builder() - .username(username) + .username(nickname) .password(pw) .roles(role) .build(); diff --git a/backend/src/main/java/aimo/backend/domains/comment/dto/response/CommentResponse.java b/backend/src/main/java/aimo/backend/domains/comment/dto/response/CommentResponse.java index 7d80cc9..53d8c94 100644 --- a/backend/src/main/java/aimo/backend/domains/comment/dto/response/CommentResponse.java +++ b/backend/src/main/java/aimo/backend/domains/comment/dto/response/CommentResponse.java @@ -7,7 +7,7 @@ public record CommentResponse( Long commentId, - String username, + String nickname, String content, Long likes, ListchildComments, diff --git a/backend/src/main/java/aimo/backend/domains/comment/entity/ChildComment.java b/backend/src/main/java/aimo/backend/domains/comment/entity/ChildComment.java index 482526c..1ae36b8 100644 --- a/backend/src/main/java/aimo/backend/domains/comment/entity/ChildComment.java +++ b/backend/src/main/java/aimo/backend/domains/comment/entity/ChildComment.java @@ -34,7 +34,7 @@ public class ChildComment extends BaseEntity { private Long id; @Column(nullable = false) - private String memberName; + private String nickname; @Column(nullable = false, length = 500) private String content; @@ -59,14 +59,14 @@ public class ChildComment extends BaseEntity { @Builder private ChildComment( - String memberName, + String nickname, String content, ParentComment parentComment, Boolean isDeleted, Member member, Post post ) { - this.memberName = memberName; + this.nickname = nickname; this.content = content; this.parentComment = parentComment; this.isDeleted = isDeleted; @@ -80,13 +80,13 @@ public Integer getLikesCount() { public void deleteChildCommentSoftly() { this.member = null; - this.memberName = CommentConstants.DELETED_MEMBER.getValue(); + this.nickname = CommentConstants.DELETED_MEMBER.getValue(); this.isDeleted = true; } public void deleteChildCommentSoftlyWithContent() { this.member = null; - this.memberName = CommentConstants.DELETED_MEMBER.getValue(); + this.nickname = CommentConstants.DELETED_MEMBER.getValue(); this.isDeleted = true; content = CommentConstants.DELETED_COMMENT.getValue(); } diff --git a/backend/src/main/java/aimo/backend/domains/comment/entity/ParentComment.java b/backend/src/main/java/aimo/backend/domains/comment/entity/ParentComment.java index 321ba9b..5394134 100644 --- a/backend/src/main/java/aimo/backend/domains/comment/entity/ParentComment.java +++ b/backend/src/main/java/aimo/backend/domains/comment/entity/ParentComment.java @@ -25,7 +25,7 @@ public class ParentComment extends BaseEntity { private Long id; @Column(nullable = false) - private String memberName; + private String nickname; @Column(nullable = false, length = 500) private String content; @@ -57,13 +57,13 @@ public Integer getLikesCount() { @Builder private ParentComment( - String memberName, + String nickname, String content, Boolean isDeleted, Member member, Post post ) { - this.memberName = memberName; + this.nickname = nickname; this.content = content; this.isDeleted = isDeleted; this.member = member; @@ -72,13 +72,13 @@ private ParentComment( public void deleteChildCommentSoftly() { this.member = null; - this.memberName = CommentConstants.DELETED_COMMENT.getValue(); + this.nickname = CommentConstants.DELETED_COMMENT.getValue(); this.isDeleted = true; } public void deleteChildCommentSoftlyWithContent() { this.member = null; - this.memberName = CommentConstants.DELETED_MEMBER.getValue(); + this.nickname = CommentConstants.DELETED_MEMBER.getValue(); this.isDeleted = true; content = CommentConstants.DELETED_COMMENT.getValue(); } diff --git a/backend/src/main/java/aimo/backend/domains/comment/mapper/ChildCommentMapper.java b/backend/src/main/java/aimo/backend/domains/comment/mapper/ChildCommentMapper.java index f366f61..3796a8e 100644 --- a/backend/src/main/java/aimo/backend/domains/comment/mapper/ChildCommentMapper.java +++ b/backend/src/main/java/aimo/backend/domains/comment/mapper/ChildCommentMapper.java @@ -16,7 +16,7 @@ public class ChildCommentMapper { public ChildComment from(SaveChildCommentRequest request, Member member, ParentComment parentComment, Post post) { return ChildComment.builder() - .memberName(member.getMemberName()) + .nickname(member.getNickname()) .content(request.content()) .parentComment(parentComment) .isDeleted(false) diff --git a/backend/src/main/java/aimo/backend/domains/comment/mapper/ParentCommentMapper.java b/backend/src/main/java/aimo/backend/domains/comment/mapper/ParentCommentMapper.java index fbc73ba..142d0e7 100644 --- a/backend/src/main/java/aimo/backend/domains/comment/mapper/ParentCommentMapper.java +++ b/backend/src/main/java/aimo/backend/domains/comment/mapper/ParentCommentMapper.java @@ -14,7 +14,7 @@ public class ParentCommentMapper { public ParentComment from(SaveParentCommentRequest request, Member member, Post post) { return ParentComment.builder() - .memberName(member.getMemberName()) + .nickname(member.getNickname()) .content(request.content()) .isDeleted(false) .member(member) diff --git a/backend/src/main/java/aimo/backend/domains/member/controller/MemberController.java b/backend/src/main/java/aimo/backend/domains/member/controller/MemberController.java index b8509f2..965615e 100644 --- a/backend/src/main/java/aimo/backend/domains/member/controller/MemberController.java +++ b/backend/src/main/java/aimo/backend/domains/member/controller/MemberController.java @@ -17,6 +17,7 @@ import aimo.backend.domains.member.dto.DeleteRequest; import aimo.backend.domains.member.dto.FindMyInfoResponse; import aimo.backend.domains.member.dto.LogOutRequest; +import aimo.backend.domains.member.dto.SendTemproraryPasswordRequest; import aimo.backend.domains.member.dto.SignUpRequest; import aimo.backend.common.dto.DataResponse; import aimo.backend.domains.auth.security.jwtFilter.JwtTokenProvider; @@ -101,6 +102,7 @@ public ResponseEntity> findMyInfo() { .body(DataResponse.from(memberService.findMyInfo())); } + // 비밀번호 수정(현재 비밀번호 확인) @PutMapping("/password") public ResponseEntity> updatePassword(@Valid @RequestBody UpdatePasswordRequest updatePasswordRequest) { memberService.updatePassword(updatePasswordRequest); @@ -108,6 +110,16 @@ public ResponseEntity> updatePassword(@Valid @RequestBody Upd return ResponseEntity.status(HttpStatus.CREATED).body(DataResponse.created()); } + // 비밀번호 재발급(임시 비밀번호를 이메일로 전송) + @PostMapping("/password/temp") + public ResponseEntity> sendTemporaryPassword( + @Valid @RequestBody SendTemproraryPasswordRequest sendTemproraryPasswordRequest) { + memberService.sendTemporaryPassword(sendTemproraryPasswordRequest); + + return ResponseEntity.status(HttpStatus.CREATED).body(DataResponse.created()); + } + + @GetMapping("/nickname/{nickname}/exists") public ResponseEntity> checkNicknameExists(@PathVariable("nickname") String nickname) { memberService.checkNicknameExists(nickname); diff --git a/backend/src/main/java/aimo/backend/domains/member/dto/CreateProfileImageUrlRequest.java b/backend/src/main/java/aimo/backend/domains/member/dto/CreateProfileImageUrlRequest.java index 4d839e1..dd472ac 100644 --- a/backend/src/main/java/aimo/backend/domains/member/dto/CreateProfileImageUrlRequest.java +++ b/backend/src/main/java/aimo/backend/domains/member/dto/CreateProfileImageUrlRequest.java @@ -1,7 +1,7 @@ package aimo.backend.domains.member.dto; public record CreateProfileImageUrlRequest( - String memberName, + String nickname, String extension ) { } diff --git a/backend/src/main/java/aimo/backend/domains/member/dto/SendTemproraryPasswordRequest.java b/backend/src/main/java/aimo/backend/domains/member/dto/SendTemproraryPasswordRequest.java new file mode 100644 index 0000000..7639ecb --- /dev/null +++ b/backend/src/main/java/aimo/backend/domains/member/dto/SendTemproraryPasswordRequest.java @@ -0,0 +1,8 @@ +package aimo.backend.domains.member.dto; + +import jakarta.validation.constraints.Email; + +public record SendTemproraryPasswordRequest( + @Email(message = "이메일 형식이 아닙니다.") + String email) { +} diff --git a/backend/src/main/java/aimo/backend/domains/member/dto/SignUpRequest.java b/backend/src/main/java/aimo/backend/domains/member/dto/SignUpRequest.java index 474ddba..d121a7a 100644 --- a/backend/src/main/java/aimo/backend/domains/member/dto/SignUpRequest.java +++ b/backend/src/main/java/aimo/backend/domains/member/dto/SignUpRequest.java @@ -9,8 +9,8 @@ import jakarta.validation.constraints.Past; public record SignUpRequest( - @NotBlank(message = "userName이 빈 문자열입니다.") - String memberName, + @NotBlank(message = "nickname이 빈 문자열입니다.") + String nickname, @Email(message = "email 형식이 아닙니다.") String email, @NotBlank(message = "password가 빈 문자열입니다.") diff --git a/backend/src/main/java/aimo/backend/domains/member/entity/Member.java b/backend/src/main/java/aimo/backend/domains/member/entity/Member.java index 750c886..50729a8 100644 --- a/backend/src/main/java/aimo/backend/domains/member/entity/Member.java +++ b/backend/src/main/java/aimo/backend/domains/member/entity/Member.java @@ -42,7 +42,7 @@ public class Member extends BaseEntity { private Long id; @Column(nullable = false, unique = true) - private String memberName; + private String nickname; @Column(nullable = false, unique = true) private String email; @@ -86,13 +86,13 @@ public void updatePassword(String password) { this.password = password; } - public void updateMemberName(String memberName) { - this.memberName = memberName; + public void updateNickname(String nickname) { + this.nickname = nickname; } @Builder private Member( - String memberName, + String nickname, String email, String password, MemberRole memberRole, @@ -100,7 +100,7 @@ private Member( Provider provider, LocalDate birthDate) { - this.memberName = memberName; + this.nickname = nickname; this.email = email; this.password = password; this.role = memberRole; diff --git a/backend/src/main/java/aimo/backend/domains/member/repository/MemberRepository.java b/backend/src/main/java/aimo/backend/domains/member/repository/MemberRepository.java index 0ca27c3..b844928 100644 --- a/backend/src/main/java/aimo/backend/domains/member/repository/MemberRepository.java +++ b/backend/src/main/java/aimo/backend/domains/member/repository/MemberRepository.java @@ -12,7 +12,7 @@ public interface MemberRepository extends JpaRepository { void deleteMemberByEmail(String email); - boolean existsByMemberName(String memberName); + boolean existsByNickname(String nickname); boolean existsByEmail(String email); } diff --git a/backend/src/main/java/aimo/backend/domains/member/service/MemberService.java b/backend/src/main/java/aimo/backend/domains/member/service/MemberService.java index e595ae4..31c1525 100644 --- a/backend/src/main/java/aimo/backend/domains/member/service/MemberService.java +++ b/backend/src/main/java/aimo/backend/domains/member/service/MemberService.java @@ -5,6 +5,7 @@ import aimo.backend.domains.member.dto.DeleteRequest; import aimo.backend.domains.member.dto.FindMyInfoResponse; import aimo.backend.domains.member.dto.LogOutRequest; +import aimo.backend.domains.member.dto.SendTemproraryPasswordRequest; import aimo.backend.domains.member.dto.SignUpRequest; import aimo.backend.domains.member.dto.UpdateNicknameRequest; import aimo.backend.domains.member.dto.UpdatePasswordRequest; @@ -27,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Optional; +import java.util.UUID; @Slf4j @Service @@ -54,7 +56,7 @@ public void signUp(SignUpRequest signUpRequest) { validateDuplicateEmail(signUpRequest.email()); // 중복 닉네임 검사 - validateDuplicateUsername(signUpRequest.memberName()); + validateDuplicateNickname(signUpRequest.nickname()); Member member = memberMapper.signUpMemberEntity(signUpRequest); memberRepository.save(member); @@ -127,8 +129,8 @@ public void updatePassword(UpdatePasswordRequest updatePasswordRequest) { @Transactional(rollbackFor = ApiException.class) public void updateNickname(UpdateNicknameRequest updateNicknameRequest) { Member member = memberLoader.getMember(); - validateDuplicateUsername(updateNicknameRequest.newNickname()); - member.updateMemberName(updateNicknameRequest.newNickname()); + validateDuplicateNickname(updateNicknameRequest.newNickname()); + member.updateNickname(updateNicknameRequest.newNickname()); } public FindMyInfoResponse findMyInfo() { @@ -140,7 +142,7 @@ public Member findById(Long memberId) { } public void checkNicknameExists(String nickname) { - if (memberRepository.existsByMemberName(nickname)) { + if (memberRepository.existsByNickname(nickname)) { throw ApiException.from(ErrorCode.MEMBER_NAME_DUPLICATE); } } @@ -157,9 +159,18 @@ private void validateDuplicateEmail(String email) { } // 닉네임 중복 검사 - private void validateDuplicateUsername(String username) { - if (memberRepository.existsByMemberName(username)) { + private void validateDuplicateNickname(String nickname) { + if (memberRepository.existsByNickname(nickname)) { throw ApiException.from(ErrorCode.MEMBER_NAME_DUPLICATE); } } + + @Transactional(rollbackFor = ApiException.class) + public void sendTemporaryPassword(SendTemproraryPasswordRequest sendTemproraryPasswordRequest) { + String temporaryPassword = UUID.randomUUID().toString().substring(0, 8); + + Member member = memberRepository.findByEmail(sendTemproraryPasswordRequest.email()) + .orElseThrow(() -> ApiException.from(ErrorCode.MEMBER_NOT_FOUND)); + member.updatePassword(passwordEncoder.encode(temporaryPassword)); + } } diff --git a/backend/src/main/java/aimo/backend/domains/post/dto/SinglePostResponse.java b/backend/src/main/java/aimo/backend/domains/post/dto/SinglePostResponse.java index 59625b7..bcf9d76 100644 --- a/backend/src/main/java/aimo/backend/domains/post/dto/SinglePostResponse.java +++ b/backend/src/main/java/aimo/backend/domains/post/dto/SinglePostResponse.java @@ -10,7 +10,7 @@ public record SinglePostResponse( String title, - String username, + String nickname, String content, @JsonProperty("votes_plaintiff") Long votesPlaintiff, diff --git a/backend/src/main/java/aimo/backend/domains/post/dto/response/FindPostAndCommentsByIdResponse.java b/backend/src/main/java/aimo/backend/domains/post/dto/response/FindPostAndCommentsByIdResponse.java index b759f36..fe83f76 100644 --- a/backend/src/main/java/aimo/backend/domains/post/dto/response/FindPostAndCommentsByIdResponse.java +++ b/backend/src/main/java/aimo/backend/domains/post/dto/response/FindPostAndCommentsByIdResponse.java @@ -14,7 +14,7 @@ public class FindPostAndCommentsByIdResponse { private final Boolean is_mine; private final String title; - private final String username; + private final String nickname; private final String content; private final Integer likes_count; private final Integer views_count; @@ -31,7 +31,7 @@ public static class ParentCommentDto { private final Boolean is_mine; private final Long comment_id; private final String content; - private final String username; + private final String nickname; private final Integer likes_count; private final LocalDateTime created_at; private final List child_comments; @@ -41,7 +41,7 @@ public static ParentCommentDto of(Member member, ParentComment parentComment) { parentComment.getMember() == member, parentComment.getId(), parentComment.getContent(), - parentComment.getMemberName(), + parentComment.getNickname(), parentComment.getLikesCount(), parentComment.getCreatedAt(), parentComment.getChildComments().stream() @@ -49,7 +49,7 @@ public static ParentCommentDto of(Member member, ParentComment parentComment) { parentComment.getMember() == member, childComment.getId(), childComment.getContent(), - childComment.getMemberName(), + childComment.getNickname(), childComment.getLikesCount(), childComment.getCreatedAt() )) @@ -64,7 +64,7 @@ private static class ChildCommentDto { private final Boolean is_mine; private final Long child_comment_id; private final String content; - private final String username; + private final String nickname; private final Integer likes_count; private final LocalDateTime created_at; } diff --git a/backend/src/main/java/aimo/backend/domains/privatePost/dto/SummaryAndJudgementRequest.java b/backend/src/main/java/aimo/backend/domains/privatePost/dto/SummaryAndJudgementRequest.java index 265d7bd..e84a664 100644 --- a/backend/src/main/java/aimo/backend/domains/privatePost/dto/SummaryAndJudgementRequest.java +++ b/backend/src/main/java/aimo/backend/domains/privatePost/dto/SummaryAndJudgementRequest.java @@ -10,7 +10,7 @@ public record SummaryAndJudgementRequest( @NotNull(message = "대화록이 비었습니다.") String script, @NotNull(message = "유저명이 비었습니다.") - String username, + String nickname, @NotNull(message = "성별이 비었습니다.") Gender gender, @NotNull(message = "생년월일이 비었습니다.") diff --git a/backend/src/main/java/aimo/backend/domains/privatePost/service/PrivatePostService.java b/backend/src/main/java/aimo/backend/domains/privatePost/service/PrivatePostService.java index 0f30ec5..53f828e 100644 --- a/backend/src/main/java/aimo/backend/domains/privatePost/service/PrivatePostService.java +++ b/backend/src/main/java/aimo/backend/domains/privatePost/service/PrivatePostService.java @@ -45,7 +45,7 @@ public SummaryAndJudgementResponse serveScriptToAi(TextRecordRequest textRecordR Member member = memberLoader.getMember(); SummaryAndJudgementRequest summaryAndJudgementRequest = new SummaryAndJudgementRequest( - textRecordRequest.title(), textRecordRequest.script(), member.getMemberName(), member.getGender(), + textRecordRequest.title(), textRecordRequest.script(), member.getNickname(), member.getGender(), member.getBirthDate()); return webClient.post() diff --git a/backend/src/main/java/aimo/backend/infrastructure/s3/S3Service.java b/backend/src/main/java/aimo/backend/infrastructure/s3/S3Service.java index bff6d1e..47efcbf 100644 --- a/backend/src/main/java/aimo/backend/infrastructure/s3/S3Service.java +++ b/backend/src/main/java/aimo/backend/infrastructure/s3/S3Service.java @@ -34,9 +34,9 @@ public String createAudioPreSignedUrl(CreatePresignedUrlRequest request) { } public CreatePresignedUrlResponse createProfilePresignedUrl(CreateProfileImageUrlRequest request) { - String path = createPath(PresignedUrlPrefix.IMAGE.getValue(), request.memberName() + "." + request.extension()); + String path = createPath(PresignedUrlPrefix.IMAGE.getValue(), request.nickname() + "." + request.extension()); String url = createGeneratePresignedUrlRequest(path); - String filename = request.memberName() + "." + request.extension(); + String filename = request.nickname() + "." + request.extension(); return new CreatePresignedUrlResponse(url, filename); } diff --git a/backend/src/main/java/aimo/backend/infrastructure/smtp/MailService.java b/backend/src/main/java/aimo/backend/infrastructure/smtp/MailService.java new file mode 100644 index 0000000..2a5e6a4 --- /dev/null +++ b/backend/src/main/java/aimo/backend/infrastructure/smtp/MailService.java @@ -0,0 +1,11 @@ +package aimo.backend.infrastructure.smtp; + +import org.springframework.stereotype.Service; + +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +public class MailService { + +} diff --git a/backend/src/main/java/aimo/backend/util/memberLoader/MemberLoader.java b/backend/src/main/java/aimo/backend/util/memberLoader/MemberLoader.java index 89f0185..e931f60 100644 --- a/backend/src/main/java/aimo/backend/util/memberLoader/MemberLoader.java +++ b/backend/src/main/java/aimo/backend/util/memberLoader/MemberLoader.java @@ -34,8 +34,8 @@ public String getEmail() { .getPrincipal(); } - public String getMemberName() { - return getMember().getMemberName(); + public String getnickname() { + return getMember().getNickname(); } public Long getMemberId(){