Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzlite
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzlite
提交
eb163354
提交
eb163354
编写于
12月 28, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong 部署微服务接口 [ibz-lite,micorservice]
上级
125a5084
变更
6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
76 行增加
和
51 行删除
+76
-51
config.xml
config.xml
+5
-0
ibzlite-app-web.yaml
...-app/ibzlite-app-web/src/main/docker/ibzlite-app-web.yaml
+4
-0
h2_table.xml
ibzlite-core/src/main/resources/liquibase/h2_table.xml
+16
-16
Dockerfile
...-provider/ibzlite-provider-api/src/main/docker/Dockerfile
+1
-1
ibzlite-provider-api.yaml
...te-provider-api/src/main/docker/ibzlite-provider-api.yaml
+19
-1
PermissionSyncJob.java
.../src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
+31
-33
未找到文件。
config.xml
浏览文件 @
eb163354
...
...
@@ -37,6 +37,11 @@
git clone -b master $para2 ibzlite/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzlite/
mvn clean package -Papi
cd ibzlite-provider/ibzlite-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzlite-provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
...
...
ibzlite-app/ibzlite-app-web/src/main/docker/ibzlite-app-web.yaml
浏览文件 @
eb163354
...
...
@@ -14,6 +14,10 @@ services:
memory
:
400M
mode
:
replicated
replicas
:
1
restart_policy
:
condition
:
on-failure
max_attempts
:
3
window
:
120s
volumes
:
-
"
nfs:/app/file"
...
...
ibzlite-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
eb163354
...
...
@@ -4,7 +4,7 @@
<!--输出实体[BLADE_VISUAL]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-blade_visual-55-1"
>
<changeSet
author=
"
a_A_5d9d78509
"
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=
"
root
"
id=
"tab-blade_visual_category-23-2"
>
<changeSet
author=
"
a_A_5d9d78509
"
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=
"
root
"
id=
"tab-blade_visual_config-18-3"
>
<changeSet
author=
"
a_A_5d9d78509
"
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=
"
root
"
id=
"tab-blade_visual_map-18-4"
>
<changeSet
author=
"
a_A_5d9d78509
"
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=
"
root
"
id=
"tab-dst_component-59-5"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_component-59-5"
>
<createTable
tableName=
"IBZCOMPONENT"
>
<column
name=
"CID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_COMPONENT_CID"
/>
...
...
@@ -112,7 +112,7 @@
<!--输出实体[DST_CONFIG]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-dst_config-32-6"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_config-32-6"
>
<createTable
tableName=
"IBZCFG"
>
<column
name=
"CFGID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_CONFIG_CFGID"
/>
...
...
@@ -134,7 +134,7 @@
<!--输出实体[DST_DATASOURCE]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-dst_datasource-75-7"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_datasource-75-7"
>
<createTable
tableName=
"IBZDATASOURCE"
>
<column
name=
"DSID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_DATASOURCE_DSID"
/>
...
...
@@ -152,7 +152,7 @@
<!--输出实体[DST_ROUTER]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-dst_router-37-8"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_router-37-8"
>
<createTable
tableName=
"IBZROUTER"
>
<column
name=
"ROUTERID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_ROUTER_ROUTERID"
/>
...
...
@@ -178,7 +178,7 @@
<!--输出实体[DST_SYSTEM]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-dst_system-41-9"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_system-41-9"
>
<createTable
tableName=
"IBZPSSYSTEM"
>
<column
name=
"PSSYSTEMID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_SYSTEM_PSSYSTEMID"
/>
...
...
@@ -198,7 +198,7 @@
<!--输出实体[DST_VIEW]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-dst_view-46-10"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-dst_view-46-10"
>
<createTable
tableName=
"IBZVIEW"
>
<column
name=
"VIEWID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_DST_VIEW_VIEWID"
/>
...
...
@@ -222,7 +222,7 @@
<!--输出实体[META_DATASET]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-meta_dataset-33-11"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_dataset-33-11"
>
<createTable
tableName=
"IBZDATASET"
>
<column
name=
"DATASETID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_DATASET_DATASETID"
/>
...
...
@@ -244,7 +244,7 @@
<!--输出实体[META_ENTITY]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-meta_entity-105-12"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_entity-105-12"
>
<createTable
tableName=
"IBZENTITY"
>
<column
name=
"ENTITYID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_ENTITY_ENTITYID"
/>
...
...
@@ -276,7 +276,7 @@
<!--输出实体[META_FIELD]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-meta_field-153-13"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_field-153-13"
>
<createTable
tableName=
"IBZFIELD"
>
<column
name=
"FIELDID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_FIELD_FIELDID"
/>
...
...
@@ -340,7 +340,7 @@
<!--输出实体[META_MODEL]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-meta_model-44-14"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_model-44-14"
>
<createTable
tableName=
"IBZMODEL"
>
<column
name=
"MODELID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_MODEL_MODELID"
/>
...
...
@@ -366,7 +366,7 @@
<!--输出实体[META_MODULE]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-meta_module-34-15"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_module-34-15"
>
<createTable
tableName=
"IBZMODULE"
>
<column
name=
"MODULEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_MODULE_MODULEID"
/>
...
...
@@ -384,7 +384,7 @@
<!--输出实体[META_RELATION]数据结构 -->
<changeSet
author=
"
root
"
id=
"tab-meta_relation-106-16"
>
<changeSet
author=
"
a_A_5d9d78509
"
id=
"tab-meta_relation-106-16"
>
<createTable
tableName=
"IBZRELATION"
>
<column
name=
"RELATIONID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_RELATION_RELATIONID"
/>
...
...
ibzlite-provider/ibzlite-provider-api/src/main/docker/Dockerfile
浏览文件 @
eb163354
...
...
@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzlite-provider-api.jar
EXPOSE
8081
EXPOSE
40010
ADD
ibzlite-provider-api.jar /ibzlite-provider-api.jar
ibzlite-provider/ibzlite-provider-api/src/main/docker/ibzlite-provider-api.yaml
浏览文件 @
eb163354
...
...
@@ -3,9 +3,23 @@ services:
ibzlite-provider-api
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzlite-provider-api:latest
ports
:
-
"
8081:8081
"
-
"
40010:40010
"
networks
:
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
-
SERVER_PORT=40010
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.100.243:8848
-
SPRING_REDIS_HOST=172.16.100.243
-
SPRING_REDIS_PORT=6379
-
SPRING_REDIS_DATABASE=0
-
SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
-
SPRING_DATASOURCE_PASSWORD=@6dEfb3@
-
SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
-
NACOS=172.16.100.243:8848
-
SPRING_CLOUD_NACOS_DISCOVERY_GROUP=ibizdev
deploy
:
resources
:
limits
:
...
...
@@ -14,6 +28,10 @@ services:
memory
:
400M
mode
:
replicated
replicas
:
1
restart_policy
:
condition
:
on-failure
max_attempts
:
3
window
:
120s
volumes
:
-
"
nfs:/app/file"
...
...
ibzlite-util/src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
浏览文件 @
eb163354
...
...
@@ -13,6 +13,7 @@ import org.springframework.boot.ApplicationRunner;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.DigestUtils
;
import
java.io.InputStream
;
import
java.util.*
;
...
...
@@ -25,58 +26,55 @@ import java.util.*;
@ConditionalOnProperty
(
name
=
"ibiz.enablePermissionValid"
,
havingValue
=
"true"
)
public
class
PermissionSyncJob
implements
ApplicationRunner
{
@Autowired
@Lazy
private
IBZUAAFeignClient
client
;
@Value
(
"${ibiz.systemid:ibzlite}"
)
private
String
systemId
;
@Value
(
"${ibiz.systemname:ibzlite}"
)
private
String
systemName
;
@Autowired
@Lazy
IBZLiteFeignClient
liteFeign
Client
;
private
IBZUAAFeignClient
uaa
Client
;
@Autowired
@Lazy
IBZLiteFeignClient
liteClient
;
@Override
public
void
run
(
ApplicationArguments
args
)
{
try
{
Thread
.
sleep
(
10000
);
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/permission/systemResource.json"
);
//获取当前系统所有实体资源能力
String
permissionResult
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
JSONObject
system
=
new
JSONObject
();
system
.
put
(
"pssystemid"
,
systemId
);
system
.
put
(
"pssystemname"
,
systemName
);
system
.
put
(
"sysstructure"
,
JSONObject
.
parseObject
(
permissionResult
));
system
.
put
(
"md5check"
,
DigestUtils
.
md5DigestAsHex
(
permissionResult
.
getBytes
()));
if
(
client
.
syncSysAuthority
(
system
))
{
log
.
info
(
"向[UAA]同步系统资源成功"
);
}
else
{
log
.
error
(
"向[UAA]同步系统资源失败"
);
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/permission/systemResource.json"
);
//权限资源
if
(!
ObjectUtils
.
isEmpty
(
permission
))
{
String
strPermission
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
JSONObject
system
=
new
JSONObject
()
{{
put
(
"pssystemid"
,
systemId
);
put
(
"pssystemname"
,
systemName
);
put
(
"sysstructure"
,
JSONObject
.
parseObject
(
strPermission
));
put
(
"md5check"
,
DigestUtils
.
md5DigestAsHex
(
strPermission
.
getBytes
()));
}};
if
(
uaaClient
.
syncSysAuthority
(
system
))
{
log
.
info
(
"向[uaa]同步系统资源成功"
);
}
else
{
log
.
error
(
"向[uaa]同步系统资源失败"
);
}
}
}
catch
(
Exception
ex
)
{
log
.
error
(
String
.
format
(
"向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]"
,
ex
));
}
catch
(
Exception
ex
)
{
log
.
error
(
"向[uaa]同步系统资源失败,请检查[uaa]服务是否正常运行! {}"
,
ex
.
getMessage
());
}
try
{
InputStream
sysModel
=
this
.
getClass
().
getResourceAsStream
(
"/sysmodel/ibzlite.json"
);
//获取当前系统所有实体资源能力
String
strSysModel
=
IOUtils
.
toString
(
sysModel
,
"UTF-8"
);
if
(
liteFeignClient
.
syncSysModel
(
JSONObject
.
parseObject
(
strSysModel
)))
{
log
.
info
(
"向[lite]同步系统模型成功"
);
}
else
{
log
.
error
(
"向[lite]同步系统模型失败"
);
InputStream
model
=
this
.
getClass
().
getResourceAsStream
(
"/sysmodel/ibzlite.json"
);
//系统模型
if
(!
ObjectUtils
.
isEmpty
(
model
))
{
String
strModel
=
IOUtils
.
toString
(
model
,
"UTF-8"
);
if
(
liteClient
.
syncSysModel
(
JSONObject
.
parseObject
(
strModel
)))
{
log
.
info
(
"向[lite]同步模型成功"
);
}
else
{
log
.
error
(
"向[lite]同步模型失败"
);
}
}
}
catch
(
Exception
ex
)
{
log
.
error
(
"向[lite]同步系统模型失败,请检查[lite]服务是否正常运行! {}"
,
ex
.
getMessage
());
}
catch
(
Exception
ex
)
{
log
.
error
(
String
.
format
(
"向[lite]同步系统模型失败,请检查[lite]服务是否正常! [%s]"
,
ex
));
}
}
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录