提交 7e478f0b 编写于 作者: sq3536's avatar sq3536

代码分层

上级 00ae9e93
...@@ -73,78 +73,6 @@ public class BaseDataServiceImpl implements IDataService { ...@@ -73,78 +73,6 @@ public class BaseDataServiceImpl implements IDataService {
@Override @Override
public ResponseData call(DOModel model,String scope, DSLink link, String method, RequestData requestBody) public ResponseData call(DOModel model,String scope, DSLink link, String method, RequestData requestBody)
{ {
if("create".equalsIgnoreCase(method))
{
if(create(model, scope, link, requestBody.getBaseData())!=null)
return ResponseData.ok(requestBody.getBaseData());
else
return ResponseData.error(1,"");
}
else if("update".equalsIgnoreCase(method))
{
if(update(model, scope, link, requestBody.getBaseData())!=null)
return ResponseData.ok(requestBody.getBaseData());
else
return ResponseData.error(1,"");
}
else if("save".equalsIgnoreCase(method))
{
if(save(model, scope, link, requestBody.getBaseData())!=null)
return ResponseData.ok(requestBody.getBaseData());
else
return ResponseData.error(1,"");
}
else if("remove".equalsIgnoreCase(method))
{
Serializable key=requestBody.getKey();
if(ObjectUtils.isEmpty(key))
key=model.getKeyValue(requestBody.getBaseData(),false);
if(ObjectUtils.isEmpty(key))
return ResponseData.error(400,"key 没有输入");
if(remove(model, scope, link, key))
return ResponseData.ok(requestBody.getBaseData());
else
return ResponseData.error(1,"");
}
else if("get".equalsIgnoreCase(method))
{
Serializable key=requestBody.getKey();
if(ObjectUtils.isEmpty(key))
key=model.getKeyValue(requestBody.getBaseData(),false);
if(ObjectUtils.isEmpty(key))
return ResponseData.error(400,"key 没有输入");
BaseData data=get(model,scope,link,key);
if(data!=null)
return ResponseData.ok(data);
else
return ResponseData.error(404,"");
}
else if("checkKey".equalsIgnoreCase(method))
{
if(checkKey(model, scope, link, requestBody.getBaseData()))
return ResponseData.ok(requestBody.getBaseData());
else
return ResponseData.error(1,"");
}
else if("getDraft".equalsIgnoreCase(method))
{
return ResponseData.ok(getDraft(model, scope, link, requestBody.getBaseData()));
}
else if("createBatch".equalsIgnoreCase(method))
{
createBatch(model, scope, link, requestBody.getListData());
return ResponseData.ok(true);
}
else if("updateBatch".equalsIgnoreCase(method))
{
updateBatch(model, scope, link, requestBody.getListData());
return ResponseData.ok(true);
}
else if("saveBatch".equalsIgnoreCase(method))
{
saveBatch(model, scope, link, requestBody.getListData());
return ResponseData.ok(true);
}
return null; return null;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册