add some logs

This commit is contained in:
2025-07-23 09:23:31 +08:00
parent 8528f173a6
commit 6d8fcd0f30

View File

@@ -48,6 +48,7 @@ public class ApiService {
ParameterizedTypeReference<List<T>> typeRef = (ParameterizedTypeReference<List<T>>) tableObjectMapping.get(getInfoVO.getTableName()); ParameterizedTypeReference<List<T>> typeRef = (ParameterizedTypeReference<List<T>>) tableObjectMapping.get(getInfoVO.getTableName());
if (typeRef == null) { if (typeRef == null) {
// throw new IllegalArgumentException("不支持该表名: " + getInfoVO.getTableName()); // throw new IllegalArgumentException("不支持该表名: " + getInfoVO.getTableName());
log.error("Pakistan API - 不支持该表名 : {}", getInfoVO.getTableName());
return Mono.empty(); return Mono.empty();
} }
@@ -62,7 +63,7 @@ public class ApiService {
.retrieve() .retrieve()
.bodyToMono(typeRef) .bodyToMono(typeRef)
.onErrorResume(e -> { .onErrorResume(e -> {
log.warn("WebClient 请求 eldData 失败,错误: {}", e.getMessage()); log.warn("Pakistan API - WebClient 请求 eldData 失败,错误: {}", e.getMessage());
return Mono.just(Collections.emptyList()); return Mono.just(Collections.emptyList());
}); });
@@ -73,7 +74,9 @@ public class ApiService {
public <T> Mono<List<T>> getInfoPro(Integer customerId, String tableName) { public <T> Mono<List<T>> getInfoPro(Integer customerId, String tableName) {
ParameterizedTypeReference<List<T>> typeRef = (ParameterizedTypeReference<List<T>>) tableObjectMapping.get(tableName); ParameterizedTypeReference<List<T>> typeRef = (ParameterizedTypeReference<List<T>>) tableObjectMapping.get(tableName);
if (typeRef == null) { if (typeRef == null) {
throw new IllegalArgumentException("Unsupported table name: " + tableName); // throw new IllegalArgumentException("不支持该表名: " + tableName);
log.error("Pro API - 不支持该表名 : {}", tableName);
return Mono.empty();
} }
return webClientBuilder.baseUrl("https://eldapp.anytrek.app") return webClientBuilder.baseUrl("https://eldapp.anytrek.app")
@@ -88,7 +91,7 @@ public class ApiService {
.retrieve() .retrieve()
.bodyToMono(typeRef) .bodyToMono(typeRef)
.onErrorResume(e -> { .onErrorResume(e -> {
log.warn("WebClient 请求 eldData 失败,错误: {}", e.getMessage()); log.warn("Pro API - WebClient 请求 eldData 失败,错误: {}", e.getMessage());
return Mono.just(Collections.emptyList()); return Mono.just(Collections.emptyList());
}); });
} }