feat(lsfx): Controller更新getToken和fetchInnerFlow接口添加默认值

This commit is contained in:
wkc
2026-03-04 16:28:17 +08:00
parent b786d65b9a
commit e2e637890a

View File

@@ -4,6 +4,7 @@ import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.lsfx.client.LsfxAnalysisClient; import com.ruoyi.lsfx.client.LsfxAnalysisClient;
import com.ruoyi.lsfx.constants.LsfxConstants;
import com.ruoyi.lsfx.domain.request.DeleteFilesRequest; import com.ruoyi.lsfx.domain.request.DeleteFilesRequest;
import com.ruoyi.lsfx.domain.request.FetchInnerFlowRequest; import com.ruoyi.lsfx.domain.request.FetchInnerFlowRequest;
import com.ruoyi.lsfx.domain.request.GetBankStatementRequest; import com.ruoyi.lsfx.domain.request.GetBankStatementRequest;
@@ -39,17 +40,19 @@ public class LsfxTestController {
if (StringUtils.isBlank(request.getEntityName())) { if (StringUtils.isBlank(request.getEntityName())) {
return AjaxResult.error("参数不完整entityName为必填"); return AjaxResult.error("参数不完整entityName为必填");
} }
// 必填字段设置默认值
if (StringUtils.isBlank(request.getUserId())) { if (StringUtils.isBlank(request.getUserId())) {
return AjaxResult.error("参数不完整userId为必填"); request.setUserId(LsfxConstants.DEFAULT_USER_ID);
} }
if (StringUtils.isBlank(request.getUserName())) { if (StringUtils.isBlank(request.getUserName())) {
return AjaxResult.error("参数不完整userName为必填"); request.setUserName(LsfxConstants.DEFAULT_USER_NAME);
} }
if (StringUtils.isBlank(request.getOrgCode())) { if (StringUtils.isBlank(request.getOrgCode())) {
return AjaxResult.error("参数不完整orgCode为必填"); request.setOrgCode(LsfxConstants.DEFAULT_ORG_CODE);
} }
if (StringUtils.isBlank(request.getDepartmentCode())) { if (StringUtils.isBlank(request.getDepartmentCode())) {
return AjaxResult.error("参数不完整departmentCode为必填"); request.setDepartmentCode(LsfxConstants.DEFAULT_DEPARTMENT_CODE);
} }
GetTokenResponse response = lsfxAnalysisClient.getToken(request); GetTokenResponse response = lsfxAnalysisClient.getToken(request);
@@ -100,6 +103,11 @@ public class LsfxTestController {
return AjaxResult.error("参数错误:开始日期不能大于结束日期"); return AjaxResult.error("参数错误:开始日期不能大于结束日期");
} }
// 设置dataChannelCode默认值
if (StringUtils.isEmpty(request.getDataChannelCode())) {
request.setDataChannelCode(LsfxConstants.DEFAULT_DATA_CHANNEL_CODE);
}
FetchInnerFlowResponse response = lsfxAnalysisClient.fetchInnerFlow(request); FetchInnerFlowResponse response = lsfxAnalysisClient.fetchInnerFlow(request);
return AjaxResult.success(response); return AjaxResult.success(response);
} }