Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzlite
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzlite
提交
ab5d0682
提交
ab5d0682
编写于
12月 03, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong 发布系统代码 [ibz-lite,应用]
上级
90c435ae
变更
8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
90 行增加
和
19 行删除
+90
-19
app-form-item.vue
app_web/src/components/app-form-item/app-form-item.vue
+2
-2
dst-data-sources.ts
app_web/src/mock/entity/dst-data-sources/dst-data-sources.ts
+38
-0
dst-data-source-service-base.ts
...c/service/dst-data-source/dst-data-source-service-base.ts
+14
-0
IDstDataSourceService.java
...a/cn/ibizlab/core/lite/service/IDstDataSourceService.java
+1
-0
DstDataSourceServiceImpl.java
...zlab/core/lite/service/impl/DstDataSourceServiceImpl.java
+7
-0
h2_table.xml
ibzlite-core/src/main/resources/liquibase/h2_table.xml
+16
-16
systemResource.json
...te-core/src/main/resources/permission/systemResource.json
+1
-1
DstDataSourceResource.java
.../main/java/cn/ibizlab/api/rest/DstDataSourceResource.java
+11
-0
未找到文件。
app_web/src/components/app-form-item/app-form-item.vue
浏览文件 @
ab5d0682
...
...
@@ -21,7 +21,7 @@
class=
"editor"
:style=
"slotstyle"
>
<form-item
:prop=
"name"
:error=
"error"
:required=
"required"
:rules=
"rules"
>
<form-item
:prop=
"name"
:error=
"error"
:rules=
"rules"
>
<slot></slot>
</form-item>
</div>
...
...
@@ -48,7 +48,7 @@
class=
"editor"
:style=
"slotstyle"
>
<form-item
:prop=
"name"
:error=
"error"
:required=
"required"
:rules=
"rules"
>
<form-item
:prop=
"name"
:error=
"error"
:rules=
"rules"
>
<slot></slot>
</form-item>
</div>
...
...
app_web/src/mock/entity/dst-data-sources/dst-data-sources.ts
浏览文件 @
ab5d0682
...
...
@@ -271,6 +271,44 @@ mock.onPost(new RegExp(/^\/dstdatasources\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)
return
[
status
,
data
];
});
// InitDS
mock
.
onPost
(
new
RegExp
(
/^
\/
dstdatasources
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
initds$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dstdatasource 方法: InitDS"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'ds_id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
dstdatasources
\/([
a-zA-Z0-9
\-\;]{1,35})\/
initds$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.ds_id, tempValue.ds_id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'ds_id'
]
==
tempValue
[
'ds_id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
dstdatasources
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:dstdatasource 方法: Save"
);
...
...
app_web/src/service/dst-data-source/dst-data-source-service-base.ts
浏览文件 @
ab5d0682
...
...
@@ -167,6 +167,20 @@ export default class DstDataSourceServiceBase extends EntityService {
return
res
;
}
/**
* InitDS接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof DstDataSourceServiceBase
*/
public
async
InitDS
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/dstdatasources/
${
context
.
dstdatasource
}
/initds`
,
data
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/IDstDataSourceService.java
浏览文件 @
ab5d0682
...
...
@@ -35,6 +35,7 @@ public interface IDstDataSourceService extends IService<DstDataSource> {
DstDataSource
getDraft
(
DstDataSource
et
);
DstDataSource
buildDS
(
DstDataSource
et
);
boolean
checkKey
(
DstDataSource
et
);
DstDataSource
initDS
(
DstDataSource
et
);
boolean
save
(
DstDataSource
et
);
void
saveBatch
(
List
<
DstDataSource
>
list
);
Page
<
DstDataSource
>
searchDefault
(
DstDataSourceSearchContext
context
);
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/impl/DstDataSourceServiceImpl.java
浏览文件 @
ab5d0682
...
...
@@ -128,6 +128,13 @@ public class DstDataSourceServiceImpl extends ServiceImpl<DstDataSourceMapper, D
public
boolean
checkKey
(
DstDataSource
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getDsId
()))
&&
(!
Objects
.
isNull
(
this
.
getById
(
et
.
getDsId
())));
}
@Override
@Transactional
public
DstDataSource
initDS
(
DstDataSource
et
)
{
//自定义代码
return
et
;
}
@Override
@Transactional
public
boolean
save
(
DstDataSource
et
)
{
...
...
ibzlite-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
ab5d0682
...
...
@@ -4,7 +4,7 @@
<!--输出实体[BLADE_VISUAL]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-blade_visual-55-1"
>
<changeSet
author=
"
root
"
id=
"tab-blade_visual-55-1"
>
<createTable
tableName=
"blade_visual"
>
<column
name=
"ID"
remarks=
""
type=
"BIGINT"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_BLADE_VISUAL_ID"
/>
...
...
@@ -36,7 +36,7 @@
<!--输出实体[BLADE_VISUAL_CATEGORY]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-blade_visual_category-23-2"
>
<changeSet
author=
"
root
"
id=
"tab-blade_visual_category-23-2"
>
<createTable
tableName=
"blade_visual_category"
>
<column
name=
"ID"
remarks=
""
type=
"BIGINT"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_BLADE_VISUAL_CATEGORY_ID"
/>
...
...
@@ -52,7 +52,7 @@
<!--输出实体[BLADE_VISUAL_CONFIG]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-blade_visual_config-18-3"
>
<changeSet
author=
"
root
"
id=
"tab-blade_visual_config-18-3"
>
<createTable
tableName=
"blade_visual_config"
>
<column
name=
"ID"
remarks=
""
type=
"BIGINT"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_BLADE_VISUAL_CONFIG_ID"
/>
...
...
@@ -68,7 +68,7 @@
<!--输出实体[BLADE_VISUAL_MAP]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-blade_visual_map-18-4"
>
<changeSet
author=
"
root
"
id=
"tab-blade_visual_map-18-4"
>
<createTable
tableName=
"blade_visual_map"
>
<column
name=
"ID"
remarks=
""
type=
"BIGINT"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_BLADE_VISUAL_MAP_ID"
/>
...
...
@@ -86,7 +86,7 @@
<!--输出实体[DST_COMPONENT]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_component-56-5"
>
<changeSet
author=
"
root
"
id=
"tab-dst_component-56-5"
>
<createTable
tableName=
"IBZCOMPONENT"
>
<column
name=
"CID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_COMPONENT_CID"
/>
...
...
@@ -110,7 +110,7 @@
<!--输出实体[DST_CONFIG]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_config-32-6"
>
<changeSet
author=
"
root
"
id=
"tab-dst_config-32-6"
>
<createTable
tableName=
"IBZCFG"
>
<column
name=
"CFGID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_CONFIG_CFGID"
/>
...
...
@@ -132,7 +132,7 @@
<!--输出实体[DST_DATASOURCE]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509"
id=
"tab-dst_datasource-44
-7"
>
<changeSet
author=
"
root"
id=
"tab-dst_datasource-52
-7"
>
<createTable
tableName=
"IBZDATASOURCE"
>
<column
name=
"DSID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_DATASOURCE_DSID"
/>
...
...
@@ -150,7 +150,7 @@
<!--输出实体[DST_ROUTER]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_router-35-8"
>
<changeSet
author=
"
root
"
id=
"tab-dst_router-35-8"
>
<createTable
tableName=
"IBZROUTER"
>
<column
name=
"ROUTERID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_ROUTER_ROUTERID"
/>
...
...
@@ -174,7 +174,7 @@
<!--输出实体[DST_SYSTEM]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_system-38-9"
>
<changeSet
author=
"
root
"
id=
"tab-dst_system-38-9"
>
<createTable
tableName=
"IBZPSSYSTEM"
>
<column
name=
"PSSYSTEMID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_SYSTEM_PSSYSTEMID"
/>
...
...
@@ -194,7 +194,7 @@
<!--输出实体[DST_VIEW]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_view-43-10"
>
<changeSet
author=
"
root
"
id=
"tab-dst_view-43-10"
>
<createTable
tableName=
"IBZVIEW"
>
<column
name=
"VIEWID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_VIEW_VIEWID"
/>
...
...
@@ -216,7 +216,7 @@
<!--输出实体[META_DATASET]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_dataset-32-11"
>
<changeSet
author=
"
root
"
id=
"tab-meta_dataset-32-11"
>
<createTable
tableName=
"IBZDATASET"
>
<column
name=
"DATASETID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_DATASET_DATASETID"
/>
...
...
@@ -238,7 +238,7 @@
<!--输出实体[META_ENTITY]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_entity-89-12"
>
<changeSet
author=
"
root
"
id=
"tab-meta_entity-89-12"
>
<createTable
tableName=
"IBZENTITY"
>
<column
name=
"ENTITYID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_ENTITY_ENTITYID"
/>
...
...
@@ -266,7 +266,7 @@
<!--输出实体[META_FIELD]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_field-147-13"
>
<changeSet
author=
"
root
"
id=
"tab-meta_field-147-13"
>
<createTable
tableName=
"IBZFIELD"
>
<column
name=
"FIELDID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_FIELD_FIELDID"
/>
...
...
@@ -326,7 +326,7 @@
<!--输出实体[META_MODEL]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_model-29-14"
>
<changeSet
author=
"
root
"
id=
"tab-meta_model-29-14"
>
<createTable
tableName=
"IBZMODEL"
>
<column
name=
"MODELID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_MODEL_MODELID"
/>
...
...
@@ -342,7 +342,7 @@
<!--输出实体[META_MODULE]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_module-28-15"
>
<changeSet
author=
"
root
"
id=
"tab-meta_module-28-15"
>
<createTable
tableName=
"IBZMODULE"
>
<column
name=
"MODULEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_MODULE_MODULEID"
/>
...
...
@@ -360,7 +360,7 @@
<!--输出实体[META_RELATION]数据结构 -->
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_relation-98-16"
>
<changeSet
author=
"
root
"
id=
"tab-meta_relation-98-16"
>
<createTable
tableName=
"IBZRELATION"
>
<column
name=
"RELATIONID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_RELATION_RELATIONID"
/>
...
...
ibzlite-core/src/main/resources/permission/systemResource.json
浏览文件 @
ab5d0682
...
...
@@ -72,7 +72,7 @@
"delogicname"
:
"数据源"
,
"sysmoudle"
:{
"id"
:
"LITE"
,
"name"
:
"lite"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"数据集"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"BuildDS"
,
"name"
:
"buildDS"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"BuildDS"
,
"name"
:
"buildDS"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"
InitDS"
,
"name"
:
"行为"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"
Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
,
{
...
...
ibzlite-provider/ibzlite-provider-api/src/main/java/cn/ibizlab/api/rest/DstDataSourceResource.java
浏览文件 @
ab5d0682
...
...
@@ -131,6 +131,17 @@ public class DstDataSourceResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dstdatasourceService
.
checkKey
(
dstdatasourceMapping
.
toDomain
(
dstdatasourcedto
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-InitDS-all')"
)
@ApiOperation
(
value
=
"行为"
,
tags
=
{
"数据源"
},
notes
=
"行为"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dstdatasources/{dstdatasource_id}/initds"
)
public
ResponseEntity
<
DstDataSourceDTO
>
initDS
(
@PathVariable
(
"dstdatasource_id"
)
String
dstdatasource_id
,
@RequestBody
DstDataSourceDTO
dstdatasourcedto
)
{
DstDataSource
domain
=
dstdatasourceMapping
.
toDomain
(
dstdatasourcedto
);
domain
.
setDsId
(
dstdatasource_id
);
domain
=
dstdatasourceService
.
initDS
(
domain
);
dstdatasourcedto
=
dstdatasourceMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dstdatasourcedto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-DstDataSource-Save-all')"
)
@ApiOperation
(
value
=
"保存数据源"
,
tags
=
{
"数据源"
},
notes
=
"保存数据源"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dstdatasources/save"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录