Skip to content
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

[Fix/296] 인증코드 메일 제목 및 매칭 SUCCESS internal API endpoint 수정 #297

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public ApiResponse<MatchingResponse.matchingFoundResponseDTO> matchingFound(

}

@PatchMapping("/{memberId}/success/target/{targetMemberId}/{gameMode}")
@PatchMapping("/{memberId}/matching/success/target/{targetMemberId}/{gameMode}")
@Parameter(name = "targetMemberId", description = "매칭 상대 회원의 id 입니다.")
@Operation(summary = "매칭 SUCCESS API", description = "나와 특정 상대 회원의 매칭 기록 상태를 SUCCESS 상태로 변경하고, 채팅방을 시작해 uuid를 리턴하는 API 입니다.")
public ApiResponse<String> matchingSuccess(
Expand Down
291 changes: 147 additions & 144 deletions src/main/java/com/gamegoo/service/member/AuthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public Member joinMember(String email, String password, String gameName, String
.profileImage(randomProfileImage)
.blind(false)
.mike(false)
.mainPosition(0)
.subPosition(0)
.wantPosition(0)
.mainPosition(0)
.subPosition(0)
.wantPosition(0)
.mannerLevel(1)
.isAgree(isAgree)
.build();
Expand Down Expand Up @@ -128,17 +128,18 @@ public Member joinMember(String email, String password, String gameName, String

// 회원가입 완료된 사용자 정보 로그로 출력
log.info("회원가입 완료 - 이메일: {}, 프로필 이미지: {}, 소환사명: {}, 태그: {}, 티어: {}, 랭크: {}",
member.getEmail(), member.getProfileImage(), member.getGameName(), member.getTag(), member.getTier(), member.getRank());

member.getEmail(), member.getProfileImage(), member.getGameName(), member.getTag(),
member.getTier(), member.getRank());

return member;
}

/**
* 회원가입용 이메일 중복 확인 검증
*
* @param email
*/
public void verifyEmailforNewUser(String email){
public void verifyEmailforNewUser(String email) {
// 해당 이메일이 DB에 있는지 확인하기
boolean isPresent = memberRepository.findByEmail(email).isPresent();

Expand All @@ -151,9 +152,10 @@ public void verifyEmailforNewUser(String email){

/**
* 비밀번호 찾기용 이메일 중복 확인 검증
*
* @param email
*/
public void verifyEmailforExistUser(String email){
public void verifyEmailforExistUser(String email) {
// 해당 이메일이 DB에 있는지 확인하기
boolean isPresent = memberRepository.findByEmail(email).isPresent();

Expand Down Expand Up @@ -210,7 +212,7 @@ public MemberResponse.RefreshTokenResponseDTO verifyRefreshToken(String refresh_
member.updateRefreshToken(new_refresh_token);
memberRepository.save(member);

return new MemberResponse.RefreshTokenResponseDTO(id,access_token, new_refresh_token);
return new MemberResponse.RefreshTokenResponseDTO(id, access_token, new_refresh_token);
}

/**
Expand Down Expand Up @@ -262,7 +264,7 @@ private void sendEmailInternal(String email, String certificationNumber) {
String htmlContent = getCertificationMessage(certificationNumber);

mimeMessageHelper.setTo(email);
mimeMessageHelper.setSubject("GamgGoo 이메일 인증 코드");
mimeMessageHelper.setSubject("GameGoo 이메일 인증 코드");
mimeMessageHelper.setText(htmlContent, true);
log.debug("Prepared email message for email: {}", email);

Expand All @@ -286,141 +288,142 @@ private void sendEmailInternal(String email, String certificationNumber) {
*/
private String getCertificationMessage(String certificationNumber) {
String certificationMessage = ""
+"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" +
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" +
" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n" +
" <title>Gamegoo 이메일 인증</title>\n" +
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n" +
" </head>\n" +
" <body>\n" +
" <table\n" +
" style=\"\n" +
" width: 628px;\n" +
" box-sizing: border-box;\n" +
" border-collapse: collapse;\n" +
" background-color: #ffffff;\n" +
" border: 1px solid #c0c0c0;\n" +
" text-align: left;\n" +
" margin: 0 auto;\n" +
" \"\n" +
" >\n" +
" <tbody>\n" +
" <tr>\n" +
" <td>\n" +
" <table\n" +
" cellpadding=\"0\"\n" +
" cellspacing=\"0\"\n" +
" style=\"width: 628px; height: 521px; padding: 53px 62px 42px 62px\"\n" +
" >\n" +
" <tbody>\n" +
" <tr>\n" +
" <td style=\"padding-bottom: 11.61px\">\n" +
" <img\n" +
" src=\"https://ifh.cc/g/BY3XG2.png\"\n" +
" style=\"display: block\"\n" +
" width=\"137\"\n" +
" height=\"24\"\n" +
" alt=\"Gamegoo\"\n" +
" />\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td style=\"padding-top: 20px\">\n" +
" <span\n" +
" style=\"\n" +
" color: #2d2d2d;\n" +
" font-family: Pretendard;\n" +
" font-size: 25px;\n" +
" font-style: normal;\n" +
" font-weight: 400;\n" +
" line-height: 150%;\n" +
" \"\n" +
" >\n" +
" 인증코드를 확인해주세요\n" +
" </span>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td style=\"padding-top: 38px\">\n" +
" <span\n" +
" style=\"\n" +
" color: #5a42ee;\n" +
" color: #2d2d2d;\n" +
" font-size: 32px;\n" +
" font-style: normal;\n" +
" font-weight: 700;\n" +
" line-height: 150%;\n" +
" margin-bottom: 30px;\n" +
" \"\n" +
" >\n" +
certificationNumber+
" </span>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td style=\"padding-top: 30px\">\n" +
" <span\n" +
" style=\"\n" +
" color: #2d2d2d;\n" +
" font-family: Pretendard;\n" +
" font-size: 18px;\n" +
" font-style: normal;\n" +
" font-weight: 400;\n" +
" line-height: 150%;\n" +
" \"\n" +
" >\n" +
" 이메일 인증 절차에 따라 이메일 인증코드를 발급해드립니다.\n" +
" 인증코드는 이메일 발송시점으로부터 3분 동안 유효합니다.<br /><br />\n" +
" 만약 본인 요청에 의한 이메일 인증이 아니라면,<br />\n" +
" [email protected]으로 관련 내용을 전달해 주세요.<br /><br />\n" +
"\n" +
" 감사합니다.\n" +
" </span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" <table\n" +
" cellpadding=\"0\"\n" +
" cellspacing=\"0\"\n" +
" style=\"\n" +
" width: 628px;\n" +
" height: 292px;\n" +
" padding: 37px 0px 153px 62px;\n" +
" background: #f7f7f9;\n" +
" \"\n" +
" >\n" +
" <tbody>\n" +
" <tr>\n" +
" <td>\n" +
" <span\n" +
" style=\"\n" +
" color: #606060;\n" +
" font-family: Pretendard;\n" +
" font-size: 11px;\n" +
" font-style: normal;\n" +
" font-weight: 500;\n" +
" line-height: 150%;\n" +
" \"\n" +
" >\n" +
" 본 메일은 발신 전용으로 회신되지 않습니다.<br />\n" +
" 궁금하신 점은 겜구 이메일이나 카카오 채널을 통해\n" +
" 문의하시기 바랍니다.<br /><br />\n" +
" email: [email protected]<br />\n" +
" kakao: https://pf.kakao.com/_Rrxiqn<br />\n" +
" copyright 2024. GameGoo All Rights Reserved.<br />\n" +
" </span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </body>\n" +
"</html>\n";
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
+
"<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" +
" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n" +
" <title>Gamegoo 이메일 인증</title>\n" +
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n" +
" </head>\n" +
" <body>\n" +
" <table\n" +
" style=\"\n" +
" width: 628px;\n" +
" box-sizing: border-box;\n" +
" border-collapse: collapse;\n" +
" background-color: #ffffff;\n" +
" border: 1px solid #c0c0c0;\n" +
" text-align: left;\n" +
" margin: 0 auto;\n" +
" \"\n" +
" >\n" +
" <tbody>\n" +
" <tr>\n" +
" <td>\n" +
" <table\n" +
" cellpadding=\"0\"\n" +
" cellspacing=\"0\"\n" +
" style=\"width: 628px; height: 521px; padding: 53px 62px 42px 62px\"\n" +
" >\n" +
" <tbody>\n" +
" <tr>\n" +
" <td style=\"padding-bottom: 11.61px\">\n" +
" <img\n" +
" src=\"https://ifh.cc/g/BY3XG2.png\"\n" +
" style=\"display: block\"\n" +
" width=\"137\"\n" +
" height=\"24\"\n" +
" alt=\"Gamegoo\"\n" +
" />\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td style=\"padding-top: 20px\">\n" +
" <span\n" +
" style=\"\n" +
" color: #2d2d2d;\n" +
" font-family: Pretendard;\n" +
" font-size: 25px;\n" +
" font-style: normal;\n" +
" font-weight: 400;\n" +
" line-height: 150%;\n" +
" \"\n" +
" >\n" +
" 인증코드를 확인해주세요\n" +
" </span>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td style=\"padding-top: 38px\">\n" +
" <span\n" +
" style=\"\n" +
" color: #5a42ee;\n" +
" color: #2d2d2d;\n" +
" font-size: 32px;\n" +
" font-style: normal;\n" +
" font-weight: 700;\n" +
" line-height: 150%;\n" +
" margin-bottom: 30px;\n" +
" \"\n" +
" >\n" +
certificationNumber +
" </span>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td style=\"padding-top: 30px\">\n" +
" <span\n" +
" style=\"\n" +
" color: #2d2d2d;\n" +
" font-family: Pretendard;\n" +
" font-size: 18px;\n" +
" font-style: normal;\n" +
" font-weight: 400;\n" +
" line-height: 150%;\n" +
" \"\n" +
" >\n" +
" 이메일 인증 절차에 따라 이메일 인증코드를 발급해드립니다.\n" +
" 인증코드는 이메일 발송시점으로부터 3분 동안 유효합니다.<br /><br />\n" +
" 만약 본인 요청에 의한 이메일 인증이 아니라면,<br />\n" +
" [email protected]으로 관련 내용을 전달해 주세요.<br /><br />\n" +
"\n" +
" 감사합니다.\n" +
" </span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" <table\n" +
" cellpadding=\"0\"\n" +
" cellspacing=\"0\"\n" +
" style=\"\n" +
" width: 628px;\n" +
" height: 292px;\n" +
" padding: 37px 0px 153px 62px;\n" +
" background: #f7f7f9;\n" +
" \"\n" +
" >\n" +
" <tbody>\n" +
" <tr>\n" +
" <td>\n" +
" <span\n" +
" style=\"\n" +
" color: #606060;\n" +
" font-family: Pretendard;\n" +
" font-size: 11px;\n" +
" font-style: normal;\n" +
" font-weight: 500;\n" +
" line-height: 150%;\n" +
" \"\n" +
" >\n" +
" 본 메일은 발신 전용으로 회신되지 않습니다.<br />\n" +
" 궁금하신 점은 겜구 이메일이나 카카오 채널을 통해\n" +
" 문의하시기 바랍니다.<br /><br />\n" +
" email: [email protected]<br />\n" +
" kakao: https://pf.kakao.com/_Rrxiqn<br />\n" +
" copyright 2024. GameGoo All Rights Reserved.<br />\n" +
" </span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </body>\n" +
"</html>\n";

return certificationMessage;
}
Expand Down
Loading