无关风月
2025-01-22 85f4d4a9787db3821cdd8ea603b138299c9879a3
Merge branch 'master' of https://gitee.com/xiaochen991015/xizang
1个文件已修改
26 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTenantController.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTenantController.java
@@ -3,7 +3,7 @@
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;
@@ -43,8 +43,8 @@
     */
    @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));
    }
    /**
@@ -53,10 +53,10 @@
    @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));
    }
    /**
@@ -65,12 +65,12 @@
    @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));
    }
    /**
@@ -78,8 +78,8 @@
     */
    @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));
    }
    /**
@@ -88,8 +88,8 @@
    @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));
    }
    /**
@@ -98,8 +98,8 @@
    @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));
    }
}