Commit a7f6e0ab authored by chenyan's avatar chenyan

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

parent fcf9ad42
......@@ -69,7 +69,11 @@ public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustom
}
}
if (apiCustomParams.getId() != null) {
ApiCustomParams old = selectById(apiCustomParams.getId());
Example exampleParams = new Example(ApiCustomParams.class);
exampleParams.createCriteria()
.andEqualTo("docId", apiCustomParams.getDocId())
.andEqualTo("nodeId", apiCustomParams.getNodeId());
ApiCustomParams old = mapper.selectOneByExample(exampleParams);
if (old == null || old.getIsDel() == 1) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, ResultCode.getMsg(ResultCode.NOTEXIST_CODE));
}
......@@ -86,6 +90,14 @@ public class ApiCustomParamsBiz extends BaseBiz<ApiCustomParamsMapper, ApiCustom
PageDataVO<ApiCustomParams> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectList(query.getSuper()));
return ObjectRestResponse.succ(pageDataVO);
}
public ObjectRestResponse getByNodeId(Integer id) {
Example exampleParams = new Example(ApiCustomParams.class);
exampleParams.createCriteria()
.andEqualTo("isDel",0)
.andEqualTo("nodeId", id);
return ObjectRestResponse.succ(mapper.selectOneByExample(exampleParams));
}
}
......
......@@ -14,6 +14,7 @@ import com.upyuns.platform.rs.website.entity.ApiCustomParams;
import com.upyuns.platform.rs.website.mapper.ApiCustomParamsMapper;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Example;
/**
*
......@@ -38,7 +39,7 @@ public class ApiCustomParamsController extends BaseController<ApiCustomParamsBiz
@GetMapping(value = "/detail")
public ObjectRestResponse detail(Integer id) {
return ObjectRestResponse.succ(baseBiz.selectById(id));
return baseBiz.getByNodeId(id);
}
......
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