File tree Expand file tree Collapse file tree
application/src/main/java/top/cadecode/uniboot/controller
system/src/main/java/top/cadecode/uniboot/system/request Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535import javax .validation .Valid ;
3636import java .util .List ;
3737
38+ import static top .cadecode .uniboot .system .request .SysUserRequest .SysUserUpdateEnableRequest ;
39+
3840/**
3941 * 系统管理API
4042 *
@@ -107,6 +109,15 @@ public PageResult<SysUserRolesVo> userPageRolesVo(@RequestBody @Valid SysUserRol
107109 return new PageResult <>((int ) rolesVoPage .getTotal (), rolesVoPage .getList ());
108110 }
109111
112+ @ ApiOperation ("更新用户启用状态" )
113+ @ PostMapping ("user/update_enable" )
114+ public boolean userUpdateEnable (@ RequestBody @ Valid SysUserUpdateEnableRequest request ) {
115+ return sysUserService .lambdaUpdate ()
116+ .eq (SysUser ::getId , request .getId ())
117+ .set (SysUser ::getEnableFlag , request .getEnableFlag ())
118+ .update ();
119+ }
120+
110121 @ ApiOperation ("查询角色列表" )
111122 @ PostMapping ("role/list" )
112123 public List <SysRoleListVo > roleList () {
Original file line number Diff line number Diff line change 66
77import javax .validation .constraints .Email ;
88import javax .validation .constraints .NotEmpty ;
9+ import javax .validation .constraints .NotNull ;
910import java .util .List ;
1011
1112/**
@@ -44,4 +45,12 @@ public static class SysUserRolesRequest extends PageParams {
4445 private List <Long > roleIdList ;
4546 private Boolean enableFlag ;
4647 }
48+
49+ @ Data
50+ public static class SysUserUpdateEnableRequest {
51+ @ NotNull
52+ private Long id ;
53+ @ NotNull
54+ private Boolean enableFlag ;
55+ }
4756}
You can’t perform that action at this time.
0 commit comments