Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdata
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdata
提交
7429b1c3
提交
7429b1c3
编写于
8月 25, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交,规范地址栏
上级
07ebbb1f
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
94 行增加
和
46 行删除
+94
-46
DOModel.java
...re/src/main/java/cn/ibizlab/core/data/domain/DOModel.java
+9
-2
BaseData.java
...core/src/main/java/cn/ibizlab/core/data/dto/BaseData.java
+5
-0
RequestData.java
...e/src/main/java/cn/ibizlab/core/data/dto/RequestData.java
+2
-15
DataResource.java
...src/main/java/cn/ibizlab/core/data/rest/DataResource.java
+78
-29
未找到文件。
ibzdata-core/src/main/java/cn/ibizlab/core/data/domain/DOModel.java
浏览文件 @
7429b1c3
...
@@ -177,7 +177,14 @@ public class DOModel implements Serializable {
...
@@ -177,7 +177,14 @@ public class DOModel implements Serializable {
if
(
keyMap
.
size
()==
1
)
if
(
keyMap
.
size
()==
1
)
{
{
PojoSchema
keyProperty
=
this
.
getKeyProperty
();
PojoSchema
keyProperty
=
this
.
getKeyProperty
();
Object
key
=
data
.
get
(
this
.
getKeyPropertyName
());
String
keyPropertyName
=
keyProperty
.
getName
().
toLowerCase
();
Object
key
=
data
.
get
(
keyPropertyName
);
if
(
ObjectUtils
.
isEmpty
(
key
))
{
key
=
data
.
getKey
();
if
(!
ObjectUtils
.
isEmpty
(
key
))
data
.
set
(
keyPropertyName
,
key
);
}
if
(
ObjectUtils
.
isEmpty
(
key
))
if
(
ObjectUtils
.
isEmpty
(
key
))
{
{
if
(
genKeyWhenNotExists
)
if
(
genKeyWhenNotExists
)
...
@@ -186,7 +193,7 @@ public class DOModel implements Serializable {
...
@@ -186,7 +193,7 @@ public class DOModel implements Serializable {
key
=
IdWorker
.
getId
();
key
=
IdWorker
.
getId
();
else
else
key
=
IdWorker
.
get32UUID
();
key
=
IdWorker
.
get32UUID
();
data
.
set
(
this
.
getKeyPropertyName
()
,
key
);
data
.
set
(
keyPropertyName
,
key
);
}
}
else
else
return
null
;
return
null
;
...
...
ibzdata-core/src/main/java/cn/ibizlab/core/data/dto/BaseData.java
浏览文件 @
7429b1c3
...
@@ -116,4 +116,9 @@ public class BaseData extends DataObj
...
@@ -116,4 +116,9 @@ public class BaseData extends DataObj
{
{
return
this
.
set
(
"_key"
,
key
);
return
this
.
set
(
"_key"
,
key
);
}
}
public
Serializable
getKey
()
{
return
getSerializableValue
(
"_key"
);
}
}
}
ibzdata-core/src/main/java/cn/ibizlab/core/data/dto/RequestData.java
浏览文件 @
7429b1c3
...
@@ -22,24 +22,11 @@ public class RequestData<T> extends BaseData
...
@@ -22,24 +22,11 @@ public class RequestData<T> extends BaseData
public
RequestData
setKey
(
Object
key
)
public
RequestData
setKey
(
Object
key
)
{
{
this
.
key
=
key
;
super
.
setKey
(
key
);
return
this
;
return
this
;
}
public
Serializable
getKey
()
{
Object
key
=
this
.
key
;
if
(
key
==
null
)
key
=
this
.
get
(
"key"
);
if
(
key
!=
null
)
return
(
Serializable
)
key
;
else
return
null
;
}
}
private
Object
key
;
private
String
system
;
private
String
system
;
private
String
scope
;
private
String
scope
;
private
String
entity
;
private
String
entity
;
...
...
ibzdata-core/src/main/java/cn/ibizlab/core/data/rest/DataResource.java
浏览文件 @
7429b1c3
...
@@ -5,6 +5,7 @@ import cn.ibizlab.core.data.dto.FilterData;
...
@@ -5,6 +5,7 @@ import cn.ibizlab.core.data.dto.FilterData;
import
cn.ibizlab.core.data.dto.RequestData
;
import
cn.ibizlab.core.data.dto.RequestData
;
import
cn.ibizlab.core.data.dto.ResponseData
;
import
cn.ibizlab.core.data.dto.ResponseData
;
import
cn.ibizlab.core.data.service.IDataService
;
import
cn.ibizlab.core.data.service.IDataService
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -13,6 +14,7 @@ import org.springframework.data.domain.Page;
...
@@ -13,6 +14,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.StringUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -27,17 +29,35 @@ public class DataResource
...
@@ -27,17 +29,35 @@ public class DataResource
@Autowired
@Autowired
public
IDataService
dataService
;
public
IDataService
dataService
;
@ApiOperation
(
value
=
"保存数据"
,
tags
=
{
"数据"
},
notes
=
"保存数据"
)
@ApiOperation
(
value
=
"callMethod数据"
,
tags
=
{
"数据"
},
notes
=
"callMethod数据"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/{method}"
,
"/ibiz-repo/{system}/{entity}/{method}"
})
@RequestMapping
(
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/{method}"
,
"/ibiz-repo/{system}/{entity}/{method}"
,
"/ibiz-repository/{system}/{scope}/{entity}/{key}/{method}"
,
"/ibiz-repo/{system}/{entity}/{key}/{method}"
})
public
ResponseEntity
call
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
public
ResponseEntity
call
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@PathVariable
(
name
=
"method"
,
required
=
true
)
String
method
,
@PathVariable
(
name
=
"method"
,
required
=
true
)
String
method
,
@RequestBody
RequestData
requestData
)
{
@PathVariable
(
name
=
"key"
,
required
=
false
)
String
key
,
@RequestBody
(
required
=
false
)
RequestData
requestData
)
{
ResponseData
responseData
=
dataService
.
call
(
system
,
scope
,
entity
,
datasource
,
method
,
requestData
);
if
(
requestData
==
null
)
{
if
(
StringUtils
.
isEmpty
(
key
))
throw
new
BadRequestAlertException
(
"未找到要检查的键值信息"
,
entity
,
null
);
requestData
=
new
RequestData
();
}
ResponseData
responseData
=
dataService
.
call
(
system
,
scope
,
entity
,
datasource
,
method
,
requestData
.
setKey
(
key
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
responseData
.
getBody
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
responseData
.
getBody
());
}
}
@ApiOperation
(
value
=
"批量callMethod数据"
,
tags
=
{
"数据"
},
notes
=
"批量callMethod数据"
)
@RequestMapping
(
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
},
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/{method}batch"
,
"/ibiz-repo/{system}/{entity}/{method}batch"
})
public
ResponseEntity
callBatch
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@PathVariable
(
name
=
"method"
,
required
=
true
)
String
method
,
@RequestBody
List
<
RequestData
>
requestDatas
)
{
if
(
requestDatas
!=
null
)
requestDatas
.
forEach
(
requestData
->
dataService
.
call
(
system
,
scope
,
entity
,
datasource
,
method
,
requestData
)
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"新建数据"
,
tags
=
{
"数据"
},
notes
=
"新建数据"
)
@ApiOperation
(
value
=
"新建数据"
,
tags
=
{
"数据"
},
notes
=
"新建数据"
)
...
@@ -69,25 +89,39 @@ public class DataResource
...
@@ -69,25 +89,39 @@ public class DataResource
}
}
@ApiOperation
(
value
=
"获取数据"
,
tags
=
{
"数据"
},
notes
=
"获取数据"
)
@ApiOperation
(
value
=
"获取数据"
,
tags
=
{
"数据"
},
notes
=
"获取数据"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/get"
,
"/ibiz-repo/{system}/{entity}/get"
})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/get"
,
"/ibiz-repo/{system}/{entity}/get"
,
"/ibiz-repository/{system}/{scope}/{entity}/{key}/get"
,
"/ibiz-repo/{system}/{entity}/{key}/get"
})
public
ResponseEntity
<
BaseData
>
get
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
public
ResponseEntity
<
BaseData
>
get
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@Validated
@RequestBody
BaseData
baseData
)
{
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
getByMap
(
system
,
scope
,
entity
,
datasource
,
baseData
));
@PathVariable
(
name
=
"key"
,
required
=
false
)
String
key
,
@Validated
@RequestBody
BaseData
baseData
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
getByMap
(
system
,
scope
,
entity
,
datasource
,
baseData
.
setKey
(
key
)));
}
}
@ApiOperation
(
value
=
"删除数据"
,
tags
=
{
"数据"
},
notes
=
"删除数据"
)
@ApiOperation
(
value
=
"删除数据"
,
tags
=
{
"数据"
},
notes
=
"删除数据"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/{key}"
,
"/ibiz-repo/{system}/{entity}/{key}"
})
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/{key}"
,
"/ibiz-repo/{system}/{entity}/{key}"
,
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@PathVariable
(
name
=
"key"
,
required
=
true
)
String
key
)
{
"/ibiz-repository/{system}/{scope}/{entity}"
,
"/ibiz-repo/{system}/{entity}"
})
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
remove
(
system
,
scope
,
entity
,
datasource
,
key
));
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@PathVariable
(
name
=
"key"
,
required
=
false
)
String
key
,
@RequestBody
(
required
=
false
)
BaseData
baseData
)
{
if
(
baseData
==
null
)
{
if
(
StringUtils
.
isEmpty
(
key
))
throw
new
BadRequestAlertException
(
"未找到要检查的键值信息"
,
entity
,
null
);
baseData
=
new
BaseData
();
}
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
removeByMap
(
system
,
scope
,
entity
,
datasource
,
baseData
.
setKey
(
key
)));
}
}
@ApiOperation
(
value
=
"删除数据"
,
tags
=
{
"数据"
},
notes
=
"删除数据"
)
@ApiOperation
(
value
=
"删除数据"
,
tags
=
{
"数据"
},
notes
=
"删除数据"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/remove"
,
"/ibiz-repo/{system}/{entity}/remove"
})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/remove"
,
"/ibiz-repo/{system}/{entity}/remove"
,
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
"/ibiz-repository/{system}/{scope}/{entity}/{key}/remove"
,
"/ibiz-repo/{system}/{entity}/{key}/remove"
})
public
ResponseEntity
<
Boolean
>
remove2
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@Validated
@RequestBody
BaseData
baseData
)
{
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
removeByMap
(
system
,
scope
,
entity
,
datasource
,
baseData
));
@PathVariable
(
name
=
"key"
,
required
=
false
)
String
key
,
@Validated
@RequestBody
BaseData
baseData
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
removeByMap
(
system
,
scope
,
entity
,
datasource
,
baseData
.
setKey
(
key
)));
}
}
@ApiOperation
(
value
=
"批量删除数据"
,
tags
=
{
"数据"
},
notes
=
"批量删除数据"
)
@ApiOperation
(
value
=
"批量删除数据"
,
tags
=
{
"数据"
},
notes
=
"批量删除数据"
)
...
@@ -120,11 +154,13 @@ public class DataResource
...
@@ -120,11 +154,13 @@ public class DataResource
}
}
@ApiOperation
(
value
=
"更新数据"
,
tags
=
{
"数据"
},
notes
=
"更新数据"
)
@ApiOperation
(
value
=
"更新数据"
,
tags
=
{
"数据"
},
notes
=
"更新数据"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/update"
,
"/ibiz-repo/{system}/{entity}/update"
})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/update"
,
"/ibiz-repo/{system}/{entity}/update"
,
public
ResponseEntity
<
BaseData
>
update
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
"/ibiz-repository/{system}/{scope}/{entity}/{key}/update"
,
"/ibiz-repo/{system}/{entity}/{key}/update"
})
public
ResponseEntity
<
BaseData
>
update2
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@RequestBody
BaseData
baseData
)
{
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
dataService
.
update
(
system
,
scope
,
entity
,
datasource
,
baseData
);
@PathVariable
(
name
=
"key"
,
required
=
false
)
String
key
,
@RequestBody
BaseData
baseData
)
{
dataService
.
update
(
system
,
scope
,
entity
,
datasource
,
baseData
.
setKey
(
key
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
baseData
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
baseData
);
}
}
...
@@ -147,28 +183,41 @@ public class DataResource
...
@@ -147,28 +183,41 @@ public class DataResource
}
}
@ApiOperation
(
value
=
"检查数据"
,
tags
=
{
"数据"
},
notes
=
"检查数据"
)
@ApiOperation
(
value
=
"检查数据"
,
tags
=
{
"数据"
},
notes
=
"检查数据"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/checkkey"
,
"/ibiz-repo/{system}/{entity}/checkkey"
})
@RequestMapping
(
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/checkkey"
,
"/ibiz-repo/{system}/{entity}/checkkey"
,
"/ibiz-repository/{system}/{scope}/{entity}/{key}/checkkey"
,
"/ibiz-repo/{system}/{entity}/{key}/checkkey"
})
public
ResponseEntity
<
Boolean
>
checkKey
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
public
ResponseEntity
<
Boolean
>
checkKey
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@RequestBody
BaseData
baseData
)
{
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
checkKey
(
system
,
scope
,
entity
,
datasource
,
baseData
));
@PathVariable
(
name
=
"key"
,
required
=
false
)
String
key
,
@RequestBody
(
required
=
false
)
BaseData
baseData
)
{
if
(
baseData
==
null
)
{
if
(
StringUtils
.
isEmpty
(
key
))
throw
new
BadRequestAlertException
(
"未找到要检查的键值信息"
,
entity
,
null
);
baseData
=
new
BaseData
();
}
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
checkKey
(
system
,
scope
,
entity
,
datasource
,
baseData
.
setKey
(
key
)));
}
}
@ApiOperation
(
value
=
"获取数据草稿"
,
tags
=
{
"数据"
},
notes
=
"获取数据草稿"
)
@ApiOperation
(
value
=
"获取数据草稿"
,
tags
=
{
"数据"
},
notes
=
"获取数据草稿"
)
@RequestMapping
(
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/getdraft"
,
"/ibiz-repo/{system}/{entity}/getdraft"
})
@RequestMapping
(
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/getdraft"
,
"/ibiz-repo/{system}/{entity}/getdraft"
,
"/ibiz-repository/{system}/{scope}/{entity}/{key}/getdraft"
,
"/ibiz-repo/{system}/{entity}/{key}/getdraft"
})
public
ResponseEntity
<
BaseData
>
getDraft
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
public
ResponseEntity
<
BaseData
>
getDraft
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@RequestBody
(
required
=
false
)
BaseData
baseData
)
{
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
dataService
.
getDraft
(
system
,
scope
,
entity
,
datasource
,
baseData
);
@PathVariable
(
name
=
"key"
,
required
=
false
)
String
key
,
@RequestBody
(
required
=
false
)
BaseData
baseData
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
baseData
);
if
(
baseData
==
null
)
baseData
=
new
BaseData
();
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dataService
.
getDraft
(
system
,
scope
,
entity
,
datasource
,
baseData
.
setKey
(
key
)));
}
}
@ApiOperation
(
value
=
"保存数据"
,
tags
=
{
"数据"
},
notes
=
"保存数据"
)
@ApiOperation
(
value
=
"保存数据"
,
tags
=
{
"数据"
},
notes
=
"保存数据"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/save"
,
"/ibiz-repo/{system}/{entity}/save"
})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
{
"/ibiz-repository/{system}/{scope}/{entity}/save"
,
"/ibiz-repo/{system}/{entity}/save"
,
"/ibiz-repository/{system}/{scope}/{entity}/{key}/save"
,
"/ibiz-repo/{system}/{entity}/{key}/save"
})
public
ResponseEntity
<
BaseData
>
save
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
public
ResponseEntity
<
BaseData
>
save
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@RequestBody
BaseData
baseData
)
{
@RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
dataService
.
save
(
system
,
scope
,
entity
,
datasource
,
baseData
);
@PathVariable
(
name
=
"key"
,
required
=
false
)
String
key
,
@RequestBody
BaseData
baseData
)
{
dataService
.
save
(
system
,
scope
,
entity
,
datasource
,
baseData
.
setKey
(
key
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
baseData
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
baseData
);
}
}
...
@@ -185,7 +234,7 @@ public class DataResource
...
@@ -185,7 +234,7 @@ public class DataResource
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
={
"/ibiz-repository/{system}/{scope}/{entity}/fetch{dataset}"
,
"/ibiz-repo/{system}/{entity}/fetch{dataset}"
})
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
={
"/ibiz-repository/{system}/{scope}/{entity}/fetch{dataset}"
,
"/ibiz-repo/{system}/{entity}/fetch{dataset}"
})
public
ResponseEntity
<
List
<
BaseData
>>
fetch
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
public
ResponseEntity
<
List
<
BaseData
>>
fetch
(
@PathVariable
(
name
=
"system"
,
required
=
true
)
String
system
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"scope"
,
required
=
false
)
String
scope
,
@PathVariable
(
name
=
"entity"
,
required
=
true
)
String
entity
,
@PathVariable
(
name
=
"dataset"
,
required
=
true
)
String
dataset
,
@
RequestParam
(
name
=
"datasource"
,
required
=
false
)
String
datasource
,
@
PathVariable
(
name
=
"dataset"
,
required
=
true
)
String
dataset
,
FilterData
context
)
{
FilterData
context
)
{
Page
<
BaseData
>
baseDatas
=
dataService
.
fetch
(
system
,
scope
,
entity
,
context
.
getDataSource
(),
dataset
,
context
,
context
.
getPageable
())
;
Page
<
BaseData
>
baseDatas
=
dataService
.
fetch
(
system
,
scope
,
entity
,
context
.
getDataSource
(),
dataset
,
context
,
context
.
getPageable
())
;
List
<
BaseData
>
list
=
baseDatas
.
getContent
();
List
<
BaseData
>
list
=
baseDatas
.
getContent
();
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录