完成用户的重置密码、删除、修改状态的对接
This commit is contained in:
@@ -88,6 +88,34 @@ public class SysUserController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("删除用户")
|
||||
@ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024")
|
||||
@PostMapping("/delete")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
// @Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
public CommonResult<Boolean> deleteUser(@RequestParam("id") Long id) {
|
||||
userService.deleteUser(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("重置用户密码")
|
||||
@PostMapping("/update-password")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||
// @Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
public CommonResult<Boolean> updateUserPassword(@Validated @RequestBody SysUserUpdatePasswordReqVO reqVO) {
|
||||
userService.updateUserPassword(reqVO.getId(), reqVO.getPassword());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("修改用户状态")
|
||||
@PostMapping("/update-status")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
// @Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
public CommonResult<Boolean> updateUserStatus(@Validated @RequestBody SysUserUpdateStatusReqVO reqVO) {
|
||||
userService.updateUserStatus(reqVO.getId(), reqVO.getStatus());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// @Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||
// @GetMapping("/export")
|
||||
@@ -119,43 +147,4 @@ public class SysUserController {
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
// /**
|
||||
// * 删除用户
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:remove')")
|
||||
// @Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{userIds}")
|
||||
// public AjaxResult remove(@PathVariable Long[] userIds)
|
||||
// {
|
||||
// return toAjax(userService.deleteUserByIds(userIds));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 重置密码
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
|
||||
// @Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping("/resetPwd")
|
||||
// public AjaxResult resetPwd(@RequestBody SysUser user)
|
||||
// {
|
||||
// userService.checkUserAllowed(user);
|
||||
// user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
// user.setUpdateBy(SecurityUtils.getUsername());
|
||||
// return toAjax(userService.resetPwd(user));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 状态修改
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
// @Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping("/changeStatus")
|
||||
// public AjaxResult changeStatus(@RequestBody SysUser user)
|
||||
// {
|
||||
// userService.checkUserAllowed(user);
|
||||
// user.setUpdateBy(SecurityUtils.getUsername());
|
||||
// return toAjax(userService.updateUserStatus(user));
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.dashboard.modules.system.controller.user.vo.user;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("用户更新密码 Request VO")
|
||||
@Data
|
||||
public class SysUserUpdatePasswordReqVO {
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1024")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "密码", required = true, example = "123456")
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
|
||||
private String password;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user