feat(lsfx): Controller更新getToken和fetchInnerFlow接口添加默认值
This commit is contained in:
@@ -4,6 +4,7 @@ import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
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.FetchInnerFlowRequest;
|
||||
import com.ruoyi.lsfx.domain.request.GetBankStatementRequest;
|
||||
@@ -39,17 +40,19 @@ public class LsfxTestController {
|
||||
if (StringUtils.isBlank(request.getEntityName())) {
|
||||
return AjaxResult.error("参数不完整:entityName为必填");
|
||||
}
|
||||
|
||||
// 必填字段设置默认值
|
||||
if (StringUtils.isBlank(request.getUserId())) {
|
||||
return AjaxResult.error("参数不完整:userId为必填");
|
||||
request.setUserId(LsfxConstants.DEFAULT_USER_ID);
|
||||
}
|
||||
if (StringUtils.isBlank(request.getUserName())) {
|
||||
return AjaxResult.error("参数不完整:userName为必填");
|
||||
request.setUserName(LsfxConstants.DEFAULT_USER_NAME);
|
||||
}
|
||||
if (StringUtils.isBlank(request.getOrgCode())) {
|
||||
return AjaxResult.error("参数不完整:orgCode为必填");
|
||||
request.setOrgCode(LsfxConstants.DEFAULT_ORG_CODE);
|
||||
}
|
||||
if (StringUtils.isBlank(request.getDepartmentCode())) {
|
||||
return AjaxResult.error("参数不完整:departmentCode为必填");
|
||||
request.setDepartmentCode(LsfxConstants.DEFAULT_DEPARTMENT_CODE);
|
||||
}
|
||||
|
||||
GetTokenResponse response = lsfxAnalysisClient.getToken(request);
|
||||
@@ -100,6 +103,11 @@ public class LsfxTestController {
|
||||
return AjaxResult.error("参数错误:开始日期不能大于结束日期");
|
||||
}
|
||||
|
||||
// 设置dataChannelCode默认值
|
||||
if (StringUtils.isEmpty(request.getDataChannelCode())) {
|
||||
request.setDataChannelCode(LsfxConstants.DEFAULT_DATA_CHANNEL_CODE);
|
||||
}
|
||||
|
||||
FetchInnerFlowResponse response = lsfxAnalysisClient.fetchInnerFlow(request);
|
||||
return AjaxResult.success(response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user