diff --git a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/BrandController.java b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/BrandController.java index 857004a8a..344f6a485 100644 --- a/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/BrandController.java +++ b/mall-pms/pms-boot/src/main/java/com/youlai/mall/pms/controller/admin/BrandController.java @@ -93,7 +93,7 @@ public class BrandController { return Result.judge(status); } - @ApiOperation(value = "修改品牌(部分更新)", httpMethod = "PATCH") + @ApiOperation(value = "修改品牌", httpMethod = "PATCH") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "brand", value = "实体JSON对象", required = true, paramType = "body", dataType = "PmsBrand") diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java index 6390d2ab7..3460e24c1 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DeptController.java @@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.youlai.admin.common.constant.AdminConstant; import com.youlai.admin.pojo.entity.SysDept; +import com.youlai.admin.pojo.vo.DeptVO; +import com.youlai.admin.pojo.vo.TreeVO; import com.youlai.admin.service.ISysDeptService; import com.youlai.common.enums.QueryModeEnum; import com.youlai.common.result.Result; @@ -50,20 +52,19 @@ public class DeptController { .orderByDesc(SysDept::getGmtCreate); QueryModeEnum queryModeEnum = QueryModeEnum.getValue(queryMode); - List list; switch (queryModeEnum) { case LIST: - baseQuery = baseQuery.like(StrUtil.isNotBlank(name), SysDept::getName, name) + baseQuery = baseQuery + .like(StrUtil.isNotBlank(name), SysDept::getName, name) .eq(status != null, SysDept::getStatus, status); - list = iSysDeptService.listDeptVO(baseQuery); - break; + List list = iSysDeptService.listDeptVO(baseQuery); + return Result.success(list); case TREE: - list = iSysDeptService.listTreeVO(baseQuery); - break; + List treeList = iSysDeptService.listTreeVO(baseQuery); + return Result.success(treeList); default: return Result.failed(ResultCode.QUERY_MODE_IS_NULL); } - return Result.success(list); } @ApiOperation(value = "部门详情", httpMethod = "GET") diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java index 6da1712ea..a878d1d0c 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictController.java @@ -119,7 +119,7 @@ public class DictController { return Result.judge(status); } - @ApiOperation(value = "修改字典(部分更新)", httpMethod = "PATCH") + @ApiOperation(value = "修改字典", httpMethod = "PATCH") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "dictItem", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDictItem") diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java index 03aae3afb..e2261107e 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/DictItemController.java @@ -105,7 +105,7 @@ public class DictItemController { } - @ApiOperation(value = "修改字典(部分更新)", httpMethod = "PATCH") + @ApiOperation(value = "修改字典", httpMethod = "PATCH") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "dictItem", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysDictItem") diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java index 2ef88adae..c0ccd968b 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MenuController.java @@ -98,27 +98,23 @@ public class MenuController { } @ApiOperation(value = "删除菜单", httpMethod = "DELETE") - @ApiImplicitParam(name = "ids", value = "id集合", required = true, paramType = "query", dataType = "String") + @ApiImplicitParam(name = "ids", value = "id集合字符串,以,分割", required = true, paramType = "query", dataType = "String") @DeleteMapping("/{ids}") public Result delete(@PathVariable("ids") String ids) { boolean status = iSysMenuService.removeByIds(Arrays.asList(ids.split(","))); return Result.judge(status); } - @ApiOperation(value = "修改菜单【局部更新】", httpMethod = "PATCH") + @ApiOperation(value = "修改菜单", httpMethod = "PATCH") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "用户id", required = true, paramType = "path", dataType = "Long"), @ApiImplicitParam(name = "menu", value = "实体JSON对象", required = true, paramType = "body", dataType = "SysMenu") }) @PatchMapping(value = "/{id}") public Result patch(@PathVariable Integer id, @RequestBody SysMenu menu) { - LambdaUpdateWrapper luw = new LambdaUpdateWrapper().eq(SysMenu::getId, id); - if (menu.getVisible() != null) { // 状态更新 - luw.set(SysMenu::getVisible, menu.getVisible()); - } else { - return Result.success(); - } - boolean update = iSysMenuService.update(luw); - return Result.success(update); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper().eq(SysMenu::getId, id); + updateWrapper.set(menu.getVisible() != null, SysMenu::getVisible, menu.getVisible()); + boolean result = iSysMenuService.update(updateWrapper); + return Result.judge(result); } } diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MinIOController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MinIOController.java index 582808169..f39e4f5cf 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MinIOController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/MinIOController.java @@ -27,11 +27,11 @@ public class MinIOController { @ApiOperation(value = "文件上传", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "file", value = "文件", paramType = "form", dataType = "__file"), - @ApiImplicitParam(name = "bucket_name", value = "桶名称", paramType = "query", dataType = "string") + @ApiImplicitParam(name = "bucketName", value = "桶名称", paramType = "query", dataType = "string") }) public Result upload( @RequestParam(value = "file") MultipartFile file, - @RequestParam(value = "bucket_name", required = false, defaultValue = "default") String bucketName + @RequestParam(value = "bucketName", required = false, defaultValue = "default") String bucketName ) { try { String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1); diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java index a038447ed..ad6893d0b 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java @@ -170,14 +170,19 @@ public class UserController extends BaseController { public Result getCurrentUser() { UserVO userVO = new UserVO(); + // 用户基本信息 Long userId = RequestUtils.getUserId(); SysUser user = iSysUserService.getById(userId); BeanUtil.copyProperties(user, userVO); + // 用户角色信息 List roleIds = RequestUtils.getRoleIds(); - List perms = iSysPermissionService.listPermsByRoleIds(roleIds, PermTypeEnum.BUTTON.getValue()); userVO.setRoles(roleIds); + + // 用户按钮权限信息 + List perms = iSysPermissionService.listPermsByRoleIds(roleIds, PermTypeEnum.BUTTON.getValue()); userVO.setPerms(perms); + return Result.success(userVO); } }