diff --git a/pom.xml b/pom.xml
index e42488c..b2e4dac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,7 +34,7 @@
5.8.11
- 1.33.0
+ 1.34.0
8.0.17
diff --git a/src/main/java/com/ydool/common/constant/UrlConstant.java b/src/main/java/com/ydool/common/constant/UrlConstant.java
index c1df340..a380b5c 100644
--- a/src/main/java/com/ydool/common/constant/UrlConstant.java
+++ b/src/main/java/com/ydool/common/constant/UrlConstant.java
@@ -21,6 +21,9 @@ public interface UrlConstant {
String DICT_DATA = API + "/dict_data";
+
+ String MENU = API + "/menu";
+
String PERSON = API + "/person";
String COMPANY = API + "/company";
@@ -37,8 +40,7 @@ public interface UrlConstant {
* 在实际的应用中,一定要为不同的项目或服务,自行生成公钥和私钥,并将 PRIVATE_KEY 的引用改为服务的配置项。
* 密钥的生成方式,com.ydool.common.util.RsaUtil类的main函数动态生成。
*/
- String APP_PRIVATE_KEY = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAJwq/96CJLuyjMrcctY0lNrlTIvUikj0bXjmTrY6srwzGA9HiC6saPnwOryrwTqAy/QTCnKW/EeepyJl61r4wlITU0sPbCY7ugPbD2g3cowHPpofb4RJOQfV+EPlLOnDrrYbCP8Z6YhD6P6nltfRxL0kyP/NGX7CUaiMiXZshTMVAgMBAAECgYA6PO7ek7oPJS7MGBnbOBCq8QfyvXg0bLLGe1yvKISvGn7Gc+6dOT6MtsGwynxszMtCYjdrNFMwgkHh2hBDBLGyRM/C1orRpcpCK4CdJNI4GAF/jtIJ1lnrHp11Tt7ng0wGSC00i/oIBIFVRbRhk04SWtLb0C3KaiL9CpBFlFCkAQJBAMm01Opv5V18EZkA7G0Jn0axqNDqKb0OiiXPzzYJ1q3H+VaKYBulQ2V2vlwaO+VJ2any0zbtJrNN+ChiJXO3xzUCQQDGNDXj0NgzAPFGouGhhgjieMCIk1dGfcUT3tdEljqH6XxzgpgGk9WaDcKGi94gcBpw+k4S2K/2Z8BWm0o4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XMWdFxFDIXQpbmS5ovwjnIjSh2ExGnwzOexO3oZGGCOdz7+6eshliVXYMTDjw8=";
}
diff --git a/src/main/java/com/ydool/common/gen/Generator.java b/src/main/java/com/ydool/common/gen/Generator.java
index d1aae59..daa5261 100644
--- a/src/main/java/com/ydool/common/gen/Generator.java
+++ b/src/main/java/com/ydool/common/gen/Generator.java
@@ -27,7 +27,7 @@ public class Generator {
public static void main(String[] args) {
//表名
- String tableName = "t_sys_dict_data";
+ String tableName = "t_sys_menu";
//表前缀
String tablePrefix = "t_sys_";
//作者—
diff --git a/src/main/java/com/ydool/system/controller/MenuController.java b/src/main/java/com/ydool/system/controller/MenuController.java
new file mode 100644
index 0000000..4f8c7e4
--- /dev/null
+++ b/src/main/java/com/ydool/system/controller/MenuController.java
@@ -0,0 +1,141 @@
+package com.ydool.system.controller;
+
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.github.xiaoymin.knife4j.annotations.ApiSupport;
+import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
+import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
+import com.ydool.common.base.BaseController;
+import com.ydool.common.constant.UrlConstant;
+import com.ydool.common.data.dto.AjaxResult;
+import com.ydool.common.data.dto.OptionResult;
+import com.ydool.system.entity.Menu;
+import com.ydool.system.request.MenuRequest;
+import com.ydool.system.service.IMenuService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping(UrlConstant.MENU)
+@Api(tags = "菜单", value = "菜单")
+@ApiSupport(order = 8)
+public class MenuController extends BaseController {
+
+ @Autowired
+ private IMenuService menuService;
+
+ /**
+ * 菜单列表
+ *
+ * @param value
+ * @param column
+ * @param orderBy
+ * @return
+ */
+ @GetMapping(value = "list")
+ @ApiOperation(value = "菜单列表(树形结构不带分页功能)")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "value", value = "搜索框中的内容(只支持字符串类型)"),
+ @ApiImplicitParam(name = "column", value = "排序字段 字段名"),
+ @ApiImplicitParam(name = "orderBy", value = "排序顺序 降序:desc,升序:asc"),
+ @ApiImplicitParam(name = "status", value = "启用状态", dataType = "Boolean"),
+ @ApiImplicitParam(name = "visible", value = "是否隐藏", dataType = "Boolean"),
+ })
+ @ApiOperationSupport(
+ responses = @DynamicResponseParameters(properties = {
+ @DynamicParameter(name = "data", dataTypeClass = Menu.class)
+ }), order = 1
+ )
+ public AjaxResult menuList(String value,
+ String column,
+ String orderBy,
+ Boolean visible,
+ Boolean status) {
+ return menuService.menuList(value, column, orderBy, visible, status);
+ }
+
+
+ /**
+ * 菜单详情
+ *
+ * @param id 菜单ID
+ * @return
+ */
+ @GetMapping(value = "detail")
+ @ApiOperation(value = "菜单详情")
+ @ApiOperationSupport(
+ responses = @DynamicResponseParameters(properties = {
+ @DynamicParameter(name = "data", dataTypeClass = Menu.class)
+ }), order = 2
+ )
+ @ApiImplicitParam(name = "id", value = "菜单Id")
+ public AjaxResult menuDetail(String id) {
+ return AjaxResult.ok().data(menuService.menuDetail(id));
+ }
+
+
+ /**
+ * 保存菜单
+ *
+ * @param menuRequest
+ * @return
+ */
+ @PostMapping(value = "save")
+ @ApiOperation(value = "保存菜单")
+ @ApiOperationSupport(order = 3)
+ public AjaxResult saveMenu(@Validated @RequestBody MenuRequest menuRequest) {
+ return menuService.saveMenu(menuRequest);
+ }
+
+ /**
+ * 编辑菜单
+ *
+ * @param id
+ * @param menuRequest
+ * @return
+ */
+ @PutMapping(value = "edit")
+ @ApiOperation(value = "编辑菜单")
+ @ApiImplicitParam(name = "id", value = "菜单Id")
+ @ApiOperationSupport(order = 4)
+ public AjaxResult editMenu(String id, @Validated @RequestBody MenuRequest menuRequest) {
+ return menuService.editMenu(id, menuRequest);
+ }
+
+ /**
+ * 删除菜单
+ *
+ * @param id
+ * @return
+ */
+ @DeleteMapping(value = "remove")
+ @ApiOperation(value = "删除菜单")
+ @ApiImplicitParam(name = "id", value = "菜单Id")
+ @ApiOperationSupport(order = 5)
+ public AjaxResult removeMenu(String id) {
+ return menuService.removeMenu(id);
+ }
+
+
+ /**
+ * 菜单树
+ *
+ * @return
+ */
+ @GetMapping("tree")
+ @ApiOperation("菜单树")
+ @ApiOperationSupport(
+ responses = @DynamicResponseParameters(properties = {
+ @DynamicParameter(name = "data", dataTypeClass = OptionResult.class)
+ }), order = 6
+ )
+ public AjaxResult menuTree() {
+ return AjaxResult.ok().data(menuService.menuTree());
+ }
+
+}
diff --git a/src/main/java/com/ydool/system/controller/RoleController.java b/src/main/java/com/ydool/system/controller/RoleController.java
index e6a8806..5d6eea9 100644
--- a/src/main/java/com/ydool/system/controller/RoleController.java
+++ b/src/main/java/com/ydool/system/controller/RoleController.java
@@ -10,6 +10,7 @@ import com.ydool.common.data.dto.AjaxResult;
import com.ydool.system.entity.Config;
import com.ydool.system.entity.Role;
import com.ydool.system.request.IdsRequest;
+import com.ydool.system.request.RoleMenuRequest;
import com.ydool.system.request.RoleRequest;
import com.ydool.system.service.IRoleService;
import io.swagger.annotations.Api;
@@ -20,6 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
@RestController
@RequestMapping(UrlConstant.ROLE)
@Api(tags = "角色", value = "角色")
@@ -134,4 +137,35 @@ public class RoleController extends BaseController {
public AjaxResult removeConfigs(@RequestBody @Validated IdsRequest ids) {
return roleService.removeRoles(ids);
}
+
+ /**
+ * 角色权限
+ *
+ * @param id
+ * @return
+ */
+ @GetMapping(value = "roleMenuList")
+ @ApiOperation(value = "角色权限")
+ @ApiOperationSupport(
+ responses = @DynamicResponseParameters(properties = {
+ @DynamicParameter(name = "data", dataTypeClass = List.class)
+ }), order = 7
+ )
+ @ApiImplicitParam(name = "id", value = "角色Id")
+ public AjaxResult roleMenuList(String id) {
+ return roleService.roleMenuList(id);
+ }
+
+ /**
+ * 权限分配
+ * @param roleMenuRequest
+ * @return
+ */
+ @PutMapping(value = "editRoleMenu")
+ @ApiOperation(value = "权限分配")
+ @ApiOperationSupport(order = 8)
+ public AjaxResult editRoleMenu(@RequestBody @Validated RoleMenuRequest roleMenuRequest) {
+ return roleService.editRoleMenu(roleMenuRequest);
+ }
+
}
diff --git a/src/main/java/com/ydool/system/entity/Menu.java b/src/main/java/com/ydool/system/entity/Menu.java
new file mode 100644
index 0000000..0cf013b
--- /dev/null
+++ b/src/main/java/com/ydool/system/entity/Menu.java
@@ -0,0 +1,59 @@
+package com.ydool.system.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ydool.common.base.TreeEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *
+ * 菜单权限表
+ *
+ *
+ * @author ljq
+ * @since 2023-02-02
+ */
+@Data
+@TableName("t_sys_menu")
+@ApiModel(value = "Menu对象", description = "菜单权限表")
+public class Menu extends TreeEntity {
+
+ private static final long serialVersionUID = 1L;
+
+
+ @ApiModelProperty(value = "菜单名称")
+ private String menuName;
+
+ @ApiModelProperty(value = "路由地址")
+ private String path;
+
+ @ApiModelProperty(value = "组件路径")
+ private String component;
+
+ @ApiModelProperty(value = "菜单类型(M目录 C菜单 F按钮 O外链)")
+ private String menuType;
+
+ @ApiModelProperty(value = "是否隐藏(0显示 1隐藏)")
+ private Boolean visible;
+
+ @ApiModelProperty(value = "启用状态(0正常 1停用)")
+ private Boolean status;
+
+ @ApiModelProperty(value = "权限标识")
+ private String perms;
+
+ @ApiModelProperty(value = "菜单图标")
+ private String icon;
+
+ @ApiModelProperty(value = "排序")
+ private Integer sortNo;
+
+ @ApiModelProperty(value = "备注")
+ private String remarks;
+
+ @Override
+ public String getNamed() {
+ return this.menuName;
+ }
+}
diff --git a/src/main/java/com/ydool/system/mapper/MenuMapper.java b/src/main/java/com/ydool/system/mapper/MenuMapper.java
new file mode 100644
index 0000000..e98eab4
--- /dev/null
+++ b/src/main/java/com/ydool/system/mapper/MenuMapper.java
@@ -0,0 +1,18 @@
+package com.ydool.system.mapper;
+
+import com.ydool.system.entity.Menu;
+import com.github.yulichang.base.MPJBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ *
+ * 菜单权限表 Mapper 接口
+ *
+ *
+ * @author ljq
+ * @since 2023-02-02
+ */
+@Mapper
+public interface MenuMapper extends MPJBaseMapper