Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] BE 배포 오류 수정 #161

Merged
merged 6 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

롤백한 이유가 궁금합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안됩니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

재 시도중...

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.Map;
import java.util.TreeMap;

import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

Expand All @@ -20,7 +19,7 @@

@Component
@RequiredArgsConstructor
@Primary
// @Primary
public class PersistenceApiKeyProvider implements ApiKeyProvider {

private final PublicApiKeyRepository publicApiKeyRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import com.talkka.server.api.core.config.ApiKeyProvider;
Expand All @@ -12,6 +13,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
Loading