...
|
...
|
@@ -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
|
|
|
|
...
|
...
|
|