From 892da43785613db0cca01a068600db923691ba09 Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 16:08:37 +0900 Subject: [PATCH 1/9] =?UTF-8?q?refactor:=20printStackTrace=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=EB=A5=BC=20log.error=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gsm/blabla/agora/RtcTokenBuilder2.java | 7 +++++-- src/main/java/com/gsm/blabla/agora/Utils.java | 4 +++- .../java/com/gsm/blabla/crew/application/CrewService.java | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gsm/blabla/agora/RtcTokenBuilder2.java b/src/main/java/com/gsm/blabla/agora/RtcTokenBuilder2.java index a5c903f9..cf194e3d 100644 --- a/src/main/java/com/gsm/blabla/agora/RtcTokenBuilder2.java +++ b/src/main/java/com/gsm/blabla/agora/RtcTokenBuilder2.java @@ -1,5 +1,8 @@ package com.gsm.blabla.agora; +import lombok.extern.slf4j.Slf4j; + +@Slf4j public class RtcTokenBuilder2 { public enum Role { ROLE_PUBLISHER(1), @@ -32,7 +35,7 @@ public String buildTokenWithUserAccount(String appId, String appCertificate, Str try { return accessToken.build(); } catch (Exception e) { - e.printStackTrace(); + log.error(e.getMessage(), e); return ""; } } @@ -59,7 +62,7 @@ public String buildTokenWithUserAccount(String appId, String appCertificate, Str try { return accessToken.build(); } catch (Exception e) { - e.printStackTrace(); + log.error(e.getMessage(), e); return ""; } } diff --git a/src/main/java/com/gsm/blabla/agora/Utils.java b/src/main/java/com/gsm/blabla/agora/Utils.java index 298d3fa6..6a2162c8 100644 --- a/src/main/java/com/gsm/blabla/agora/Utils.java +++ b/src/main/java/com/gsm/blabla/agora/Utils.java @@ -12,8 +12,10 @@ import java.util.zip.Inflater; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Base64; +@Slf4j public class Utils { public static final long HMAC_SHA256_LENGTH = 32; public static final int VERSION_LENGTH = 3; @@ -112,7 +114,7 @@ public static byte[] decompress(byte[] data) { bos.write(buf, 0, i); } } catch (Exception e) { - e.printStackTrace(); + log.error(e.getMessage(), e); } finally { inflater.end(); } diff --git a/src/main/java/com/gsm/blabla/crew/application/CrewService.java b/src/main/java/com/gsm/blabla/crew/application/CrewService.java index 8bc8101e..2f975855 100644 --- a/src/main/java/com/gsm/blabla/crew/application/CrewService.java +++ b/src/main/java/com/gsm/blabla/crew/application/CrewService.java @@ -180,7 +180,7 @@ public Map createReport(Long reportId) { try { aiCrewReportResponseDto = objectMapper.readValue(response, AiCrewReportResponseDto.class); } catch (JsonProcessingException e) { - e.printStackTrace(); + log.error(e.getMessage(), e); } if (aiCrewReportResponseDto == null) { From 79585dc207b3c6a2cbb2ff0754756aa25f0f2a5b Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 16:18:51 +0900 Subject: [PATCH 2/9] =?UTF-8?q?refactor:=20=EB=AC=B5=EC=8B=9C=EC=A0=81=20?= =?UTF-8?q?=ED=98=95=EB=B3=80=ED=99=98=EC=9D=84=20=EB=AA=85=EC=8B=9C?= =?UTF-8?q?=EC=A0=81=20=ED=98=95=EB=B3=80=ED=99=98=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gsm/blabla/jwt/TokenProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gsm/blabla/jwt/TokenProvider.java b/src/main/java/com/gsm/blabla/jwt/TokenProvider.java index a3833da8..e93471d8 100644 --- a/src/main/java/com/gsm/blabla/jwt/TokenProvider.java +++ b/src/main/java/com/gsm/blabla/jwt/TokenProvider.java @@ -31,8 +31,8 @@ public class TokenProvider { private static final String AUTHORITIES_KEY = "auth"; private static final String BEARER_TYPE = "Bearer"; - private static final long ACCESS_TOKEN_EXPIRE_TIME = 1000 * 60 * 30; // 30분 - private static final long REFRESH_TOKEN_EXPIRE_TIME = 1000 * 60 * 60 * 24 * 7; // 7일 + private static final long ACCESS_TOKEN_EXPIRE_TIME = 1000L * 60 * 30; // 30분 + private static final long REFRESH_TOKEN_EXPIRE_TIME = 1000L * 60 * 60 * 24 * 7; // 7일 private final Key key; From bd390abed6cabebeae00d4178c74b598ba1d2993 Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 17:00:25 +0900 Subject: [PATCH 3/9] =?UTF-8?q?remove:=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20import=EB=AC=B8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content/dto/AIPracticeFeedbackResponseDto.java | 2 -- .../content/dto/MemberContentDetailResponseDto.java | 1 - .../com/gsm/blabla/crew/api/CrewController.java | 1 - .../gsm/blabla/crew/application/CrewService.java | 2 -- .../gsm/blabla/crew/dao/VoiceFileRepository.java | 1 - .../java/com/gsm/blabla/crew/domain/VoiceFile.java | 3 --- .../content/application/ContentServiceTest.java | 13 +------------ .../blabla/content/dao/ContentRepositoryTest.java | 1 - .../dao/MemberContentDetailRepositoryTest.java | 3 +-- .../gsm/blabla/global/ControllerTestSupport.java | 5 ----- .../gsm/blabla/global/RepositoryTestSupport.java | 1 - 11 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/gsm/blabla/content/dto/AIPracticeFeedbackResponseDto.java b/src/main/java/com/gsm/blabla/content/dto/AIPracticeFeedbackResponseDto.java index 341b5e9c..0819c1f4 100644 --- a/src/main/java/com/gsm/blabla/content/dto/AIPracticeFeedbackResponseDto.java +++ b/src/main/java/com/gsm/blabla/content/dto/AIPracticeFeedbackResponseDto.java @@ -1,7 +1,5 @@ package com.gsm.blabla.content.dto; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gsm.blabla.content.domain.MemberContentDetail; import lombok.*; @Getter diff --git a/src/main/java/com/gsm/blabla/content/dto/MemberContentDetailResponseDto.java b/src/main/java/com/gsm/blabla/content/dto/MemberContentDetailResponseDto.java index 0c152375..88e8273e 100644 --- a/src/main/java/com/gsm/blabla/content/dto/MemberContentDetailResponseDto.java +++ b/src/main/java/com/gsm/blabla/content/dto/MemberContentDetailResponseDto.java @@ -1,6 +1,5 @@ package com.gsm.blabla.content.dto; -import com.fasterxml.jackson.annotation.JsonInclude; import com.gsm.blabla.content.domain.MemberContentDetail; import lombok.*; diff --git a/src/main/java/com/gsm/blabla/crew/api/CrewController.java b/src/main/java/com/gsm/blabla/crew/api/CrewController.java index 5bb3774f..8765f703 100644 --- a/src/main/java/com/gsm/blabla/crew/api/CrewController.java +++ b/src/main/java/com/gsm/blabla/crew/api/CrewController.java @@ -3,7 +3,6 @@ import com.gsm.blabla.crew.application.CrewService; import com.gsm.blabla.crew.dto.*; import com.gsm.blabla.global.response.DataResponseDto; -import com.gsm.blabla.member.dto.MemberProfileResponseDto; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; diff --git a/src/main/java/com/gsm/blabla/crew/application/CrewService.java b/src/main/java/com/gsm/blabla/crew/application/CrewService.java index 2f975855..534c2007 100644 --- a/src/main/java/com/gsm/blabla/crew/application/CrewService.java +++ b/src/main/java/com/gsm/blabla/crew/application/CrewService.java @@ -21,8 +21,6 @@ import java.time.format.DateTimeFormatter; import java.util.*; -import com.gsm.blabla.member.domain.Member; -import com.gsm.blabla.member.dto.MemberProfileResponseDto; import com.gsm.blabla.member.dto.MemberResponseDto; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/gsm/blabla/crew/dao/VoiceFileRepository.java b/src/main/java/com/gsm/blabla/crew/dao/VoiceFileRepository.java index f5e0cf41..ad483a43 100644 --- a/src/main/java/com/gsm/blabla/crew/dao/VoiceFileRepository.java +++ b/src/main/java/com/gsm/blabla/crew/dao/VoiceFileRepository.java @@ -3,7 +3,6 @@ import com.gsm.blabla.crew.domain.VoiceFile; import org.springframework.data.jpa.repository.JpaRepository; -import java.util.Collection; import java.util.List; public interface VoiceFileRepository extends JpaRepository { diff --git a/src/main/java/com/gsm/blabla/crew/domain/VoiceFile.java b/src/main/java/com/gsm/blabla/crew/domain/VoiceFile.java index e0d3db83..7c397e69 100644 --- a/src/main/java/com/gsm/blabla/crew/domain/VoiceFile.java +++ b/src/main/java/com/gsm/blabla/crew/domain/VoiceFile.java @@ -7,9 +7,6 @@ import lombok.Getter; import lombok.NoArgsConstructor; -import java.time.Duration; -import java.time.LocalDateTime; - @Entity @Getter @Builder diff --git a/src/test/java/com/gsm/blabla/content/application/ContentServiceTest.java b/src/test/java/com/gsm/blabla/content/application/ContentServiceTest.java index 3f686d9e..0208ff48 100644 --- a/src/test/java/com/gsm/blabla/content/application/ContentServiceTest.java +++ b/src/test/java/com/gsm/blabla/content/application/ContentServiceTest.java @@ -1,30 +1,19 @@ package com.gsm.blabla.content.application; -import com.gsm.blabla.content.dao.ContentDetailRepository; -import com.gsm.blabla.content.dao.ContentRepository; -import com.gsm.blabla.content.dao.MemberContentDetailRepository; import com.gsm.blabla.content.domain.Content; import com.gsm.blabla.content.domain.ContentDetail; import com.gsm.blabla.content.domain.MemberContentDetail; -import com.gsm.blabla.content.dto.ContentDetailDto; import com.gsm.blabla.content.dto.ContentDetailResponseDto; import com.gsm.blabla.content.dto.ContentDetailsResponseDto; import com.gsm.blabla.content.dto.ContentsResponseDto; import com.gsm.blabla.global.IntegrationTestSupport; import com.gsm.blabla.global.WithCustomMockUser; -import com.gsm.blabla.global.exception.GeneralException; -import com.gsm.blabla.global.response.Code; -import com.gsm.blabla.global.util.SecurityUtil; -import com.gsm.blabla.member.dao.MemberRepository; import com.gsm.blabla.member.domain.Member; -import lombok.RequiredArgsConstructor; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; import java.time.LocalTime; -import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -144,4 +133,4 @@ void getContentDetail() { .containsExactly("소개 인사하기", "인턴을 통해 소개 인사를 배워봅시다.", "https://www.youtu.be/sHpGT4SQwgw", "나는 오스틴 입니다. About the Fit의 창업자 입니다.", "I'm Jules Ostin. I'm the founder of About the Fit.", 43200, 43210, 43220); } -} \ No newline at end of file +} diff --git a/src/test/java/com/gsm/blabla/content/dao/ContentRepositoryTest.java b/src/test/java/com/gsm/blabla/content/dao/ContentRepositoryTest.java index 09be5c5a..999c0177 100644 --- a/src/test/java/com/gsm/blabla/content/dao/ContentRepositoryTest.java +++ b/src/test/java/com/gsm/blabla/content/dao/ContentRepositoryTest.java @@ -4,7 +4,6 @@ import com.gsm.blabla.global.RepositoryTestSupport; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; import java.util.List; diff --git a/src/test/java/com/gsm/blabla/content/dao/MemberContentDetailRepositoryTest.java b/src/test/java/com/gsm/blabla/content/dao/MemberContentDetailRepositoryTest.java index 4650d3a3..4661901d 100644 --- a/src/test/java/com/gsm/blabla/content/dao/MemberContentDetailRepositoryTest.java +++ b/src/test/java/com/gsm/blabla/content/dao/MemberContentDetailRepositoryTest.java @@ -10,7 +10,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import org.springframework.boot.test.context.SpringBootTest; import org.springframework.transaction.annotation.Transactional; import java.time.LocalTime; @@ -87,4 +86,4 @@ void findAllByMemberId() { LocalTime.of(13, 0, 10), LocalTime.of(13, 0, 20), 100L); } -} \ No newline at end of file +} diff --git a/src/test/java/com/gsm/blabla/global/ControllerTestSupport.java b/src/test/java/com/gsm/blabla/global/ControllerTestSupport.java index d602612a..cbb246ad 100644 --- a/src/test/java/com/gsm/blabla/global/ControllerTestSupport.java +++ b/src/test/java/com/gsm/blabla/global/ControllerTestSupport.java @@ -8,7 +8,6 @@ import com.gsm.blabla.auth.api.AuthController; import com.gsm.blabla.auth.application.AuthService; import com.gsm.blabla.content.dto.ContentDetailDto; -import com.gsm.blabla.content.dto.ContentDetailsResponseDto; import com.gsm.blabla.content.dto.ContentsResponseDto; import com.gsm.blabla.crew.api.CrewController; import com.gsm.blabla.crew.api.ScheduleController; @@ -23,10 +22,6 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.web.servlet.MockMvc; -import java.util.List; - -import static org.springframework.test.web.client.match.MockRestRequestMatchers.jsonPath; - @WebMvcTest( controllers = { CrewController.class, diff --git a/src/test/java/com/gsm/blabla/global/RepositoryTestSupport.java b/src/test/java/com/gsm/blabla/global/RepositoryTestSupport.java index dbc824e7..0c127c6d 100644 --- a/src/test/java/com/gsm/blabla/global/RepositoryTestSupport.java +++ b/src/test/java/com/gsm/blabla/global/RepositoryTestSupport.java @@ -15,7 +15,6 @@ import org.junit.jupiter.api.AfterEach; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.transaction.annotation.Transactional; @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, From 0ee5090f198754e849d20e6571de740688ab7c0b Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 17:09:36 +0900 Subject: [PATCH 4/9] =?UTF-8?q?refactor:=20=EC=A7=80=EC=97=AD=EC=A0=81?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=82=AC=EC=9A=A9=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=EC=9D=98=20=EC=84=A0=EC=96=B8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gsm/blabla/admin/application/FcmService.java | 3 +-- .../java/com/gsm/blabla/auth/application/GoogleService.java | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gsm/blabla/admin/application/FcmService.java b/src/main/java/com/gsm/blabla/admin/application/FcmService.java index 48b51826..409c5952 100644 --- a/src/main/java/com/gsm/blabla/admin/application/FcmService.java +++ b/src/main/java/com/gsm/blabla/admin/application/FcmService.java @@ -27,7 +27,6 @@ @Component public class FcmService { - private final String API_URL = "https://fcm.googleapis.com/v1/projects/blabla-391200/messages:send"; private final ObjectMapper objectMapper; public Map sendMessageTo(FcmMessageRequestDto fcmMessageRequestDto) throws IOException { @@ -40,7 +39,7 @@ public Map sendMessageTo(FcmMessageRequestDto fcmMessageRequestD OkHttpClient client = new OkHttpClient(); RequestBody requestBody = RequestBody.create(message, MediaType.get("application/json; charset=utf-8")); Request request = new Request.Builder() - .url(API_URL) + .url("https://fcm.googleapis.com/v1/projects/blabla-391200/messages:send") .post(requestBody) .addHeader("Authorization", "Bearer " + getAccessToken()) .addHeader(HttpHeaders.CONTENT_TYPE, "application/json; UTF-8") diff --git a/src/main/java/com/gsm/blabla/auth/application/GoogleService.java b/src/main/java/com/gsm/blabla/auth/application/GoogleService.java index 5e81e729..83cd80f9 100644 --- a/src/main/java/com/gsm/blabla/auth/application/GoogleService.java +++ b/src/main/java/com/gsm/blabla/auth/application/GoogleService.java @@ -23,8 +23,6 @@ public class GoogleService { private final GoogleAccountRepository googleAccountRepository; public GoogleAccountDto getGoogleAccountInfo(String googleAccessToken) { - String GOOGLE_USERINFO_REQUEST_URL="https://www.googleapis.com/oauth2/v1/userinfo"; - // 1. header에 Access Token을 담는다 HttpHeaders headers = new HttpHeaders(); headers.set("Authorization", "Bearer " + googleAccessToken); @@ -35,7 +33,7 @@ public GoogleAccountDto getGoogleAccountInfo(String googleAccessToken) { ResponseEntity response; try { response = restTemplate.exchange( - GOOGLE_USERINFO_REQUEST_URL, + "https://www.googleapis.com/oauth2/v1/userinfo", HttpMethod.GET, request, GoogleAccountDto.class From b9f277db4f02c2a80abfd75ee2160dd20aab8475 Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 17:10:04 +0900 Subject: [PATCH 5/9] =?UTF-8?q?refactor:=20=ED=95=84=EC=9A=94=ED=95=9C=20?= =?UTF-8?q?=EC=96=B4=EB=85=B8=ED=85=8C=EC=9D=B4=EC=85=98=EB=A7=8C=20import?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=BD=94=EB=93=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blabla/content/dto/AIPracticeFeedbackResponseDto.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gsm/blabla/content/dto/AIPracticeFeedbackResponseDto.java b/src/main/java/com/gsm/blabla/content/dto/AIPracticeFeedbackResponseDto.java index 0819c1f4..c5daa457 100644 --- a/src/main/java/com/gsm/blabla/content/dto/AIPracticeFeedbackResponseDto.java +++ b/src/main/java/com/gsm/blabla/content/dto/AIPracticeFeedbackResponseDto.java @@ -1,8 +1,11 @@ package com.gsm.blabla.content.dto; -import lombok.*; + +import lombok.AllArgsConstructor; +import lombok.Getter; @Getter +@AllArgsConstructor public class AIPracticeFeedbackResponseDto { private Double contextScore; From 1571548796035767c5ad6b8a1a521ef9bba10a7f Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 17:11:31 +0900 Subject: [PATCH 6/9] =?UTF-8?q?refactor:=20switch=EB=AC=B8=EC=97=90=20defa?= =?UTF-8?q?ult=EB=AC=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gsm/blabla/auth/application/AuthService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gsm/blabla/auth/application/AuthService.java b/src/main/java/com/gsm/blabla/auth/application/AuthService.java index bfd1cfef..5a65c123 100644 --- a/src/main/java/com/gsm/blabla/auth/application/AuthService.java +++ b/src/main/java/com/gsm/blabla/auth/application/AuthService.java @@ -63,22 +63,20 @@ public JwtDto signUp(String providerAuthorization, MemberRequestDto memberReques if (googleAccountRepository.findById(googleAccountDto.getId()).isPresent()) { throw new GeneralException(Code.ALREADY_REGISTERED, "이미 가입된 구글 계정입니다."); } - member = memberRepository.save(memberRequestDto.toEntity(nickname, profileImage)); googleAccountRepository.save(GoogleAccount.builder() .id(googleAccountDto.getId()) .member(member) .build() ); - } + case "APPLE" -> { AppleTokenDto appleTokenDto = appleService.getAppleToken(providerAuthorization); AppleAccountDto appleAccountDto = appleService.getAppleAccount(appleTokenDto.getIdToken()); if (appleAccountRepository.findById(appleAccountDto.getSub()).isPresent()) { throw new GeneralException(Code.ALREADY_REGISTERED, "이미 가입된 애플 계정입니다."); } - member = memberRepository.save(memberRequestDto.toEntity(nickname, profileImage)); appleAccountRepository.save(AppleAccount.builder() .id(appleAccountDto.getSub()) @@ -87,7 +85,11 @@ public JwtDto signUp(String providerAuthorization, MemberRequestDto memberReques .build() ); } - case "TEST" -> member = memberRepository.save(memberRequestDto.toEntity(nickname, profileImage)); + + case "TEST" -> + member = memberRepository.save(memberRequestDto.toEntity(nickname, profileImage)); + + default -> throw new GeneralException(Code.BAD_REQUEST, "잘못된 요청입니다."); } return jwtService.issueJwt(member); From 6b7b4e6298917580f81d3add6b7f003d6b2c689b Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 17:11:51 +0900 Subject: [PATCH 7/9] =?UTF-8?q?refactor:=20switch=EB=AC=B8=EC=9D=84=20if?= =?UTF-8?q?=EB=AC=B8=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blabla/auth/application/AuthService.java | 25 ++++++++----------- .../member/application/MemberService.java | 12 ++++----- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/gsm/blabla/auth/application/AuthService.java b/src/main/java/com/gsm/blabla/auth/application/AuthService.java index 5a65c123..9822bb44 100644 --- a/src/main/java/com/gsm/blabla/auth/application/AuthService.java +++ b/src/main/java/com/gsm/blabla/auth/application/AuthService.java @@ -99,21 +99,18 @@ public JwtDto signUp(String providerAuthorization, MemberRequestDto memberReques public Object login(SocialLoginType socialLoginType, String providerAuthorization) { Optional member = Optional.empty(); - switch (socialLoginType) { - case GOOGLE -> { - GoogleAccountDto googleAccountDto = googleService.getGoogleAccountInfo(providerAuthorization); - member = googleAccountRepository.findById(googleAccountDto.getId()).map(GoogleAccount::getMember); - if (member.isEmpty()) { - throw new GeneralException(Code.MEMBER_NOT_FOUND, "가입되지 않은 유저입니다."); - } + if (socialLoginType == SocialLoginType.GOOGLE) { + GoogleAccountDto googleAccountDto = googleService.getGoogleAccountInfo(providerAuthorization); + member = googleAccountRepository.findById(googleAccountDto.getId()).map(GoogleAccount::getMember); + if (member.isEmpty()) { + throw new GeneralException(Code.MEMBER_NOT_FOUND, "가입되지 않은 유저입니다."); } - case APPLE -> { - AppleTokenDto appleTokenDto = appleService.getAppleToken(providerAuthorization); - AppleAccountDto appleAccountDto = appleService.getAppleAccount(appleTokenDto.getIdToken()); - member = appleAccountRepository.findById(appleAccountDto.getSub()).map(AppleAccount::getMember); - if (member.isEmpty()) { - throw new GeneralException(Code.MEMBER_NOT_FOUND, "가입되지 않은 유저입니다."); - } + } else if (socialLoginType == SocialLoginType.APPLE) { + AppleTokenDto appleTokenDto = appleService.getAppleToken(providerAuthorization); + AppleAccountDto appleAccountDto = appleService.getAppleAccount(appleTokenDto.getIdToken()); + member = appleAccountRepository.findById(appleAccountDto.getSub()).map(AppleAccount::getMember); + if (member.isEmpty()) { + throw new GeneralException(Code.MEMBER_NOT_FOUND, "가입되지 않은 유저입니다."); } } diff --git a/src/main/java/com/gsm/blabla/member/application/MemberService.java b/src/main/java/com/gsm/blabla/member/application/MemberService.java index 5ed54c32..333ae796 100644 --- a/src/main/java/com/gsm/blabla/member/application/MemberService.java +++ b/src/main/java/com/gsm/blabla/member/application/MemberService.java @@ -9,6 +9,7 @@ import com.gsm.blabla.jwt.dao.JwtRepository; import com.gsm.blabla.member.dao.MemberRepository; +import com.gsm.blabla.member.domain.SocialLoginType; import java.util.*; import com.gsm.blabla.member.domain.Member; @@ -48,13 +49,10 @@ public Map withdrawal() { jwtRepository.deleteByMemberId(memberId); memberRepository.delete(member); - switch (member.getSocialLoginType()) { - case GOOGLE -> { - googleService.unlinkGoogleAccount(memberId); - } - case APPLE -> { - appleService.revokeAppleAccount(memberId); - } + if (member.getSocialLoginType() == SocialLoginType.GOOGLE) { + googleService.unlinkGoogleAccount(memberId); + } else if (member.getSocialLoginType() == SocialLoginType.APPLE) { + appleService.revokeAppleAccount(memberId); } log.info("{} 님이 회원 탈퇴를 하였습니다.", member.getNickname()); From 30a56313f4498ad864e3303b2b324d04d9738fc1 Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 17:38:15 +0900 Subject: [PATCH 8/9] =?UTF-8?q?fix:=20codecov/patch=20disable=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codecov.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codecov.yml b/codecov.yml index c1b50b6b..fd825528 100644 --- a/codecov.yml +++ b/codecov.yml @@ -7,3 +7,8 @@ comment: branches: - develop - main + +coverage: + patch: + default: + enabled: no From 9cf84e94aa59766379fcf01a595b6d474769c32f Mon Sep 17 00:00:00 2001 From: leeeeeyeon Date: Tue, 17 Oct 2023 17:43:59 +0900 Subject: [PATCH 9/9] =?UTF-8?q?fix:=20codecov/patch=20disable=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codecov.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/codecov.yml b/codecov.yml index fd825528..44a0bdc9 100644 --- a/codecov.yml +++ b/codecov.yml @@ -9,6 +9,5 @@ comment: - main coverage: - patch: - default: - enabled: no + status: + patch: off