From 7a9fcb3d2d3e88a6702036d9d0a5f5aeb1bc0cdc Mon Sep 17 00:00:00 2001 From: Hong0329 Date: Mon, 30 Sep 2024 18:47:14 +0900 Subject: [PATCH] apply QA --- .../www/WableServer/api/HealthCheckController.java | 1 - .../api/auth/service/Impl/AuthServiceImpl.java | 12 ++++++------ .../api/lck/service/LckScheduleQueryService.java | 5 ++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/WableServer/src/main/java/com/wable/www/WableServer/api/HealthCheckController.java b/WableServer/src/main/java/com/wable/www/WableServer/api/HealthCheckController.java index 2b47fad..cabe9a4 100644 --- a/WableServer/src/main/java/com/wable/www/WableServer/api/HealthCheckController.java +++ b/WableServer/src/main/java/com/wable/www/WableServer/api/HealthCheckController.java @@ -1,6 +1,5 @@ package com.wable.www.WableServer.api; -import com.wable.www.WableServer.common.exception.UnAuthorizedException; import com.wable.www.WableServer.common.response.ApiResponse; import com.wable.www.WableServer.common.response.ErrorStatus; import com.wable.www.WableServer.common.util.MemberUtil; diff --git a/WableServer/src/main/java/com/wable/www/WableServer/api/auth/service/Impl/AuthServiceImpl.java b/WableServer/src/main/java/com/wable/www/WableServer/api/auth/service/Impl/AuthServiceImpl.java index 3945123..9ab2685 100644 --- a/WableServer/src/main/java/com/wable/www/WableServer/api/auth/service/Impl/AuthServiceImpl.java +++ b/WableServer/src/main/java/com/wable/www/WableServer/api/auth/service/Impl/AuthServiceImpl.java @@ -19,19 +19,17 @@ import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.val; -import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.Environment; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Service; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; +import java.util.Objects; @Service @RequiredArgsConstructor public class AuthServiceImpl implements AuthService { - -// @Value("${aws-property.s3-default-image-url}") -// private String GHOST_IMAGE_S3; private final static String DEFAULT_NICKNAME=""; private final JwtTokenProvider jwtTokenProvider; @@ -39,6 +37,7 @@ public class AuthServiceImpl implements AuthService { private final AppleAuthService appleAuthService; private final MemberRepository memberRepository; private final SlackService slackService; + private final Environment environment; @Override @Transactional @@ -61,10 +60,11 @@ public AuthResponseDto socialLogin(String socialAccessToken, AuthRequestDto auth .memberEmail(socialData.getEmail()) .socialNickname(socialData.getNickname()) .build(); - memberRepository.save(member); - slackService.sendSlackMessage(memberRepository.count(), "#wable-signup"); + if (Objects.equals(environment.getProperty("spring.config.activate.on-profile"), "prod")){ + slackService.sendSlackMessage(memberRepository.count(), "#wable-signup"); + } Authentication authentication = new UserAuthentication(member.getId(), null, null); diff --git a/WableServer/src/main/java/com/wable/www/WableServer/api/lck/service/LckScheduleQueryService.java b/WableServer/src/main/java/com/wable/www/WableServer/api/lck/service/LckScheduleQueryService.java index b8f6dc6..011f22a 100644 --- a/WableServer/src/main/java/com/wable/www/WableServer/api/lck/service/LckScheduleQueryService.java +++ b/WableServer/src/main/java/com/wable/www/WableServer/api/lck/service/LckScheduleQueryService.java @@ -1,7 +1,6 @@ package com.wable.www.WableServer.api.lck.service; import com.wable.www.WableServer.api.lck.domain.LckSchedule; -import com.wable.www.WableServer.api.lck.dto.reponse.LckRankingGetDto; import com.wable.www.WableServer.api.lck.dto.reponse.LckScheduleByDateDto; import com.wable.www.WableServer.api.lck.dto.reponse.LckScheduleGetDto; import com.wable.www.WableServer.api.lck.repository.LckScheduleRepository; @@ -16,6 +15,7 @@ import java.time.temporal.TemporalAdjusters; import java.util.List; import java.util.Map; +import java.util.TreeMap; import java.util.stream.Collectors; @Service @@ -35,9 +35,8 @@ public List getLckSchedule() { .collect(Collectors.groupingBy(dto -> { LocalDateTime gameDateTime = LocalDateTime.parse(dto.gameDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); return TimeUtilCustom.refineDateOnly(gameDateTime); - })); + }, TreeMap::new, Collectors.toList())); - // 날짜별로 그룹화된 데이터를 LckScheduleByDateDto로 변환 return groupedByDate.entrySet().stream() .map(entry -> LckScheduleByDateDto.of(entry.getKey(), entry.getValue())) .collect(Collectors.toList());