File tree Expand file tree Collapse file tree
application/src/main/java/top/cadecode/uniboot/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import lombok .RequiredArgsConstructor ;
88import lombok .extern .slf4j .Slf4j ;
99import org .springframework .security .crypto .password .PasswordEncoder ;
10+ import org .springframework .transaction .annotation .Transactional ;
1011import org .springframework .validation .annotation .Validated ;
1112import org .springframework .web .bind .annotation .PostMapping ;
1213import org .springframework .web .bind .annotation .RequestBody ;
@@ -147,7 +148,10 @@ public boolean userAdd(@RequestBody @Valid SysUserAddRequest request) {
147148
148149 @ ApiOperation ("删除用户(多选)" )
149150 @ PostMapping ("user/delete" )
151+ @ Transactional (rollbackFor = Exception .class )
150152 public boolean userDelete (@ RequestBody @ NotEmpty List <Long > userIdList ) {
153+ // 清理用户角色绑定关系
154+ sysRoleService .deleteRoleUserByUserIds (userIdList );
151155 return sysUserService .removeBatchByIds (userIdList );
152156 }
153157
@@ -163,4 +167,5 @@ public List<SysRoleListVo> roleList() {
163167 List <SysRole > roleList = sysRoleService .list ();
164168 return SysRoleConvert .INSTANCE .poToListVo (roleList );
165169 }
170+
166171}
You can’t perform that action at this time.
0 commit comments