Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdisk
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdisk
提交
a82ebfae
提交
a82ebfae
编写于
2月 25, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码 [ibz-disk,存储]
上级
321c2b10
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
70 行增加
和
8 行删除
+70
-8
SDFile.java
...ore/src/main/java/cn/ibizlab/core/disk/domain/SDFile.java
+17
-0
SDFileDTO.java
...vider-api/src/main/java/cn/ibizlab/api/dto/SDFileDTO.java
+17
-0
DEFieldDefaultValueAspect.java
...ava/cn/ibizlab/util/aspect/DEFieldDefaultValueAspect.java
+14
-4
IBZUAAFallback.java
.../src/main/java/cn/ibizlab/util/client/IBZUAAFallback.java
+1
-0
IBZUAAFeignClient.java
...c/main/java/cn/ibizlab/util/client/IBZUAAFeignClient.java
+1
-0
AuthenticationUser.java
...ain/java/cn/ibizlab/util/security/AuthenticationUser.java
+10
-0
FeignRequestInterceptor.java
...ain/java/cn/ibizlab/util/web/FeignRequestInterceptor.java
+10
-4
未找到文件。
ibzdisk-core/src/main/java/cn/ibizlab/core/disk/domain/SDFile.java
浏览文件 @
a82ebfae
...
...
@@ -24,6 +24,8 @@ import java.io.Serializable;
import
lombok.*
;
import
org.springframework.data.annotation.Transient
;
import
cn.ibizlab.util.annotation.Audit
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
...
...
@@ -39,6 +41,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@NoArgsConstructor
@JsonIgnoreProperties
(
value
=
"handler"
)
@TableName
(
value
=
"IBZFILE"
,
resultMap
=
"SDFileResultMap"
)
@ApiModel
(
"文件"
)
public
class
SDFile
extends
EntityMP
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -50,6 +53,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableId
(
value
=
"fileid"
,
type
=
IdType
.
ASSIGN_UUID
)
@JSONField
(
name
=
"id"
)
@JsonProperty
(
"id"
)
@ApiModelProperty
(
"标识"
)
private
String
id
;
/**
* 名称
...
...
@@ -58,6 +62,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"filename"
)
@JSONField
(
name
=
"name"
)
@JsonProperty
(
"name"
)
@ApiModelProperty
(
"名称"
)
private
String
name
;
/**
* 路径
...
...
@@ -65,6 +70,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"filepath"
)
@JSONField
(
name
=
"file_path"
)
@JsonProperty
(
"file_path"
)
@ApiModelProperty
(
"路径"
)
private
String
filePath
;
/**
* 特定目录
...
...
@@ -72,6 +78,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"folder"
)
@JSONField
(
name
=
"folder"
)
@JsonProperty
(
"folder"
)
@ApiModelProperty
(
"特定目录"
)
private
String
folder
;
/**
* 文件大小
...
...
@@ -79,6 +86,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"filesize"
)
@JSONField
(
name
=
"file_size"
)
@JsonProperty
(
"file_size"
)
@ApiModelProperty
(
"文件大小"
)
private
Integer
fileSize
;
/**
* 扩展名
...
...
@@ -87,6 +95,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"fileext"
)
@JSONField
(
name
=
"extension"
)
@JsonProperty
(
"extension"
)
@ApiModelProperty
(
"扩展名"
)
private
String
extension
;
/**
* 所属类型
...
...
@@ -94,6 +103,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"ownertype"
)
@JSONField
(
name
=
"owner_type"
)
@JsonProperty
(
"owner_type"
)
@ApiModelProperty
(
"所属类型"
)
private
String
ownerType
;
/**
* 所属主体
...
...
@@ -101,6 +111,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"ownerid"
)
@JSONField
(
name
=
"owner_id"
)
@JsonProperty
(
"owner_id"
)
@ApiModelProperty
(
"所属主体"
)
private
String
ownerId
;
/**
* 备注
...
...
@@ -108,6 +119,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"memo"
)
@JSONField
(
name
=
"memo"
)
@JsonProperty
(
"memo"
)
@ApiModelProperty
(
"备注"
)
private
String
memo
;
/**
* 签名
...
...
@@ -115,6 +127,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"digestcode"
)
@JSONField
(
name
=
"digest_code"
)
@JsonProperty
(
"digest_code"
)
@ApiModelProperty
(
"签名"
)
private
String
digestCode
;
/**
* 创建人
...
...
@@ -123,6 +136,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"createman"
,
fill
=
FieldFill
.
INSERT
)
@JSONField
(
name
=
"createman"
)
@JsonProperty
(
"createman"
)
@ApiModelProperty
(
"创建人"
)
private
String
createman
;
/**
* 创建日期
...
...
@@ -132,6 +146,7 @@ public class SDFile extends EntityMP implements Serializable {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
@ApiModelProperty
(
"创建日期"
)
private
Timestamp
createdate
;
/**
* 更新人
...
...
@@ -140,6 +155,7 @@ public class SDFile extends EntityMP implements Serializable {
@TableField
(
value
=
"updateman"
)
@JSONField
(
name
=
"updateman"
)
@JsonProperty
(
"updateman"
)
@ApiModelProperty
(
"更新人"
)
private
String
updateman
;
/**
* 更新时间
...
...
@@ -149,6 +165,7 @@ public class SDFile extends EntityMP implements Serializable {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
@ApiModelProperty
(
"更新时间"
)
private
Timestamp
updatedate
;
...
...
ibzdisk-provider/ibzdisk-provider-api/src/main/java/cn/ibizlab/api/dto/SDFileDTO.java
浏览文件 @
a82ebfae
...
...
@@ -20,11 +20,14 @@ import javax.validation.constraints.Size;
import
cn.ibizlab.util.domain.DTOBase
;
import
cn.ibizlab.util.domain.DTOClient
;
import
lombok.Data
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 服务DTO对象[SDFileDTO]
*/
@Data
@ApiModel
(
"文件"
)
public
class
SDFileDTO
extends
DTOBase
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -36,6 +39,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"id"
)
@JsonProperty
(
"id"
)
@Size
(
min
=
0
,
max
=
100
,
message
=
"内容长度必须小于等于[100]"
)
@ApiModelProperty
(
"标识"
)
private
String
id
;
/**
...
...
@@ -45,6 +49,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"name"
)
@JsonProperty
(
"name"
)
@Size
(
min
=
0
,
max
=
200
,
message
=
"内容长度必须小于等于[200]"
)
@ApiModelProperty
(
"名称"
)
private
String
name
;
/**
...
...
@@ -54,6 +59,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"file_path"
)
@JsonProperty
(
"file_path"
)
@Size
(
min
=
0
,
max
=
500
,
message
=
"内容长度必须小于等于[500]"
)
@ApiModelProperty
(
"路径"
)
private
String
filePath
;
/**
...
...
@@ -63,6 +69,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"folder"
)
@JsonProperty
(
"folder"
)
@Size
(
min
=
0
,
max
=
40
,
message
=
"内容长度必须小于等于[40]"
)
@ApiModelProperty
(
"特定目录"
)
private
String
folder
;
/**
...
...
@@ -71,6 +78,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
*/
@JSONField
(
name
=
"file_size"
)
@JsonProperty
(
"file_size"
)
@ApiModelProperty
(
"文件大小"
)
private
Integer
fileSize
;
/**
...
...
@@ -80,6 +88,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"extension"
)
@JsonProperty
(
"extension"
)
@Size
(
min
=
0
,
max
=
20
,
message
=
"内容长度必须小于等于[20]"
)
@ApiModelProperty
(
"扩展名"
)
private
String
extension
;
/**
...
...
@@ -89,6 +98,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"owner_type"
)
@JsonProperty
(
"owner_type"
)
@Size
(
min
=
0
,
max
=
100
,
message
=
"内容长度必须小于等于[100]"
)
@ApiModelProperty
(
"所属类型"
)
private
String
ownerType
;
/**
...
...
@@ -98,6 +108,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"owner_id"
)
@JsonProperty
(
"owner_id"
)
@Size
(
min
=
0
,
max
=
100
,
message
=
"内容长度必须小于等于[100]"
)
@ApiModelProperty
(
"所属主体"
)
private
String
ownerId
;
/**
...
...
@@ -107,6 +118,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"memo"
)
@JsonProperty
(
"memo"
)
@Size
(
min
=
0
,
max
=
500
,
message
=
"内容长度必须小于等于[500]"
)
@ApiModelProperty
(
"备注"
)
private
String
memo
;
/**
...
...
@@ -116,6 +128,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"digest_code"
)
@JsonProperty
(
"digest_code"
)
@Size
(
min
=
0
,
max
=
64
,
message
=
"内容长度必须小于等于[64]"
)
@ApiModelProperty
(
"签名"
)
private
String
digestCode
;
/**
...
...
@@ -125,6 +138,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"createman"
)
@JsonProperty
(
"createman"
)
@Size
(
min
=
0
,
max
=
100
,
message
=
"内容长度必须小于等于[100]"
)
@ApiModelProperty
(
"创建人"
)
private
String
createman
;
/**
...
...
@@ -134,6 +148,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
@ApiModelProperty
(
"创建日期"
)
private
Timestamp
createdate
;
/**
...
...
@@ -143,6 +158,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JSONField
(
name
=
"updateman"
)
@JsonProperty
(
"updateman"
)
@Size
(
min
=
0
,
max
=
100
,
message
=
"内容长度必须小于等于[100]"
)
@ApiModelProperty
(
"更新人"
)
private
String
updateman
;
/**
...
...
@@ -152,6 +168,7 @@ public class SDFileDTO extends DTOBase implements Serializable {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
@ApiModelProperty
(
"更新时间"
)
private
Timestamp
updatedate
;
...
...
ibzdisk-util/src/main/java/cn/ibizlab/util/aspect/DEFieldDefaultValueAspect.java
浏览文件 @
a82ebfae
...
...
@@ -27,6 +27,16 @@ import java.util.Map;
@Component
public
class
DEFieldDefaultValueAspect
{
/**
* 操作用户标识
*/
final
static
String
TAG_PERSONID
=
"SRF_PERSONID"
;
/**
* 操作用户名称
*/
final
static
String
TAG_PERSONNAME
=
"SRF_PERSONNAME"
;
/**
* 新建数据切入点
* @param point
...
...
@@ -221,16 +231,16 @@ public class DEFieldDefaultValueAspect
switch
(
preFieldType
)
{
case
CREATEMAN:
et
.
set
(
fieldname
,
curUser
.
getUserid
());
et
.
set
(
fieldname
,
StringUtils
.
isEmpty
(
curUser
.
getUserid
())
?
et
.
get
(
TAG_PERSONID
)
:
curUser
.
getUserid
());
break
;
case
CREATEMANNAME:
et
.
set
(
fieldname
,
curUser
.
getPersonname
());
et
.
set
(
fieldname
,
StringUtils
.
isEmpty
(
curUser
.
getPersonname
())
?
et
.
get
(
TAG_PERSONNAME
)
:
curUser
.
getPersonname
());
break
;
case
UPDATEMAN:
et
.
set
(
fieldname
,
curUser
.
getUserid
());
et
.
set
(
fieldname
,
StringUtils
.
isEmpty
(
curUser
.
getUserid
())
?
et
.
get
(
TAG_PERSONID
)
:
curUser
.
getUserid
());
break
;
case
UPDATEMANNAME:
et
.
set
(
fieldname
,
curUser
.
getPersonname
());
et
.
set
(
fieldname
,
StringUtils
.
isEmpty
(
curUser
.
getPersonname
())
?
et
.
get
(
TAG_PERSONNAME
)
:
curUser
.
getPersonname
());
break
;
case
CREATEDATE:
et
.
set
(
fieldname
,
new
Timestamp
(
new
Date
().
getTime
()));
...
...
ibzdisk-util/src/main/java/cn/ibizlab/util/client/IBZUAAFallback.java
浏览文件 @
a82ebfae
...
...
@@ -2,6 +2,7 @@ package cn.ibizlab.util.client;
import
cn.ibizlab.util.security.AuthenticationUser
;
import
cn.ibizlab.util.security.AuthorizationLogin
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSONObject
;
...
...
ibzdisk-util/src/main/java/cn/ibizlab/util/client/IBZUAAFeignClient.java
浏览文件 @
a82ebfae
...
...
@@ -5,6 +5,7 @@ import cn.ibizlab.util.security.AuthorizationLogin;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.util.MultiValueMap
;
import
com.alibaba.fastjson.JSONObject
;
@FeignClient
(
value
=
"${ibiz.ref.service.uaa:ibzuaa-api}"
,
contextId
=
"uaa"
,
fallback
=
IBZUAAFallback
.
class
)
...
...
ibzdisk-util/src/main/java/cn/ibizlab/util/security/AuthenticationUser.java
浏览文件 @
a82ebfae
...
...
@@ -7,6 +7,7 @@ import lombok.Data;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.util.ObjectUtils
;
import
java.sql.Timestamp
;
...
...
@@ -231,6 +232,15 @@ public class AuthenticationUser implements UserDetails
return
authuserdetail
;
}
public
static
AuthenticationUser
setAuthenticationUser
(
String
userId
,
String
userName
)
{
AuthenticationUser
user
=
new
AuthenticationUser
();
user
.
setUserid
(
userId
);
user
.
setPersonname
(
userName
);
UsernamePasswordAuthenticationToken
authentication
=
new
UsernamePasswordAuthenticationToken
(
user
,
null
,
user
.
getAuthorities
());
SecurityContextHolder
.
getContext
().
setAuthentication
(
authentication
);
return
user
;
}
public
Map
<
String
,
Object
>
getSessionParams
()
{
if
(
this
.
sessionParams
==
null
)
...
...
ibzdisk-util/src/main/java/cn/ibizlab/util/web/FeignRequestInterceptor.java
浏览文件 @
a82ebfae
...
...
@@ -4,11 +4,17 @@ import feign.RequestInterceptor;
import
feign.RequestTemplate
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Enumeration
;
import
java.util.LinkedHashMap
;
/**
* feign请求拦截器
...
...
@@ -19,23 +25,23 @@ public class FeignRequestInterceptor implements RequestInterceptor {
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@Override
public
void
apply
(
RequestTemplate
requestTemplate
)
{
ServletRequestAttributes
requestAttributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
requestAttributes
!=
null
)
{
if
(
requestAttributes
!=
null
)
{
HttpServletRequest
request
=
requestAttributes
.
getRequest
();
Enumeration
<
String
>
headerNames
=
request
.
getHeaderNames
();
if
(
headerNames
!=
null
)
{
while
(
headerNames
.
hasMoreElements
())
{
String
name
=
headerNames
.
nextElement
();
if
(
name
.
equalsIgnoreCase
(
"transfer-encoding"
))
{
if
(
name
.
equalsIgnoreCase
(
"transfer-encoding"
))
{
continue
;
}
String
values
=
request
.
getHeader
(
name
);
requestTemplate
.
header
(
name
,
values
);
}
logger
.
info
(
"feign interceptor header:{}"
,
requestTemplate
);
logger
.
info
(
"feign interceptor header:{}"
,
requestTemplate
);
}
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录