| | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.enums.AdminStatusStatus; |
| | | import com.sandu.common.enums.ResponseStatusEnums; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.security.LoginUserInfo; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | return ResponseUtil.error(ResponseStatusEnums.DISABLE_ACCOUNT.getCode(), ResponseStatusEnums.DISABLE_ACCOUNT.getMessage()); |
| | | } |
| | | |
| | | Collection<GrantedAuthority> grantedAuthorities = roleService.mapToGrantedAuthorities(admin.getId()); |
| | | Collection<GrantedAuthority> grantedAuthorities = roleService.mapToGrantedAuthorities(admin.getId(), true); |
| | | |
| | | LoginUserInfo loginUserInfo = new LoginUserInfo(); |
| | | loginUserInfo.setUserId(admin.getId()); |
| | |
| | | } |
| | | |
| | | // @PreAuthorize("@el.check('admin:edit')") |
| | | |
| | | /** |
| | | * 修改管理员信息 |
| | | * |
| | | */ |
| | | @PostMapping("/update/{adminId}") |
| | | public ResponseVO<Object> updateAdmin(@RequestBody AdminParam param, @PathVariable Long adminId) { |
| | |
| | | |
| | | /** |
| | | * 修改我的密码 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @PutMapping("/updateMyPassword") |
| | | public ResponseVO<Object> updateMyPassword(@Validated @RequestBody PwdParam param) { |
| | |
| | | // return ResponseUtil.success(null); |
| | | // } |
| | | |
| | | // @DeleteMapping("/{id}") |
| | | // @PreAuthorize("@el.check('admin:del')") |
| | | // public ResponseVO<Object> delete(@PathVariable Long id) { |
| | | // checkLevel(id); |
| | | // adminService.deleteAdmin(id); |
| | | // return ResponseUtil.success(null); |
| | | // } |
| | | @PostMapping("/del/{adminId}") |
| | | public ResponseVO<Object> deleteAdmin(@PathVariable Long adminId) { |
| | | boolean result = adminService.deleteAdmin(adminId); |
| | | if (result) { |
| | | return ResponseUtil.success("修改成功"); |
| | | } else { |
| | | return ResponseUtil.fail("修改失败"); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 给管理员分配角色 |