fix: 使用配置中的endpoint路径替代硬编码路径
This commit is contained in:
@@ -33,6 +33,27 @@ public class LsfxAnalysisClient {
|
||||
@Value("${lsfx.api.client-id}")
|
||||
private String clientId;
|
||||
|
||||
@Value("${lsfx.api.endpoints.get-token}")
|
||||
private String getTokenEndpoint;
|
||||
|
||||
@Value("${lsfx.api.endpoints.upload-file}")
|
||||
private String uploadFileEndpoint;
|
||||
|
||||
@Value("${lsfx.api.endpoints.fetch-inner-flow}")
|
||||
private String fetchInnerFlowEndpoint;
|
||||
|
||||
@Value("${lsfx.api.endpoints.check-parse-status}")
|
||||
private String checkParseStatusEndpoint;
|
||||
|
||||
@Value("${lsfx.api.endpoints.generate-report}")
|
||||
private String generateReportEndpoint;
|
||||
|
||||
@Value("${lsfx.api.endpoints.check-report-status}")
|
||||
private String checkReportStatusEndpoint;
|
||||
|
||||
@Value("${lsfx.api.endpoints.get-bank-statement}")
|
||||
private String getBankStatementEndpoint;
|
||||
|
||||
/**
|
||||
* 获取Token
|
||||
*/
|
||||
@@ -52,7 +73,7 @@ public class LsfxAnalysisClient {
|
||||
request.setRole(LsfxConstants.DEFAULT_ROLE);
|
||||
}
|
||||
|
||||
String url = baseUrl + "/account/common/getToken";
|
||||
String url = baseUrl + getTokenEndpoint;
|
||||
return httpUtil.postJson(url, request, null, GetTokenResponse.class);
|
||||
}
|
||||
|
||||
@@ -60,7 +81,7 @@ public class LsfxAnalysisClient {
|
||||
* 上传文件
|
||||
*/
|
||||
public UploadFileResponse uploadFile(Integer groupId, org.springframework.core.io.Resource file) {
|
||||
String url = baseUrl + "/watson/api/project/remoteUploadSplitFile";
|
||||
String url = baseUrl + uploadFileEndpoint;
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("groupId", groupId);
|
||||
@@ -76,7 +97,7 @@ public class LsfxAnalysisClient {
|
||||
* 拉取行内流水
|
||||
*/
|
||||
public FetchInnerFlowResponse fetchInnerFlow(FetchInnerFlowRequest request) {
|
||||
String url = baseUrl + "/watson/api/project/getJZFileOrZjrcuFile";
|
||||
String url = baseUrl + fetchInnerFlowEndpoint;
|
||||
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put(LsfxConstants.HEADER_CLIENT_ID, clientId);
|
||||
@@ -88,7 +109,7 @@ public class LsfxAnalysisClient {
|
||||
* 检查文件解析状态
|
||||
*/
|
||||
public CheckParseStatusResponse checkParseStatus(Integer groupId, String inprogressList) {
|
||||
String url = baseUrl + "/watson/api/project/upload/getpendings";
|
||||
String url = baseUrl + checkParseStatusEndpoint;
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("groupId", groupId);
|
||||
@@ -104,7 +125,7 @@ public class LsfxAnalysisClient {
|
||||
* 生成尽调报告
|
||||
*/
|
||||
public GenerateReportResponse generateReport(GenerateReportRequest request) {
|
||||
String url = baseUrl + "/watson/api/project/confirmStageUploadLogs";
|
||||
String url = baseUrl + generateReportEndpoint;
|
||||
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put(LsfxConstants.HEADER_CLIENT_ID, clientId);
|
||||
@@ -116,7 +137,7 @@ public class LsfxAnalysisClient {
|
||||
* 检查报告生成状态
|
||||
*/
|
||||
public CheckReportStatusResponse checkReportStatus(Integer groupId) {
|
||||
String url = baseUrl + "/watson/api/project/upload/getallpendings?groupId=" + groupId;
|
||||
String url = baseUrl + checkReportStatusEndpoint + "?groupId=" + groupId;
|
||||
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put(LsfxConstants.HEADER_CLIENT_ID, clientId);
|
||||
@@ -128,7 +149,7 @@ public class LsfxAnalysisClient {
|
||||
* 获取银行流水
|
||||
*/
|
||||
public GetBankStatementResponse getBankStatement(GetBankStatementRequest request) {
|
||||
String url = baseUrl + "/watson/api/project/upload/getBankStatement";
|
||||
String url = baseUrl + getBankStatementEndpoint;
|
||||
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put(LsfxConstants.HEADER_CLIENT_ID, clientId);
|
||||
|
||||
Reference in New Issue
Block a user