diff --git a/.env.sample b/.env.sample index 6e3b542..cea0833 100644 --- a/.env.sample +++ b/.env.sample @@ -4,6 +4,6 @@ MYSQL_DATABASE=TALKKA_DB MYSQL_URL=jdbc:mysql://localhost:3306/TALKKA_DB?createDatabaseIfNotExist=true NAVER_CLIENT_ID=CLIENT_ID -NAVER_CLINET_SECRET=CLIENT_SECRET +NAVER_CLIENT_SECRET=CLIENT_SECRET SERVICE_KEY_1=SERVICE_KEY_1 \ No newline at end of file diff --git a/server/src/main/java/com/talkka/server/api/datagg/config/PropertyApiKeyProvider.java b/server/src/main/java/com/talkka/server/api/datagg/config/PropertyApiKeyProvider.java index efa70c9..23b4b58 100644 --- a/server/src/main/java/com/talkka/server/api/datagg/config/PropertyApiKeyProvider.java +++ b/server/src/main/java/com/talkka/server/api/datagg/config/PropertyApiKeyProvider.java @@ -12,6 +12,7 @@ @Getter @Component +// @Primary @ConfigurationProperties(prefix = "openapi.public.bus.service-key") public class PropertyApiKeyProvider implements ApiKeyProvider { @Setter diff --git a/server/src/main/java/com/talkka/server/api/datagg/service/SimpleBusApiService.java b/server/src/main/java/com/talkka/server/api/datagg/service/SimpleBusApiService.java index 818354a..4e9d518 100644 --- a/server/src/main/java/com/talkka/server/api/datagg/service/SimpleBusApiService.java +++ b/server/src/main/java/com/talkka/server/api/datagg/service/SimpleBusApiService.java @@ -49,6 +49,7 @@ public List getSearchedRouteInfo(String keyword) throws A ResponseEntity resp = apiCallWithRetry(path, params, BusRouteSearchRespDto.class); return resp.getBody().msgBody(); } catch (RestClientException exception) { + log.warn("{} {}, {}", exception.getMessage(), path, params); throw new ApiClientException("결과가 없습니다."); } } @@ -62,6 +63,7 @@ public List getRouteInfo(String apiRouteId) throws ApiClien ResponseEntity resp = apiCallWithRetry(path, params, BusRouteInfoRespDto.class); return resp.getBody().msgBody(); } catch (RestClientException exception) { + log.warn("{} {}, {}", exception.getMessage(), path, params); throw new ApiClientException("결과가 없습니다."); } } @@ -75,6 +77,7 @@ public List getRouteStationInfo(String apiRouteId) throw ResponseEntity resp = apiCallWithRetry(path, params, BusRouteStationRespDto.class); return resp.getBody().msgBody(); } catch (RestClientException exception) { + log.warn("{} {}, {}", exception.getMessage(), path, params); throw new ApiClientException("결과가 없습니다."); } } @@ -88,6 +91,7 @@ public List getBusLocationInfo(String apiRouteId) throws Api ResponseEntity resp = apiCallWithRetry(path, params, BusLocationRespDto.class); return resp.getBody().msgBody(); } catch (RestClientException exception) { + log.warn("{} {}, {}", exception.getMessage(), path, params); throw new ApiClientException("결과가 없습니다."); } } @@ -107,6 +111,7 @@ public Optional getBusArrival(String apiRouteId, String apiSt } return Optional.of(body.get(0)); } catch (Exception exception) { + log.warn("{} {}, {}", exception.getMessage(), path, params); throw new ApiClientException(exception.getMessage()); } } @@ -144,6 +149,7 @@ private ResponseEntity apiCallWithRetry(String path, MultiValueMap { // 재시도마다 새로운 api key 로 시도 return restTemplate.getForEntity(uri, type); // 파싱 실패시 RestClientException 터트림 diff --git a/server/src/main/resources/application.yaml b/server/src/main/resources/application.yaml index 3897f3e..a964f4b 100644 --- a/server/src/main/resources/application.yaml +++ b/server/src/main/resources/application.yaml @@ -62,7 +62,7 @@ spring: mode: never # schema.sql 실행시 always 키고 실행하시면 됩니다. jpa: hibernate: - ddl-auto: validate + ddl-auto: none properties: hibernate: format_sql: true @@ -102,15 +102,15 @@ spring: password: ${MYSQL_PASSWORD} sql: init: - mode: always + mode: never jpa: hibernate: - ddl-auto: update + ddl-auto: none properties: hibernate: format_sql: true dialect: org.hibernate.dialect.MySQL8Dialect - show-sql: true + show-sql: false security: oauth2: client: @@ -118,7 +118,7 @@ spring: naver: client-id: ${NAVER_CLIENT_ID} client-secret: ${NAVER_CLIENT_SECRET} - redirect_uri: https://talkka-bus.duckdns.org/api/auth/login/naver/code + redirect_uri: https://bus.photogrammer.me/api/auth/login/naver/code client-name: Naver authorization-grant-type: authorization_code scope: @@ -132,4 +132,4 @@ spring: user-name-attribute: response base: - url: https://talkka-bus.duckdns.org \ No newline at end of file + url: https://bus.photogrammer.me \ No newline at end of file