| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.dto.TTenantDTO; |
| | | import com.ruoyi.system.model.TTenant; |
| | | import com.ruoyi.system.query.TTenantQuery; |
| | |
| | | /** |
| | | * 获取租户管理列表 |
| | | */ |
| | | // @ApiOperation(value = "获取租户分页列表") |
| | | // @PostMapping(value = "/pageList") |
| | | // public AjaxResult<PageInfo<TTenant>> pageList(@RequestBody TTenantQuery query) { |
| | | // return AjaxResult.success(tenantService.pageList(query)); |
| | | // } |
| | | @ApiOperation(value = "获取租户分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TTenant>> pageList(@RequestBody TTenantQuery query) { |
| | | return AjaxResult.success(tenantService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加租户管理 |
| | |
| | | @ApiOperation(value = "添加租户") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@Validated @RequestBody TTenantDTO dto) { |
| | | // 密码加密 |
| | | dto.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | return AjaxResult.success(tenantService.save(dto)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "修改租户") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@Validated @RequestBody TTenantDTO dto) { |
| | | // 密码加密 |
| | | if(StringUtils.isNotBlank(dto.getPassword())){ |
| | | dto.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | } |
| | | return AjaxResult.success(tenantService.updateById(dto)); |
| | | } |
| | | |