切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
54f8209b56cbb779a79d10a85b6ca186119f0021
1 个父辈
3e1aca11
1. 优化编辑上级ID,传0或不传 取消员工的上级
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
8 行增加
和
5 行删除
pkg/application/user/command/edit_parent.go
pkg/application/user/user.go
pkg/application/user/command/edit_parent.go
查看文件 @
54f8209
...
...
@@ -6,7 +6,7 @@ import (
type
EditParentCommand
struct
{
Id
int64
`cname:"用户ID" json:"id,string" valid:"Required"`
ParentId
int64
`cname:"上级ID" json:"parentId
,string" valid:"Required
"`
ParentId
int64
`cname:"上级ID" json:"parentId"`
CompanyId
int
`cname:"公司ID" json:"companyId"`
OperatorId
int
`cname:"操作人ID" json:"operatorId"`
}
...
...
pkg/application/user/user.go
查看文件 @
54f8209
...
...
@@ -148,10 +148,13 @@ func (us *UserService) EditParentUser(in *command.EditParentCommand) error {
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
// 上级ID是否存在
_
,
err
=
userRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
in
.
ParentId
})
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
if
in
.
ParentId
!=
0
{
// 上级ID是否存在
_
,
err
=
userRepo
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
in
.
ParentId
})
if
err
!=
nil
{
return
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
user
.
ParentId
=
in
.
ParentId
...
...
请
注册
或
登录
后发表评论