Commit 1ae0694d authored by chenyan's avatar chenyan

2024/05/09_API文档后台管理开发

parent a7f6e0ab
...@@ -68,18 +68,16 @@ public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustom ...@@ -68,18 +68,16 @@ public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustom
return ObjectRestResponse.createFailedResult(ResultCode.EXIST_CODE, "API节点下已存在自定义参数"); return ObjectRestResponse.createFailedResult(ResultCode.EXIST_CODE, "API节点下已存在自定义参数");
} }
} }
if (apiCustomParams.getId() != null) {
Example exampleParams = new Example(ApiCustomParams.class); Example exampleParams = new Example(ApiCustomParams.class);
exampleParams.createCriteria() exampleParams.createCriteria()
.andEqualTo("docId", apiCustomParams.getDocId()) .andEqualTo("docId", apiCustomParams.getDocId())
.andEqualTo("nodeId", apiCustomParams.getNodeId()); .andEqualTo("nodeId", apiCustomParams.getNodeId())
.andEqualTo("isDel",0);
ApiCustomParams old = mapper.selectOneByExample(exampleParams); ApiCustomParams old = mapper.selectOneByExample(exampleParams);
if (old == null || old.getIsDel() == 1) { if (old != null) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, ResultCode.getMsg(ResultCode.NOTEXIST_CODE));
}
BeanUtil.copyProperties(apiCustomParams, old, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true)); BeanUtil.copyProperties(apiCustomParams, old, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
updateSelectiveByIdRe(old); updateSelectiveByIdRe(old);
} else { }else {
insertSelectiveRe(apiCustomParams); insertSelectiveRe(apiCustomParams);
} }
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment