Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ssssssss-team
magic-api
提交
3bc0414b
M
magic-api
项目概览
ssssssss-team
/
magic-api
大约 1 年 前同步成功
通知
41
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
magic-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3bc0414b
编写于
3月 15, 2022
作者:
M
mxd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复分组缺失创建人、创建时间等信息的问题
上级
482150cf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
52 addition
and
8 deletion
+52
-8
magic-api/src/main/java/org/ssssssss/magicapi/core/model/Group.java
...src/main/java/org/ssssssss/magicapi/core/model/Group.java
+44
-8
magic-api/src/main/java/org/ssssssss/magicapi/core/service/impl/DefaultMagicResourceService.java
...gicapi/core/service/impl/DefaultMagicResourceService.java
+8
-0
未找到文件。
magic-api/src/main/java/org/ssssssss/magicapi/core/model/Group.java
浏览文件 @
3bc0414b
...
...
@@ -21,6 +21,14 @@ public class Group extends Attributes<Object> {
private
String
path
;
private
Long
createTime
;
private
Long
updateTime
;
private
String
createBy
;
private
String
updateBy
;
/**
* 路径变量
*/
...
...
@@ -108,20 +116,48 @@ public class Group extends Attributes<Object> {
return
group
;
}
public
Long
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Long
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Long
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Long
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
{
return
true
;
}
if
(!(
o
instanceof
Group
))
{
return
false
;
}
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Group
group
=
(
Group
)
o
;
return
Objects
.
equals
(
id
,
group
.
id
)
&&
Objects
.
equals
(
name
,
group
.
name
)
&&
Objects
.
equals
(
type
,
group
.
type
)
&&
Objects
.
equals
(
parentId
,
group
.
parentId
)
&&
Objects
.
equals
(
path
,
group
.
path
);
return
Objects
.
equals
(
id
,
group
.
id
)
&&
Objects
.
equals
(
name
,
group
.
name
)
&&
Objects
.
equals
(
type
,
group
.
type
)
&&
Objects
.
equals
(
parentId
,
group
.
parentId
)
&&
Objects
.
equals
(
path
,
group
.
path
)
&&
Objects
.
equals
(
createTime
,
group
.
createTime
)
&&
Objects
.
equals
(
updateTime
,
group
.
updateTime
)
&&
Objects
.
equals
(
createBy
,
group
.
createBy
)
&&
Objects
.
equals
(
updateBy
,
group
.
updateBy
)
&&
Objects
.
equals
(
paths
,
group
.
paths
)
&&
Objects
.
equals
(
options
,
group
.
options
)
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
id
,
name
,
type
,
parentId
,
path
);
return
Objects
.
hash
(
id
,
name
,
type
,
parentId
,
path
,
createTime
,
updateTime
,
createBy
,
updateBy
,
paths
,
options
);
}
}
magic-api/src/main/java/org/ssssssss/magicapi/core/service/impl/DefaultMagicResourceService.java
浏览文件 @
3bc0414b
...
...
@@ -232,6 +232,8 @@ public class DefaultMagicResourceService implements MagicResourceService, JsonCo
if
(
group
.
getId
()
==
null
)
{
group
.
setId
(
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
}
group
.
setCreateTime
(
System
.
currentTimeMillis
());
group
.
setCreateBy
(
WebUtils
.
currentUserName
());
groupResource
=
resource
.
getDirectory
(
group
.
getName
());
// 判断分组文件夹需要不存在
isTrue
(!
groupResource
.
exists
(),
FILE_SAVE_FAILURE
);
...
...
@@ -261,6 +263,9 @@ public class DefaultMagicResourceService implements MagicResourceService, JsonCo
Resource
oldResource
=
getGroupResource
(
group
.
getId
());
groupResource
=
resource
.
getDirectory
(
group
.
getName
());
isTrue
(
oldResource
!=
null
&&
oldResource
.
exists
(),
GROUP_NOT_FOUND
);
// 设置修改时间,修改人
group
.
setUpdateBy
(
WebUtils
.
currentUserName
());
group
.
setUpdateTime
(
System
.
currentTimeMillis
());
// 名字不一样时重命名
if
(!
Objects
.
equals
(
oldGroup
.
getName
(),
group
.
getName
()))
{
// 判断分组文件夹需要不存在
...
...
@@ -368,6 +373,9 @@ public class DefaultMagicResourceService implements MagicResourceService, JsonCo
}
}
}
// 设置修改时间,修改人
src
.
setUpdateBy
(
WebUtils
.
currentUserName
());
src
.
setUpdateTime
(
System
.
currentTimeMillis
());
Resource
oldResource
=
groupMappings
.
get
(
src
.
getId
());
if
(
oldResource
.
renameTo
(
targetResource
))
{
Resource
resource
=
targetResource
.
getResource
(
Constants
.
GROUP_METABASE
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录