Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
229b5a75
提交
229b5a75
编写于
5月 25, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 部署微服务接口
上级
3559fb76
变更
8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
45 行增加
和
59 行删除
+45
-59
config.xml
config.xml
+5
-5
Dockerfile
ibzuaa-app/ibzuaa-app-web/src/main/docker/Dockerfile
+1
-1
ibzuaa-app-web.yaml
...aa-app/ibzuaa-app-web/src/main/docker/ibzuaa-app-web.yaml
+1
-15
Dockerfile
...a-provider/ibzuaa-provider-api/src/main/docker/Dockerfile
+1
-1
ibzuaa-provider-api.yaml
...uaa-provider-api/src/main/docker/ibzuaa-provider-api.yaml
+13
-1
IBZUAAFallback.java
.../src/main/java/cn/ibizlab/util/client/IBZUAAFallback.java
+2
-3
IBZUAAFeignClient.java
...c/main/java/cn/ibizlab/util/client/IBZUAAFeignClient.java
+3
-4
PermissionSyncJob.java
.../src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
+19
-29
未找到文件。
config.xml
浏览文件 @
229b5a75
...
@@ -37,11 +37,11 @@
...
@@ -37,11 +37,11 @@
git clone -b master $para2 ibzuaa/
git clone -b master $para2 ibzuaa/
export NODE_OPTIONS=--max-old-space-size=4096
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzuaa/
cd ibzuaa/
mvn clean package -P
web
mvn clean package -P
api
cd ibzuaa-
app/ibzuaa-app-web
cd ibzuaa-
provider/ibzuaa-provider-api
mvn -P
web
docker:build
mvn -P
api
docker:build
mvn -P
web
docker:push
mvn -P
api
docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzuaa-
app-web.yaml ibzlab-rt --with-registry-auth
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzuaa-
provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</command>
</hudson.tasks.Shell>
</hudson.tasks.Shell>
</builders>
</builders>
...
...
ibzuaa-app/ibzuaa-app-web/src/main/docker/Dockerfile
浏览文件 @
229b5a75
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-app-web.jar
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-app-web.jar
EXPOSE
30002
EXPOSE
8080
ADD
ibzuaa-app-web.jar /ibzuaa-app-web.jar
ADD
ibzuaa-app-web.jar /ibzuaa-app-web.jar
ibzuaa-app/ibzuaa-app-web/src/main/docker/ibzuaa-app-web.yaml
浏览文件 @
229b5a75
...
@@ -3,23 +3,9 @@ services:
...
@@ -3,23 +3,9 @@ services:
ibzuaa-app-web
:
ibzuaa-app-web
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-app-web:latest
ports
:
ports
:
-
"
30002:30002
"
-
"
8080:8080
"
networks
:
networks
:
-
agent_network
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
-
SERVER_PORT=30002
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211: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
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
-
ABC=1
-
DEC=2
deploy
:
deploy
:
mode
:
replicated
mode
:
replicated
replicas
:
1
replicas
:
1
...
...
ibzuaa-provider/ibzuaa-provider-api/src/main/docker/Dockerfile
浏览文件 @
229b5a75
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
...
@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-provider-api.jar
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzuaa-provider-api.jar
EXPOSE
8081
EXPOSE
40002
ADD
ibzuaa-provider-api.jar /ibzuaa-provider-api.jar
ADD
ibzuaa-provider-api.jar /ibzuaa-provider-api.jar
ibzuaa-provider/ibzuaa-provider-api/src/main/docker/ibzuaa-provider-api.yaml
浏览文件 @
229b5a75
...
@@ -3,9 +3,21 @@ services:
...
@@ -3,9 +3,21 @@ services:
ibzuaa-provider-api
:
ibzuaa-provider-api
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-provider-api:latest
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzuaa-provider-api:latest
ports
:
ports
:
-
"
8081:8081
"
-
"
40002:40002
"
networks
:
networks
:
-
agent_network
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
-
SERVER_PORT=40002
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211: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
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
deploy
:
deploy
:
mode
:
replicated
mode
:
replicated
replicas
:
1
replicas
:
1
...
...
ibzuaa-util/src/main/java/cn/ibizlab/util/client/IBZUAAFallback.java
浏览文件 @
229b5a75
...
@@ -4,14 +4,13 @@ import cn.ibizlab.util.security.AuthenticationUser;
...
@@ -4,14 +4,13 @@ import cn.ibizlab.util.security.AuthenticationUser;
import
cn.ibizlab.util.security.AuthorizationLogin
;
import
cn.ibizlab.util.security.AuthorizationLogin
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Map
;
@Component
@Component
public
class
IBZUAAFallback
implements
IBZUAAFeignClient
{
public
class
IBZUAAFallback
implements
IBZUAAFeignClient
{
@Override
@Override
public
JSONObject
pushSystemPermissionData
(
Map
<
String
,
Object
>
systemPermissionData
,
String
systemId
)
{
public
boolean
pushSystemPermissionData
(
String
systemid
,
JSONObject
systemPermissionData
)
{
return
null
;
return
false
;
}
}
@Override
@Override
...
...
ibzuaa-util/src/main/java/cn/ibizlab/util/client/IBZUAAFeignClient.java
浏览文件 @
229b5a75
...
@@ -5,19 +5,18 @@ import cn.ibizlab.util.security.AuthorizationLogin;
...
@@ -5,19 +5,18 @@ import cn.ibizlab.util.security.AuthorizationLogin;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Map
;
@FeignClient
(
value
=
"ibzuaa-api"
,
fallback
=
IBZUAAFallback
.
class
)
@FeignClient
(
value
=
"ibzuaa-api"
,
fallback
=
IBZUAAFallback
.
class
)
public
interface
IBZUAAFeignClient
public
interface
IBZUAAFeignClient
{
{
/**
/**
* 推送系统权限数据到uaa
* 推送系统权限数据到uaa
* @param systemid
* @param systemPermissionData
* @param systemPermissionData
* @param systemId
* @return
* @return
*/
*/
@PostMapping
(
"/
uaa/permission/save
"
)
@PostMapping
(
"/
syspssystems/{systemid}/permissiondata
"
)
JSONObject
pushSystemPermissionData
(
@RequestBody
Map
<
String
,
Object
>
systemPermissionData
,
@RequestParam
(
"systemid"
)
String
systemId
);
boolean
pushSystemPermissionData
(
@PathVariable
(
"systemid"
)
String
systemid
,
@RequestBody
JSONObject
systemPermissionData
);
/**
/**
* 用户登录
* 用户登录
...
...
ibzuaa-util/src/main/java/cn/ibizlab/util/job/PermissionSyncJob.java
浏览文件 @
229b5a75
package
cn
.
ibizlab
.
util
.
job
;
package
cn
.
ibizlab
.
util
.
job
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
cn.ibizlab.util.client.IBZUAAFeignClient
;
import
cn.ibizlab.util.client.IBZUAAFeignClient
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
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.stereotype.Component
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.List
;
import
java.util.ArrayList
;
import
java.io.IOException
;
/**
/**
* 权限:向uaa同步当前系统菜单、权限资源任务类
* 权限:向uaa同步当前系统菜单、权限资源任务类
*/
*/
//@Component //开启此类需要保证Main中开启了feign :EnableFeignClients
@Slf4j
@Component
@ConditionalOnProperty
(
name
=
"ibiz.enablePermissionValid"
,
havingValue
=
"true"
)
public
class
PermissionSyncJob
implements
ApplicationRunner
{
public
class
PermissionSyncJob
implements
ApplicationRunner
{
private
Log
log
=
LogFactory
.
getLog
(
PermissionSyncJob
.
class
);
@Autowired
@Autowired
@Lazy
private
IBZUAAFeignClient
client
;
private
IBZUAAFeignClient
client
;
@Value
(
"${ibiz.enablePermissionValid:false}"
)
boolean
enablePermissionValid
;
//是否开启权限校验
@Value
(
"${ibiz.systemid:ibzuaa}"
)
@Value
(
"${ibiz.systemid:ibzuaa}"
)
private
String
systemId
;
private
String
systemId
;
@Override
@Override
public
void
run
(
ApplicationArguments
args
)
{
public
void
run
(
ApplicationArguments
args
)
{
if
(
enablePermissionValid
){
try
{
try
{
Thread
.
sleep
(
10000
);
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/permission/systemResource.json"
);
//获取当前系统所有实体资源能力
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/permission/systemResource.json"
);
//获取当前系统所有实体资源能力
String
permissionResult
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
String
permissionResult
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
JSONObject
jsonNodePermission
=
JSONObject
.
parseObject
(
permissionResult
);
if
(
client
.
pushSystemPermissionData
(
systemId
,
JSONObject
.
parseObject
(
permissionResult
))){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
log
.
info
(
"向[UAA]同步系统资源成功"
);
map
.
put
(
"permission"
,
jsonNodePermission
);
}
else
{
JSONObject
syncResult
=
client
.
pushSystemPermissionData
(
map
,
systemId
);
log
.
info
(
String
.
format
(
"向[UAA]同步系统资源失败"
));
if
(
syncResult
.
getInteger
(
"code"
)==
1
){
log
.
info
(
"向[UAA]同步系统资源成功"
);
}
else
{
log
.
info
(
String
.
format
(
"向[UAA]同步系统资源失败,失败原因为[%s]"
,
syncResult
.
getString
(
"msg"
)));
}
}
catch
(
Exception
ex
)
{
log
.
error
(
String
.
format
(
"向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]"
,
ex
));
}
}
}
}
catch
(
Exception
ex
)
{
log
.
error
(
String
.
format
(
"向[UAA]同步系统资源失败,请检查[UAA]服务是否正常! [%s]"
,
ex
));
}
}
}
}
}
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录