Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdisk
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdisk
提交
8de67fcc
提交
8de67fcc
编写于
5月 29, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码
上级
b0036ac0
变更
16
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
426 行增加
和
75 行删除
+426
-75
CHANGELOG.md
app_web/CHANGELOG.md
+58
-0
context-menu.less
app_web/src/components/context-menu/context-menu.less
+49
-45
default.less
app_web/src/styles/default.less
+1
-1
interceptor.ts
app_web/src/utils/interceptor/interceptor.ts
+7
-0
Dockerfile
ibzdisk-app/ibzdisk-app-web/src/main/docker/Dockerfile
+3
-3
DevBootSecurityConfig.java
...rc/main/java/cn/ibizlab/config/DevBootSecurityConfig.java
+4
-1
XxlJobConfig.java
...c/main/java/cn/ibizlab/core/util/config/XxlJobConfig.java
+80
-0
pom.xml
ibzdisk-dependencies/pom.xml
+15
-0
Dockerfile
...-provider/ibzdisk-provider-api/src/main/docker/Dockerfile
+3
-3
apiSecurityConfig.java
...rc/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
+4
-1
SDFileResource.java
...api/src/main/java/cn/ibizlab/api/rest/SDFileResource.java
+14
-14
IBZConfig.java
...-util/src/main/java/cn/ibizlab/util/domain/IBZConfig.java
+78
-0
IBZConfigMapper.java
...src/main/java/cn/ibizlab/util/mapper/IBZConfigMapper.java
+8
-0
AppController.java
...til/src/main/java/cn/ibizlab/util/rest/AppController.java
+31
-7
IBZConfigService.java
...c/main/java/cn/ibizlab/util/service/IBZConfigService.java
+58
-0
application-sys.yml
ibzdisk-util/src/main/resources/application-sys.yml
+13
-0
未找到文件。
app_web/CHANGELOG.md
浏览文件 @
8de67fcc
## v7.0.0-alpha.7 [2020-5-28]
### Bug修复
修复门户部件flex布局
修复表格选择框列样式出现省略号
修复批删除传递参数调整
修复表单上界面行为参数传递bug
修复分页导航、编辑类视图标题
修复界面行为多主键分隔符由";"改为","
修复导航类视图宽度格式
修复图表排序
修复关系界面逻辑
修复401跳登录页清除user和token
### 功能新增及优化
#### 模板
列表,数据视图默认排序
面板项支持偏移
应用支持自定义默认端口
门户部件图标和容器样式
表格列头图片和头部样式
表格操作列图标
表格编辑项值规则
增加树选择双击事件
增加图表分组属性计数统计(srfcount)
增加雷达图支持
#### 基础文件
修复分页导航、编辑类视图标题
修复界面行为多主键分隔符由";"改为","
修复关系界面逻辑
修复401跳登录页清除user和token
## v7.0.0-alpha.6 [2020-5-23]
### Bug修复
...
...
app_web/src/components/context-menu/context-menu.less
浏览文件 @
8de67fcc
.context-menu-container {
// width: 100vw;
// height: 100vh;
// z-index: -10000;
// position: absolute;
// top: 0;
// left: 0;
line-height: 1;
// width: 100vw;
// height: 100vh;
// z-index: -10000;
// position: absolute;
// top: 0;
// left: 0;
// line-height: 1;
z-index: 10001;
.context-menu-content {
z-index: 10001;
position: absolute;
background: #FFF;
// border: 1px solid #e3e3e3;
}
.context-menu-content {
position: absolute;
background: #FFF;
// border: 1px solid #e3e3e3;
.ivu-divider{
width: 100%;
}
.context-menus {
}
.context-menus-item {
list-style: none;
line-height: 36px;
padding: 0 13px;
margin: 0;
font-size: 14px;
color: #606266;
cursor: pointer;
outline: none;
display: flex;
.icon {
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
width: 20px;
margin-right: 8px;
}
}
.context-menus-item:hover {
background-color: #ecf5ff;
color: #66b1ff;
}
}
.context-menus {
.context-menus-item {
list-style: none;
line-height: 36px;
padding: 0 13px;
margin: 0;
font-size: 14px;
color: #606266;
cursor: pointer;
outline: none;
display: flex;
.icon {
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
width: 20px;
margin-right: 8px;
}
}
.context-menus-item:hover {
background-color: #ecf5ff;
color: #66b1ff;
}
}
}
.context-menu {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
\ No newline at end of file
app_web/src/styles/default.less
浏览文件 @
8de67fcc
...
...
@@ -207,7 +207,7 @@
}
}
.view-container.degridview, .view-container.degridview9, .view-container.dewfgridview{
.view-container.degridview, .view-container.degridview9, .view-container.dewfgridview
, .view-container.delistview, .view-container.delistview9, .view-container.dedataview, .view-container.dedataview9
{
>.view-card.view-no-caption{
>.ivu-card-body{
height: 100%;
...
...
app_web/src/utils/interceptor/interceptor.ts
浏览文件 @
8de67fcc
...
...
@@ -125,6 +125,13 @@ export class Interceptors {
* @memberof Interceptors
*/
private
doNoLogin
(
data
:
any
=
{}):
void
{
// 清除user和token
if
(
localStorage
.
getItem
(
'user'
)){
localStorage
.
removeItem
(
'user'
);
}
if
(
localStorage
.
getItem
(
'token'
)){
localStorage
.
removeItem
(
'token'
);
}
if
(
data
.
loginurl
&&
!
Object
.
is
(
data
.
loginurl
,
''
)
&&
data
.
originurl
&&
!
Object
.
is
(
data
.
originurl
,
''
))
{
let
_url
=
encodeURIComponent
(
encodeURIComponent
(
window
.
location
.
href
));
let
loginurl
:
string
=
data
.
loginurl
;
...
...
ibzdisk-app/ibzdisk-app-web/src/main/docker/Dockerfile
浏览文件 @
8de67fcc
...
...
@@ -2,11 +2,11 @@
FROM
openjdk:8-jre-alpine
ENV
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
IBZ_SLEEP=0 \
IB
I
Z_SLEEP=0 \
JAVA_OPTS=""
CMD
echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
CMD
echo "The application will start in ${IB
I
Z_SLEEP}s..." && \
sleep ${IB
I
Z_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzdisk-app-web.jar
EXPOSE
8080
...
...
ibzdisk-boot/src/main/java/cn/ibizlab/config/DevBootSecurityConfig.java
浏览文件 @
8de67fcc
...
...
@@ -101,7 +101,10 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
"/**/fonts/**"
,
"/**/js/**"
,
"/**/img/**"
,
"/"
"/"
,
"webjars/**"
,
"/swagger-resources/**"
,
"/v2/**"
).
permitAll
()
//放行登录请求
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
...
...
ibzdisk-core/src/main/java/cn/ibizlab/core/util/config/XxlJobConfig.java
0 → 100644
浏览文件 @
8de67fcc
package
cn
.
ibizlab
.
core
.
util
.
config
;
import
com.xxl.job.core.executor.impl.XxlJobSpringExecutor
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.StringUtils
;
/**
* xxl-job config
* 分布式任务调度平台XXL-JOB配置加载
* @author xuxueli 2017-04-28
*/
@Configuration
public
class
XxlJobConfig
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
XxlJobConfig
.
class
);
@Value
(
"${xxl.job.admin.addresses:}"
)
private
String
adminAddresses
;
@Value
(
"${xxl.job.accessToken:}"
)
private
String
accessToken
;
@Value
(
"${xxl.job.executor.appname:ibzdisk}"
)
private
String
appName
;
@Value
(
"${xxl.job.executor.ip:127.0.0.1}"
)
private
String
ip
;
@Value
(
"${xxl.job.executor.port:9999}"
)
private
int
port
;
@Value
(
"${xxl.job.executor.logpath:/app/joblog}"
)
private
String
logPath
;
@Value
(
"${xxl.job.executor.logretentiondays:-1}"
)
private
int
logRetentionDays
;
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"destroy"
)
public
XxlJobSpringExecutor
xxlJobExecutor
()
{
if
(!
StringUtils
.
isEmpty
(
adminAddresses
)){
logger
.
info
(
">>>>>>>>>>> xxl-job config init."
);
logger
.
info
(
">>>>>>>>>>> adminAddresses:"
+
adminAddresses
);
logger
.
info
(
">>>>>>>>>>> appName:"
+
appName
);
logger
.
info
(
">>>>>>>>>>> ip:"
+
ip
);
logger
.
info
(
">>>>>>>>>>> port:"
+
port
);
XxlJobSpringExecutor
xxlJobSpringExecutor
=
new
XxlJobSpringExecutor
();
xxlJobSpringExecutor
.
setAdminAddresses
(
adminAddresses
);
xxlJobSpringExecutor
.
setAppName
(
appName
);
xxlJobSpringExecutor
.
setIp
(
ip
);
xxlJobSpringExecutor
.
setPort
(
port
);
xxlJobSpringExecutor
.
setAccessToken
(
accessToken
);
xxlJobSpringExecutor
.
setLogPath
(
logPath
);
xxlJobSpringExecutor
.
setLogRetentionDays
(
logRetentionDays
);
return
xxlJobSpringExecutor
;
}
logger
.
info
(
">>>>>>>>>>> xxl-job config not init."
);
return
null
;
}
/**
* 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
*
* 1、引入依赖:
* <dependency>
* <groupId>org.springframework.cloud</groupId>
* <artifactId>spring-cloud-commons</artifactId>
* <version>${version}"</version>
* </dependency>
*
* 2、配置文件,或者容器启动变量
* spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
*
* 3、获取IP
* String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
*/
}
ibzdisk-dependencies/pom.xml
浏览文件 @
8de67fcc
...
...
@@ -74,6 +74,9 @@
<!--httpClient -->
<openfeign-httpclient.version>
11.0
</openfeign-httpclient.version>
<!--xxl-job定时服务 -->
<xxl-job.version>
2.1.0
</xxl-job.version>
</properties>
<dependencyManagement>
...
...
@@ -249,6 +252,12 @@
<version>
${openfeign-httpclient.version}
</version>
</dependency>
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<version>
${xxl-job.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
@@ -308,6 +317,12 @@
<artifactId>
h2
</artifactId>
</dependency>
<!--xxl-job定时服务 -->
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
</dependency>
<!-- Error -->
<!-- Security -->
...
...
ibzdisk-provider/ibzdisk-provider-api/src/main/docker/Dockerfile
浏览文件 @
8de67fcc
...
...
@@ -2,11 +2,11 @@
FROM
openjdk:8-jre-alpine
ENV
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
IBZ_SLEEP=0 \
IB
I
Z_SLEEP=0 \
JAVA_OPTS=""
CMD
echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \
CMD
echo "The application will start in ${IB
I
Z_SLEEP}s..." && \
sleep ${IB
I
Z_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzdisk-provider-api.jar
EXPOSE
8081
...
...
ibzdisk-provider/ibzdisk-provider-api/src/main/java/cn/ibizlab/api/config/apiSecurityConfig.java
浏览文件 @
8de67fcc
...
...
@@ -106,7 +106,10 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
"/**/fonts/**"
,
"/**/js/**"
,
"/**/img/**"
,
"/"
"/"
,
"webjars/**"
,
"/swagger-resources/**"
,
"/v2/**"
).
permitAll
()
//放行登录请求
.
antMatchers
(
HttpMethod
.
POST
,
"/"
+
loginPath
).
permitAll
()
...
...
ibzdisk-provider/ibzdisk-provider-api/src/main/java/cn/ibizlab/api/rest/SDFileResource.java
浏览文件 @
8de67fcc
...
...
@@ -34,7 +34,7 @@ import cn.ibizlab.core.disk.service.ISDFileService;
import
cn.ibizlab.core.disk.filter.SDFileSearchContext
;
@Slf4j
@Api
(
tags
=
{
"
SDFile
"
})
@Api
(
tags
=
{
"
文件
"
})
@RestController
(
"api-sdfile"
)
@RequestMapping
(
""
)
public
class
SDFileResource
{
...
...
@@ -47,7 +47,7 @@ public class SDFileResource {
public
SDFileMapping
sdfileMapping
;
@PreAuthorize
(
"hasPermission(this.sdfileService.get(#sdfile_id),'ibzdisk-SDFile-Update')"
)
@ApiOperation
(
value
=
"
Update"
,
tags
=
{
"SDFile"
},
notes
=
"Update
"
)
@ApiOperation
(
value
=
"
更新文件"
,
tags
=
{
"文件"
},
notes
=
"更新文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sdfiles/{sdfile_id}"
)
@Transactional
public
ResponseEntity
<
SDFileDTO
>
update
(
@PathVariable
(
"sdfile_id"
)
String
sdfile_id
,
@RequestBody
SDFileDTO
sdfiledto
)
{
...
...
@@ -59,7 +59,7 @@ public class SDFileResource {
}
@PreAuthorize
(
"hasPermission(this.sdfileService.getSdfileByEntities(this.sdfileMapping.toDomain(#sdfiledtos)),'ibzdisk-SDFile-Update')"
)
@ApiOperation
(
value
=
"
UpdateBatch"
,
tags
=
{
"SDFile"
},
notes
=
"UpdateBatch
"
)
@ApiOperation
(
value
=
"
批量更新文件"
,
tags
=
{
"文件"
},
notes
=
"批量更新文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sdfiles/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SDFileDTO
>
sdfiledtos
)
{
sdfileService
.
updateBatch
(
sdfileMapping
.
toDomain
(
sdfiledtos
));
...
...
@@ -67,7 +67,7 @@ public class SDFileResource {
}
@PreAuthorize
(
"hasPermission(this.sdfileMapping.toDomain(#sdfiledto),'ibzdisk-SDFile-Create')"
)
@ApiOperation
(
value
=
"
Create"
,
tags
=
{
"SDFile"
},
notes
=
"Create
"
)
@ApiOperation
(
value
=
"
新建文件"
,
tags
=
{
"文件"
},
notes
=
"新建文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sdfiles"
)
@Transactional
public
ResponseEntity
<
SDFileDTO
>
create
(
@RequestBody
SDFileDTO
sdfiledto
)
{
...
...
@@ -78,27 +78,27 @@ public class SDFileResource {
}
@PreAuthorize
(
"hasPermission(this.sdfileMapping.toDomain(#sdfiledtos),'ibzdisk-SDFile-Create')"
)
@ApiOperation
(
value
=
"
createBatch"
,
tags
=
{
"SDFile"
},
notes
=
"createBatch
"
)
@ApiOperation
(
value
=
"
批量新建文件"
,
tags
=
{
"文件"
},
notes
=
"批量新建文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sdfiles/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SDFileDTO
>
sdfiledtos
)
{
sdfileService
.
createBatch
(
sdfileMapping
.
toDomain
(
sdfiledtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"
CheckKey"
,
tags
=
{
"SDFile"
},
notes
=
"CheckKey
"
)
@ApiOperation
(
value
=
"
检查文件"
,
tags
=
{
"文件"
},
notes
=
"检查文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sdfiles/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SDFileDTO
sdfiledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sdfileService
.
checkKey
(
sdfileMapping
.
toDomain
(
sdfiledto
)));
}
@ApiOperation
(
value
=
"
GetDraft"
,
tags
=
{
"SDFile"
},
notes
=
"GetDraft
"
)
@ApiOperation
(
value
=
"
获取文件草稿"
,
tags
=
{
"文件"
},
notes
=
"获取文件草稿
"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sdfiles/getdraft"
)
public
ResponseEntity
<
SDFileDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sdfileMapping
.
toDto
(
sdfileService
.
getDraft
(
new
SDFile
())));
}
@PostAuthorize
(
"hasPermission(this.sdfileMapping.toDomain(returnObject.body),'ibzdisk-SDFile-Get')"
)
@ApiOperation
(
value
=
"
Get"
,
tags
=
{
"SDFile"
},
notes
=
"Get
"
)
@ApiOperation
(
value
=
"
获取文件"
,
tags
=
{
"文件"
},
notes
=
"获取文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sdfiles/{sdfile_id}"
)
public
ResponseEntity
<
SDFileDTO
>
get
(
@PathVariable
(
"sdfile_id"
)
String
sdfile_id
)
{
SDFile
domain
=
sdfileService
.
get
(
sdfile_id
);
...
...
@@ -107,7 +107,7 @@ public class SDFileResource {
}
@PreAuthorize
(
"hasPermission(this.sdfileService.get(#sdfile_id),'ibzdisk-SDFile-Remove')"
)
@ApiOperation
(
value
=
"
Remove"
,
tags
=
{
"SDFile"
},
notes
=
"Remove
"
)
@ApiOperation
(
value
=
"
删除文件"
,
tags
=
{
"文件"
},
notes
=
"删除文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sdfiles/{sdfile_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sdfile_id"
)
String
sdfile_id
)
{
...
...
@@ -115,7 +115,7 @@ public class SDFileResource {
}
@PreAuthorize
(
"hasPermission(this.sdfileService.getSdfileByIds(#ids),'ibzdisk-SDFile-Remove')"
)
@ApiOperation
(
value
=
"
RemoveBatch"
,
tags
=
{
"SDFile"
},
notes
=
"RemoveBatch
"
)
@ApiOperation
(
value
=
"
批量删除文件"
,
tags
=
{
"文件"
},
notes
=
"批量删除文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sdfiles/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sdfileService
.
removeBatch
(
ids
);
...
...
@@ -123,14 +123,14 @@ public class SDFileResource {
}
@PreAuthorize
(
"hasPermission(this.sdfileMapping.toDomain(#sdfiledto),'ibzdisk-SDFile-Save')"
)
@ApiOperation
(
value
=
"
Save"
,
tags
=
{
"SDFile"
},
notes
=
"Save
"
)
@ApiOperation
(
value
=
"
保存文件"
,
tags
=
{
"文件"
},
notes
=
"保存文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sdfiles/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SDFileDTO
sdfiledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sdfileService
.
save
(
sdfileMapping
.
toDomain
(
sdfiledto
)));
}
@PreAuthorize
(
"hasPermission(this.sdfileMapping.toDomain(#sdfiledtos),'ibzdisk-SDFile-Save')"
)
@ApiOperation
(
value
=
"
SaveBatch"
,
tags
=
{
"SDFile"
},
notes
=
"SaveBatch
"
)
@ApiOperation
(
value
=
"
批量保存文件"
,
tags
=
{
"文件"
},
notes
=
"批量保存文件
"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sdfiles/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SDFileDTO
>
sdfiledtos
)
{
sdfileService
.
saveBatch
(
sdfileMapping
.
toDomain
(
sdfiledtos
));
...
...
@@ -138,7 +138,7 @@ public class SDFileResource {
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-SDFile-Default-all')"
)
@ApiOperation
(
value
=
"
fetchDEFAULT"
,
tags
=
{
"SDFile"
}
,
notes
=
"fetch
DEFAULT"
)
@ApiOperation
(
value
=
"
获取DEFAULT"
,
tags
=
{
"文件"
}
,
notes
=
"获取
DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sdfiles/fetchdefault"
)
public
ResponseEntity
<
List
<
SDFileDTO
>>
fetchDefault
(
SDFileSearchContext
context
)
{
Page
<
SDFile
>
domains
=
sdfileService
.
searchDefault
(
context
)
;
...
...
@@ -151,7 +151,7 @@ public class SDFileResource {
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdisk-SDFile-Default-all')"
)
@ApiOperation
(
value
=
"
searchDEFAULT"
,
tags
=
{
"SDFile"
}
,
notes
=
"search
DEFAULT"
)
@ApiOperation
(
value
=
"
查询DEFAULT"
,
tags
=
{
"文件"
}
,
notes
=
"查询
DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sdfiles/searchdefault"
)
public
ResponseEntity
<
Page
<
SDFileDTO
>>
searchDefault
(
@RequestBody
SDFileSearchContext
context
)
{
Page
<
SDFile
>
domains
=
sdfileService
.
searchDefault
(
context
)
;
...
...
ibzdisk-util/src/main/java/cn/ibizlab/util/domain/IBZConfig.java
0 → 100644
浏览文件 @
8de67fcc
package
cn
.
ibizlab
.
util
.
domain
;
import
cn.ibizlab.util.helper.DataObject
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.*
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.StringUtils
;
import
java.sql.Timestamp
;
@TableName
(
value
=
"IBZCFG"
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
IBZConfig
{
/**
* 配置标识
* 系统+配置类型+引用对象+用户标识联合主键
*/
@TableId
private
String
cfgId
;
/**
* 系统标识
*/
private
String
systemId
;
/**
* 配置类型
* 门户配置/表格自定义配置/自定义查询...消费方自定义
*/
private
String
cfgType
;
/**
* 引用对象
* 门户页标识/具体表格视图标识...消费方具体使用位置的标识
*/
private
String
targetType
;
/**
* 用户标识
* 默认当前登录者
*/
private
String
userId
;
/**
* 配置
* JSONObject
*/
private
String
cfg
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Timestamp
updateDate
;
public
String
getCfgId
()
{
if
(
StringUtils
.
isEmpty
(
cfgId
)&&
(!(
StringUtils
.
isEmpty
(
systemId
)))&&
(!(
StringUtils
.
isEmpty
(
cfgType
)))&&
(!(
StringUtils
.
isEmpty
(
targetType
)))&&
(!(
StringUtils
.
isEmpty
(
userId
))))
{
cfgId
=
DigestUtils
.
md5DigestAsHex
((
systemId
+
"||"
+
cfgType
+
"||"
+
targetType
+
"||"
+
userId
).
getBytes
());
}
return
cfgId
;
}
}
ibzdisk-util/src/main/java/cn/ibizlab/util/mapper/IBZConfigMapper.java
0 → 100644
浏览文件 @
8de67fcc
package
cn
.
ibizlab
.
util
.
mapper
;
import
cn.ibizlab.util.domain.IBZConfig
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
public
interface
IBZConfigMapper
extends
BaseMapper
<
IBZConfig
>{
}
\ No newline at end of file
ibzdisk-util/src/main/java/cn/ibizlab/util/rest/AppController.java
浏览文件 @
8de67fcc
package
cn
.
ibizlab
.
util
.
rest
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.service.IBZConfigService
;
import
com.alibaba.fastjson.JSONObject
;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
cn.ibizlab.util.service.AuthenticationUserService
;
...
...
@@ -8,9 +10,8 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Collection
;
import
java.util.HashSet
;
import
java.util.Iterator
;
...
...
@@ -23,6 +24,10 @@ public class AppController {
@Value
(
"${ibiz.enablePermissionValid:false}"
)
boolean
enablePermissionValid
;
//是否开启权限校验
@Value
(
"${ibiz.systemid:ibzdisk}"
)
private
String
systemId
;
@Autowired
private
AuthenticationUserService
userDetailsService
;
...
...
@@ -39,10 +44,10 @@ public class AppController {
while
(
it
.
hasNext
())
{
GrantedAuthority
authority
=
(
GrantedAuthority
)
it
.
next
();
String
strAuthority
=
authority
.
getAuthority
();
if
(
strAuthority
.
startsWith
(
"UNIRES
"
))
uniRes
.
add
(
strAuthority
);
else
if
(
strAuthority
.
startsWith
(
"APPMENU
"
))
appMenu
.
add
(
strAuthority
);
if
(
strAuthority
.
startsWith
(
"UNIRES
_"
+
systemId
))
uniRes
.
add
(
strAuthority
.
substring
(
systemId
.
length
()+
8
)
);
else
if
(
strAuthority
.
startsWith
(
"APPMENU
_"
+
systemId
))
appMenu
.
add
(
strAuthority
.
substring
(
systemId
.
length
()+
9
)
);
}
}
appData
.
put
(
"unires"
,
uniRes
);
...
...
@@ -57,4 +62,23 @@ public class AppController {
userDetailsService
.
resetByUsername
(
AuthenticationUser
.
getAuthenticationUser
().
getUsername
());
}
}
@Autowired
private
IBZConfigService
ibzConfigService
;
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/configs/{configType}/{targetType}"
)
public
ResponseEntity
<
Boolean
>
saveConfig
(
@PathVariable
(
"configType"
)
String
configType
,
@PathVariable
(
"targetType"
)
String
targetType
,
@RequestBody
JSONObject
config
)
{
String
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
))
throw
new
BadRequestAlertException
(
"保存配置失败,参数缺失"
,
"IBZConfig"
,
configType
);
return
ResponseEntity
.
ok
(
ibzConfigService
.
saveConfig
(
configType
,
targetType
,
userId
,
config
));
}
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/configs/{configType}/{targetType}"
)
public
ResponseEntity
<
JSONObject
>
getConfig
(
@PathVariable
(
"configType"
)
String
configType
,
@PathVariable
(
"targetType"
)
String
targetType
)
{
String
userId
=
AuthenticationUser
.
getAuthenticationUser
().
getUserid
();
if
(
StringUtils
.
isEmpty
(
userId
))
throw
new
BadRequestAlertException
(
"获取配置失败,参数缺失"
,
"IBZConfig"
,
configType
);
return
ResponseEntity
.
ok
(
ibzConfigService
.
getConfig
(
configType
,
targetType
,
userId
));
}
}
ibzdisk-util/src/main/java/cn/ibizlab/util/service/IBZConfigService.java
0 → 100644
浏览文件 @
8de67fcc
package
cn
.
ibizlab
.
util
.
service
;
import
cn.ibizlab.util.domain.IBZConfig
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
cn.ibizlab.util.helper.DataObject
;
import
cn.ibizlab.util.mapper.IBZConfigMapper
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
@Slf4j
@Service
public
class
IBZConfigService
extends
ServiceImpl
<
IBZConfigMapper
,
IBZConfig
>
implements
IService
<
IBZConfig
>
{
@Value
(
"${ibiz.systemid:ibzdisk}"
)
private
String
systemId
;
@Cacheable
(
value
=
"ibzou_configs"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
public
JSONObject
getConfig
(
String
cfgType
,
String
targetType
,
String
userId
)
{
if
(
StringUtils
.
isEmpty
(
userId
)||
StringUtils
.
isEmpty
(
cfgType
)||
StringUtils
.
isEmpty
(
targetType
))
throw
new
BadRequestAlertException
(
"获取配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
IBZConfig
config
=
this
.
getOne
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
build
()),
false
);
if
(
config
==
null
)
return
new
JSONObject
();
else
return
JSON
.
parseObject
(
config
.
getCfg
());
}
@CacheEvict
(
value
=
"ibzou_configs"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
public
boolean
saveConfig
(
String
cfgType
,
String
targetType
,
String
userId
,
JSONObject
config
)
{
if
(
StringUtils
.
isEmpty
(
userId
)||
StringUtils
.
isEmpty
(
cfgType
)||
StringUtils
.
isEmpty
(
targetType
))
throw
new
BadRequestAlertException
(
"保存配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
String
cfg
=
"{}"
;
if
(
config
!=
null
)
cfg
=
JSONObject
.
toJSONString
(
config
);
return
this
.
saveOrUpdate
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
cfg
(
cfg
).
updateDate
(
DataObject
.
getNow
()).
build
());
}
@CacheEvict
(
value
=
"ibzou_configs"
,
key
=
"'cfgid:'+#p0+'||'+#p1+'||'+#p2"
)
public
void
resetConfig
(
String
cfgType
,
String
targetType
,
String
userId
)
{
if
(
StringUtils
.
isEmpty
(
userId
)||
StringUtils
.
isEmpty
(
cfgType
)||
StringUtils
.
isEmpty
(
targetType
))
throw
new
BadRequestAlertException
(
"重置配置失败,参数缺失"
,
"IBZConfig"
,
cfgType
);
this
.
remove
(
Wrappers
.
query
(
IBZConfig
.
builder
().
systemId
(
systemId
).
cfgType
(
cfgType
).
targetType
(
targetType
).
userId
(
userId
).
build
()));
}
}
\ No newline at end of file
ibzdisk-util/src/main/resources/application-sys.yml
浏览文件 @
8de67fcc
...
...
@@ -85,3 +85,16 @@ ibiz:
enablePermissionValid
:
true
cacheLevel
:
L1
#(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
#xxl-job定时服务
xxl
:
job
:
accessToken
:
admin
:
addresses
:
#127.0.0.1
executor
:
appname
:
ibzdisk
ip
:
port
:
9999
logpath
:
/app/joblog
logretentiondays
:
-1
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录