Merge branch 'master' of https://gitee.com/zhijiantianya/yudao-cloud into feat/springdoc
# Conflicts: # yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java # yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthMenuRespVO.java # yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -9,40 +9,46 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 登录用户的菜单信息 Response VO")
|
||||
@ApiModel("管理后台 - 登录用户的菜单信息 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class AuthMenuRespVO {
|
||||
|
||||
@Schema(description = "菜单名称", required = true, example = "芋道")
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父菜单 ID", required = true, example = "1024")
|
||||
@ApiModelProperty(value = "父菜单 ID", required = true, example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "菜单名称", required = true, example = "芋道")
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post")
|
||||
@ApiModelProperty(value = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index")
|
||||
@ApiModelProperty(value = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传")
|
||||
private String component;
|
||||
|
||||
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
|
||||
@ApiModelProperty(value = "组件名", example = "SystemUser")
|
||||
private String componentName;
|
||||
|
||||
@ApiModelProperty(value = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "是否可见", required = true, example = "false")
|
||||
@ApiModelProperty(value = "是否可见", required = true, example = "false")
|
||||
private Boolean visible;
|
||||
|
||||
@Schema(description = "是否缓存", required = true, example = "false")
|
||||
@ApiModelProperty(value = "是否缓存", required = true, example = "false")
|
||||
private Boolean keepAlive;
|
||||
|
||||
@ApiModelProperty(value = "是否总是显示", example = "false")
|
||||
private Boolean alwaysShow;
|
||||
|
||||
/**
|
||||
* 子路由
|
||||
*/
|
||||
private List<AuthMenuRespVO> children;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -14,46 +14,52 @@ import javax.validation.constraints.Size;
|
||||
@Data
|
||||
public class MenuBaseVO {
|
||||
|
||||
@Schema(description = "菜单名称", required = true, example = "芋道")
|
||||
@ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
|
||||
@NotBlank(message = "菜单名称不能为空")
|
||||
@Size(max = 50, message = "菜单名称长度不能超过50个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "权限标识,仅菜单类型为按钮时,才需要传递", example = "sys:menu:add")
|
||||
@ApiModelProperty(value = "权限标识", example = "sys:menu:add", notes = "仅菜单类型为按钮时,才需要传递")
|
||||
@Size(max = 100)
|
||||
private String permission;
|
||||
|
||||
@Schema(description = "类型,参见 MenuTypeEnum 枚举类", required = true, example = "1")
|
||||
@ApiModelProperty(value = "类型", required = true, example = "1", notes = "参见 MenuTypeEnum 枚举类")
|
||||
@NotNull(message = "菜单类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "显示顺序不能为空", required = true, example = "1024")
|
||||
@ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024")
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "父菜单 ID", required = true, example = "1024")
|
||||
@ApiModelProperty(value = "父菜单 ID", required = true, example = "1024")
|
||||
@NotNull(message = "父菜单 ID 不能为空")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post")
|
||||
@ApiModelProperty(value = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
@Size(max = 200, message = "路由地址不能超过200个字符")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list")
|
||||
@ApiModelProperty(value = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index")
|
||||
@ApiModelProperty(value = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传")
|
||||
@Size(max = 200, message = "组件路径不能超过255个字符")
|
||||
private String component;
|
||||
|
||||
@Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1")
|
||||
@ApiModelProperty(value = "组件名", example = "SystemUser")
|
||||
private String componentName;
|
||||
|
||||
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否可见", example = "false")
|
||||
@ApiModelProperty(value = "是否可见", example = "false")
|
||||
private Boolean visible;
|
||||
|
||||
@Schema(description = "是否缓存", example = "false")
|
||||
@ApiModelProperty(value = "是否缓存", example = "false")
|
||||
private Boolean keepAlive;
|
||||
|
||||
}
|
||||
@ApiModelProperty(value = "是否总是显示", example = "false")
|
||||
private Boolean alwaysShow;
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ public class MenuDO extends BaseDO {
|
||||
private Long parentId;
|
||||
/**
|
||||
* 路由地址
|
||||
*
|
||||
* 如果 path 为 http(s) 时,则它是外链
|
||||
*/
|
||||
private String path;
|
||||
/**
|
||||
@@ -71,6 +73,10 @@ public class MenuDO extends BaseDO {
|
||||
* 组件路径
|
||||
*/
|
||||
private String component;
|
||||
/**
|
||||
* 组件名
|
||||
*/
|
||||
private String componentName;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
@@ -87,9 +93,15 @@ public class MenuDO extends BaseDO {
|
||||
/**
|
||||
* 是否缓存
|
||||
*
|
||||
* 只有菜单、目录使用
|
||||
* 是否使用 Vue 路由的 keep-alive 特性
|
||||
* 只有菜单、目录使用,否使用 Vue 路由的 keep-alive 特性
|
||||
* 注意:如果开启缓存,则必须填写 {@link #componentName} 属性,否则无法缓存
|
||||
*/
|
||||
private Boolean keepAlive;
|
||||
/**
|
||||
* 是否总是显示
|
||||
*
|
||||
* 如果为 false 时,当该菜单只有一个子菜单时,不展示自己,直接展示子菜单
|
||||
*/
|
||||
private Boolean alwaysShow;
|
||||
|
||||
}
|
||||
|
||||
@@ -279,6 +279,7 @@ public class MenuServiceImpl implements MenuService {
|
||||
// 菜单为按钮类型时,无需 component、icon、path 属性,进行置空
|
||||
if (MenuTypeEnum.BUTTON.getType().equals(menu.getType())) {
|
||||
menu.setComponent("");
|
||||
menu.setComponentName("");
|
||||
menu.setIcon("");
|
||||
menu.setPath("");
|
||||
}
|
||||
|
||||
@@ -76,9 +76,11 @@ CREATE TABLE IF NOT EXISTS "system_menu" (
|
||||
"path" varchar(200) DEFAULT '',
|
||||
"icon" varchar(100) DEFAULT '#',
|
||||
"component" varchar(255) DEFAULT NULL,
|
||||
"component_name" varchar(255) DEFAULT NULL,
|
||||
"status" tinyint NOT NULL DEFAULT '0',
|
||||
"visible" bit NOT NULL DEFAULT TRUE,
|
||||
"keep_alive" bit NOT NULL DEFAULT TRUE,
|
||||
"always_show" bit NOT NULL DEFAULT TRUE,
|
||||
"creator" varchar(64) DEFAULT '',
|
||||
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updater" varchar(64) DEFAULT '',
|
||||
|
||||
Reference in New Issue
Block a user