| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.annotations.*; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.cache.CacheNames; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | //@ApiIgnore |
| | | @RestController |
| | | @RequestMapping(AppConstant.APPLICATION_SYSTEM_NAME+"/user") |
| | | @AllArgsConstructor |
| | | @Api(value = "用户管理", tags = "用户管理") |
| | | public class UserController { |
| | | |
| | | private final IUserService userService; |
| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "查看详情", notes = "传入id") |
| | | @GetMapping("/detail") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | // @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<UserVO> detail(User user) { |
| | | User detail = userService.getOne(Condition.getQueryWrapper(user)); |
| | | return R.data(UserWrapper.build().entityVO(detail)); |
| | |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | @GetMapping("/searchUser") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "搜索用户", notes = "传入name") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<List<UserVO>> searchUser(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId())); |
| | | return R.data(UserWrapper.build().listVO(pages.getRecords())); |
| | | } |
| | | |
| | | @GetMapping("/searchUserByDistrictId") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "通过小区Id搜索用户", notes = "传入districtId") |
| | | // @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<List<UserVO>> searchUserByDistrictId(String districtId) { |
| | | List<User> resutl = userService.searchUserByDistrictId(districtId); |
| | | return R.data(UserWrapper.build().listVO(resutl)); |
| | | } |
| | | |
| | | /** |
| | | * 自定义用户列表 |
| | | */ |
| | |
| | | }) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "列表", notes = "传入account和realName") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | // @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId())); |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 按条件查询用户信息 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUserListByParam") |
| | | public R getUserListByParam(UserVO user) { |
| | | return R.data(userService.getUserListByParam(user)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |