Skip to content

Commit

Permalink
[FIX] BE 배포 오류 수정 (#161)
Browse files Browse the repository at this point in the history
- typo / application.yaml 으로 인한 배포 오류 수정.
(네이버 로그인 안되는 이유 -> typo)
  • Loading branch information
JuneParkCode authored Aug 30, 2024
1 parent d74480e commit 5471b9a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

@Getter
@Component
// @Primary
@ConfigurationProperties(prefix = "openapi.public.bus.service-key")
public class PropertyApiKeyProvider implements ApiKeyProvider {
@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public List<BusRouteSearchBodyDto> getSearchedRouteInfo(String keyword) throws A
ResponseEntity<BusRouteSearchRespDto> resp = apiCallWithRetry(path, params, BusRouteSearchRespDto.class);
return resp.getBody().msgBody();
} catch (RestClientException exception) {
log.warn("{} {}, {}", exception.getMessage(), path, params);
throw new ApiClientException("결과가 없습니다.");
}
}
Expand All @@ -62,6 +63,7 @@ public List<BusRouteInfoBodyDto> getRouteInfo(String apiRouteId) throws ApiClien
ResponseEntity<BusRouteInfoRespDto> resp = apiCallWithRetry(path, params, BusRouteInfoRespDto.class);
return resp.getBody().msgBody();
} catch (RestClientException exception) {
log.warn("{} {}, {}", exception.getMessage(), path, params);
throw new ApiClientException("결과가 없습니다.");
}
}
Expand All @@ -75,6 +77,7 @@ public List<BusRouteStationBodyDto> getRouteStationInfo(String apiRouteId) throw
ResponseEntity<BusRouteStationRespDto> resp = apiCallWithRetry(path, params, BusRouteStationRespDto.class);
return resp.getBody().msgBody();
} catch (RestClientException exception) {
log.warn("{} {}, {}", exception.getMessage(), path, params);
throw new ApiClientException("결과가 없습니다.");
}
}
Expand All @@ -88,6 +91,7 @@ public List<BusLocationBodyDto> getBusLocationInfo(String apiRouteId) throws Api
ResponseEntity<BusLocationRespDto> resp = apiCallWithRetry(path, params, BusLocationRespDto.class);
return resp.getBody().msgBody();
} catch (RestClientException exception) {
log.warn("{} {}, {}", exception.getMessage(), path, params);
throw new ApiClientException("결과가 없습니다.");
}
}
Expand All @@ -107,6 +111,7 @@ public Optional<BusArrivalBodyDto> 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());
}
}
Expand Down Expand Up @@ -144,6 +149,7 @@ private <T> ResponseEntity<T> apiCallWithRetry(String path, MultiValueMap<String
// 재시도마다 새로운 api key 로 시도
// 파싱 실패시 RestClientException 터트림
URI uri = this.getOpenApiUri(path, params);
log.debug("api call: {}", uri);
return retryTemplate.execute(context -> {
// 재시도마다 새로운 api key 로 시도
return restTemplate.getForEntity(uri, type); // 파싱 실패시 RestClientException 터트림
Expand Down
12 changes: 6 additions & 6 deletions server/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spring:
mode: never # schema.sql 실행시 always 키고 실행하시면 됩니다.
jpa:
hibernate:
ddl-auto: validate
ddl-auto: none
properties:
hibernate:
format_sql: true
Expand Down Expand Up @@ -102,23 +102,23 @@ 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:
registration:
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:
Expand All @@ -132,4 +132,4 @@ spring:
user-name-attribute: response

base:
url: https://talkka-bus.duckdns.org
url: https://bus.photogrammer.me

0 comments on commit 5471b9a

Please sign in to comment.