| | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | */ |
| | | @ApiOperation(value = "获取租户分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<PageInfo<TTenant>> pageList(@RequestBody TTenantQuery query) { |
| | | return AjaxResult.success(tenantService.pageList(query)); |
| | | public R<PageInfo<TTenant>> pageList(@RequestBody TTenantQuery query) { |
| | | return R.ok(tenantService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "租户信息-新增租户", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加租户") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@Validated @RequestBody TTenantDTO dto) { |
| | | public R<Boolean> add(@Validated @RequestBody TTenantDTO dto) { |
| | | // 密码加密 |
| | | dto.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | return AjaxResult.success(tenantService.save(dto)); |
| | | return R.ok(tenantService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "租户信息-修改租户", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改租户") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@Validated @RequestBody TTenantDTO dto) { |
| | | public R<Boolean> update(@Validated @RequestBody TTenantDTO dto) { |
| | | // 密码加密 |
| | | if(StringUtils.isNotBlank(dto.getPassword())){ |
| | | dto.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | } |
| | | return AjaxResult.success(tenantService.updateById(dto)); |
| | | return R.ok(tenantService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation(value = "查看租户详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public AjaxResult<TTenant> getDetailById(@RequestParam Long id) { |
| | | return AjaxResult.success(tenantService.getById(id)); |
| | | public R<TTenant> getDetailById(@RequestParam Long id) { |
| | | return R.ok(tenantService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "租户信息-删除租户", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除租户") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult<Boolean> deleteById(@RequestParam Long id) { |
| | | return AjaxResult.success(tenantService.removeById(id)); |
| | | public R<Boolean> deleteById(@RequestParam Long id) { |
| | | return R.ok(tenantService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "租户信息-删除租户", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除租户") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public AjaxResult<Boolean> deleteByIds(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(tenantService.removeByIds(ids)); |
| | | public R<Boolean> deleteByIds(@RequestBody List<Long> ids) { |
| | | return R.ok(tenantService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |