|
|
@@ -73,7 +73,7 @@ func (h *UserHandler) UpdateById(ctx context.Context, req *model.EditUserReq, rs
|
|
|
}
|
|
|
|
|
|
// GetUserInfo 获取用户实体信息
|
|
|
-func (e *UserHandler) GetUserInfo(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (h *UserHandler) GetUserInfo(ctx context.Context, req *comm_def.IdReq, rsp *comm_def.CommonMsg) error {
|
|
|
userService, err := service.NewUserService(ctx)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -167,7 +167,7 @@ func (h *UserHandler) DeleteByIds(ctx context.Context, req *comm_def.IdsReq, rsp
|
|
|
}
|
|
|
|
|
|
// ResetPassword 密码重置(管理员进行操作)
|
|
|
-func (e *UserHandler) ResetPassword(ctx context.Context, req *model.SysResetPwdReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (h *UserHandler) ResetPassword(ctx context.Context, req *model.SysResetPwdReq, rsp *comm_def.CommonMsg) error {
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -175,10 +175,6 @@ func (e *UserHandler) ResetPassword(ctx context.Context, req *model.SysResetPwdR
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- // todo:校验用户是否有修改权限
|
|
|
- if userService.GetCxtUserId() != 1000 {
|
|
|
- return myerrors.TipsError("权限不足")
|
|
|
- }
|
|
|
err = userService.ResetUserPwd(req)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -187,7 +183,7 @@ func (e *UserHandler) ResetPassword(ctx context.Context, req *model.SysResetPwdR
|
|
|
}
|
|
|
|
|
|
// SetStatus 设置用户状态
|
|
|
-func (e *UserHandler) SetStatus(ctx context.Context, req *model.SysUserStatusReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (h *UserHandler) SetStatus(ctx context.Context, req *model.SysUserStatusReq, rsp *comm_def.CommonMsg) error {
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
|
}
|
|
|
@@ -203,7 +199,7 @@ func (e *UserHandler) SetStatus(ctx context.Context, req *model.SysUserStatusReq
|
|
|
}
|
|
|
|
|
|
// GetDataScope 获取某用户数据集合权限,返回Ids(用户Id列表),返回-1表示无角色,返回-2表示有全部集合权限
|
|
|
-func (o *RoleHandler) GetDataScope(ctx context.Context, nullParams interface{}, rsp *comm_def.CommonMsg) error {
|
|
|
+func (h *RoleHandler) GetDataScope(ctx context.Context, nullParams interface{}, rsp *comm_def.CommonMsg) error {
|
|
|
userService, err := service.NewUserService(ctx)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -217,7 +213,7 @@ func (o *RoleHandler) GetDataScope(ctx context.Context, nullParams interface{},
|
|
|
}
|
|
|
|
|
|
// GetUserByDept 获取部门下所属用户
|
|
|
-func (e *UserHandler) GetUserByDept(ctx context.Context, req *user_def.DeptIdReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (h *UserHandler) GetUserByDept(ctx context.Context, req *user_def.DeptIdReq, rsp *comm_def.CommonMsg) error {
|
|
|
// 参数校验
|
|
|
if req.DeptId == 0 {
|
|
|
return myerrors.TipsError("请求参数不存在。")
|
|
|
@@ -236,7 +232,7 @@ func (e *UserHandler) GetUserByDept(ctx context.Context, req *user_def.DeptIdReq
|
|
|
}
|
|
|
|
|
|
// GetUserByRole 获取角色关联用户
|
|
|
-func (e *UserHandler) GetUserByRole(ctx context.Context, req *model.SysUserRoleReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (h *UserHandler) GetUserByRole(ctx context.Context, req *model.SysUserRoleReq, rsp *comm_def.CommonMsg) error {
|
|
|
// 参数校验
|
|
|
if req.RoleId == 0 {
|
|
|
return myerrors.TipsError("请求参数不存在。")
|
|
|
@@ -396,7 +392,7 @@ func (e *UserHandler) GetUserByRole(ctx context.Context, req *model.SysUserRoleR
|
|
|
//}
|
|
|
|
|
|
// ChangePassword 用户修改密码
|
|
|
-func (e *UserHandler) ChangePassword(ctx context.Context, req *model.SysUserResetPwdReq, rsp *comm_def.CommonMsg) error {
|
|
|
+func (h *UserHandler) ChangePassword(ctx context.Context, req *model.SysUserResetPwdReq, rsp *comm_def.CommonMsg) error {
|
|
|
if err := gvalid.CheckStruct(ctx, req, nil); err != nil {
|
|
|
return err
|
|
|
}
|