diff --git a/src/main/java/com/example/api/account/service/AccountService.java b/src/main/java/com/example/api/account/service/AccountService.java index 12c1910..b121c6d 100644 --- a/src/main/java/com/example/api/account/service/AccountService.java +++ b/src/main/java/com/example/api/account/service/AccountService.java @@ -12,10 +12,11 @@ import com.example.api.domain.Account; import com.example.api.exception.BusinessException; import com.example.api.exception.ErrorCode; -import jakarta.transaction.Transactional; + import lombok.RequiredArgsConstructor; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import java.util.Collection; @@ -29,7 +30,6 @@ public class AccountService { private final CodeRepository codeRepository; private final PasswordEncoder passwordEncoder; private final MailSender mailSender; - private final AccountRepository accountRepository; public Code sendEmail(@Validated final EmailRequest request) throws BusinessException { // 이미 가입된 이메일인지 검증 @@ -70,7 +70,7 @@ public String signUp(@Validated final SignUpRequest request) { return "회원가입이 완료되었습니다"; } - @org.springframework.transaction.annotation.Transactional(readOnly = true) + @Transactional(readOnly = true) public Account loadAccount(final Long requestMemberId) { return accountRepository.findById(requestMemberId) .orElseThrow(() -> new BusinessException(ErrorCode.ACCOUNT_NOT_FOUND_EXCEPTION)); @@ -103,9 +103,4 @@ private void validateDuplicateEmail(final EmailRequest emailRequest) { throw new BusinessException(ErrorCode.DUPLICATE_EMAIL); } } - - public Account loadAccount(final Long requestMemberId) { - return accountRepository.findById(requestMemberId) - .orElseThrow(() -> new BusinessException(ErrorCode.ACCOUNT_NOT_FOUND_EXCEPTION)); - } } \ No newline at end of file diff --git a/src/main/java/com/example/api/possbileboard/dto/PossibleDetails.java b/src/main/java/com/example/api/possbileboard/dto/PossibleDetails.java index ccb3799..4f87854 100644 --- a/src/main/java/com/example/api/possbileboard/dto/PossibleDetails.java +++ b/src/main/java/com/example/api/possbileboard/dto/PossibleDetails.java @@ -11,6 +11,6 @@ public record PossibleDetails( LocalDateTime possibleStartTime, LocalDateTime possibleEndTime, Long contractCount, - Double starPoint + Integer starPoint ) { } diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index 76657fc..7b320cb 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -1,2 +1,35 @@ +spring.config.import=optional:file:.env[.properties] + spring.jpa.hibernate.ddl-auto=create -spring.sql.init.mode=always \ No newline at end of file +spring.sql.init.mode=always + +# kakao Oauth2 ?? +spring.security.oauth2.client.registration.kakao.client-id=${KAKAO_CLIENT_ID} +spring.security.oauth2.client.registration.kakao.client-secret=${KAKAO_CLIENT_SECRET} +spring.security.oauth2.client.registration.kakao.redirect-uri={baseUrl}/oauth2/callback/{registrationId} +spring.security.oauth2.client.registration.kakao.authorization-grant-type=authorization_code +spring.security.oauth2.client.registration.kakao.client-authentication-method=client_secret_post +spring.security.oauth2.client.registration.kakao.scope=profile_nickname,account_email + +# kakao Oauth2 Provider ?? +spring.security.oauth2.client.provider.kakao.authorization-uri=https://kauth.kakao.com/oauth/authorize +spring.security.oauth2.client.provider.kakao.token-uri=https://kauth.kakao.com/oauth/token +spring.security.oauth2.client.provider.kakao.user-info-uri=https://kapi.kakao.com/v2/user/me +spring.security.oauth2.client.provider.kakao.user-name-attribute=id + +# naver Oauth2 ?? +spring.security.oauth2.client.registration.naver.client-id=${NAVER_CLIENT_ID} +spring.security.oauth2.client.registration.naver.client-secret=${NAVER_CLIENT_SECRET} +spring.security.oauth2.client.registration.naver.redirect-uri={baseUrl}/oauth2/callback/{registrationId} +spring.security.oauth2.client.registration.naver.authorization-grant-type=authorization_code +spring.security.oauth2.client.registration.naver.client-authentication-method=client_secret_basic +spring.security.oauth2.client.registration.naver.scope=name,email + +# naver Oauth2 Provider ?? +spring.security.oauth2.client.provider.naver.authorization-uri=https://nid.naver.com/oauth2.0/authorize +spring.security.oauth2.client.provider.naver.token-uri=https://nid.naver.com/oauth2.0/token +spring.security.oauth2.client.provider.naver.user-info-uri=https://openapi.naver.com/v1/nid/me +spring.security.oauth2.client.provider.naver.user-name-attribute=response + +# redirect allow path +app.oauth2.authorized-redirect-uris=* \ No newline at end of file