1. 修改 MenuDO 的字段,menuId 改成 id,menuName 改成 name
2. 添加 Menu 的创建、修改、删除接口
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
package cn.iocoder.dashboard.modules.system.dal.mysql.dao.permission;
|
||||
|
||||
import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysMenuDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SysMenuMapper extends BaseMapper<SysMenuDO> {
|
||||
|
||||
default SysMenuDO selectByParentIdAndName(Long parentId, String name) {
|
||||
return selectOne(new QueryWrapper<SysMenuDO>().eq("parent_id", parentId)
|
||||
.eq("name", name));
|
||||
}
|
||||
|
||||
default Integer selectCountByParentId(Long parentId) {
|
||||
return selectCount(new QueryWrapper<SysMenuDO>().eq("parent_id", parentId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,30 +26,30 @@ public class SysDictDataDO extends BaseDO {
|
||||
*/
|
||||
@TableId
|
||||
@Excel(name = "字典编码", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Long dictCode;
|
||||
private Long id;
|
||||
/**
|
||||
* 字典排序
|
||||
*/
|
||||
@Excel(name = "字典排序", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Integer dictSort;
|
||||
private Integer sort;
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
@Excel(name = "字典标签")
|
||||
@NotBlank(message = "字典标签不能为空")
|
||||
@Size(max = 100, message = "字典标签长度不能超过100个字符")
|
||||
private String dictLabel;
|
||||
private String label;
|
||||
/**
|
||||
* 字典键值
|
||||
* 字典值
|
||||
*/
|
||||
@Excel(name = "字典键值")
|
||||
@NotBlank(message = "字典键值不能为空")
|
||||
@Size(max = 100, message = "字典键值长度不能超过100个字符")
|
||||
private String dictValue;
|
||||
private String value;
|
||||
/**
|
||||
* 字典类型
|
||||
*
|
||||
* 外键 {@link SysDictDataDO#getDictType()}
|
||||
* 冗余 {@link SysDictDataDO#getDictType()}
|
||||
*/
|
||||
@Excel(name = "字典类型")
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
|
||||
@@ -3,6 +3,7 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict;
|
||||
import cn.iocoder.dashboard.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.dashboard.framework.excel.Excel;
|
||||
import cn.iocoder.dashboard.framework.mybatis.core.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -26,24 +27,22 @@ public class SysDictTypeDO extends BaseDO {
|
||||
*/
|
||||
@TableId
|
||||
@Excel(name = "字典主键", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Long dictId;
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@Excel(name = "字典名称")
|
||||
@NotBlank(message = "字典名称不能为空")
|
||||
@Size(max = 100, message = "字典类型名称长度不能超过100个字符")
|
||||
private String dictName;
|
||||
|
||||
private String name;
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@TableField("dict_type")
|
||||
@Excel(name = "字典类型")
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
private String dictType;
|
||||
|
||||
private String type;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
|
||||
@@ -3,6 +3,7 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission;
|
||||
import cn.iocoder.dashboard.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.dashboard.framework.mybatis.core.BaseDO;
|
||||
import cn.iocoder.dashboard.modules.system.enums.permission.MenuTypeEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -22,11 +23,11 @@ public class SysMenuDO extends BaseDO {
|
||||
* 菜单ID
|
||||
*/
|
||||
@TableId
|
||||
private Long menuId;
|
||||
private Long id;
|
||||
/**
|
||||
* 菜单名称
|
||||
*/
|
||||
private String menuName;
|
||||
private String name;
|
||||
/**
|
||||
* 权限标识
|
||||
*
|
||||
@@ -43,7 +44,8 @@ public class SysMenuDO extends BaseDO {
|
||||
*
|
||||
* 枚举 {@link MenuTypeEnum}
|
||||
*/
|
||||
private Integer menuType;
|
||||
@TableField("menu_type")
|
||||
private Integer type;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user