@@ -0,0 +1,14 @@ | |||
package com.tuoheng.admin.controller; | |||
import com.tuoheng.common.core.common.BaseController; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/16 | |||
*/ | |||
@RestController | |||
@RequestMapping("/menu") | |||
public class MenuController extends BaseController { | |||
} |
@@ -0,0 +1,15 @@ | |||
package com.tuoheng.admin.controller; | |||
import com.tuoheng.common.core.common.BaseController; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/16 | |||
*/ | |||
@RestController | |||
@RequestMapping("/permission") | |||
public class PermissionController extends BaseController { | |||
} |
@@ -0,0 +1,97 @@ | |||
package com.tuoheng.admin.entity; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.tuoheng.common.core.common.BaseEntity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.experimental.Accessors; | |||
import java.util.List; | |||
/** | |||
* <p> | |||
* 系统菜单表 | |||
* </p> | |||
* | |||
* @author 拓恒 | |||
* @since 2020-10-30 | |||
*/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = true) | |||
@Accessors(chain = true) | |||
@TableName("op_menus") | |||
public class Menu extends BaseEntity { | |||
private static final long serialVersionUID = 1L; | |||
/** | |||
* 父级ID | |||
*/ | |||
private Integer parentId; | |||
/** | |||
* 菜单名称 | |||
*/ | |||
private String name; | |||
/** | |||
* 菜单所属client | |||
*/ | |||
private String clientId; | |||
/** | |||
* 页面跳转方式 | |||
*/ | |||
private String target; | |||
/** | |||
* 图标 | |||
*/ | |||
private String menuIcon; | |||
/** | |||
* 菜单路径 | |||
*/ | |||
private String path; | |||
/** | |||
* 菜单组件 | |||
*/ | |||
private String component; | |||
/** | |||
* 1正常 2禁用 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 0:显示;1:隐藏 | |||
*/ | |||
private Integer isHidden; | |||
/** | |||
* 显示顺序 | |||
*/ | |||
private Integer sort; | |||
/** | |||
* 子级菜单 | |||
*/ | |||
@TableField(exist = false) | |||
private List<Menu> children; | |||
/** | |||
* 是否选中 | |||
*/ | |||
@TableField(exist = false) | |||
private boolean checked; | |||
/** | |||
* 是否打开 | |||
*/ | |||
@TableField(exist = false) | |||
private boolean open; | |||
/** | |||
* 权限节点参数 | |||
*/ | |||
@TableField(exist = false) | |||
private Integer[] checkedList; | |||
} |
@@ -0,0 +1,63 @@ | |||
package com.tuoheng.admin.entity; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.tuoheng.common.core.common.BaseEntity; | |||
import lombok.Data; | |||
/** | |||
* 权限配置表 | |||
* @TableName op_permissions | |||
*/ | |||
@TableName(value ="op_permissions") | |||
@Data | |||
public class OpPermissions extends BaseEntity { | |||
/** | |||
* 所属client | |||
*/ | |||
private String clientId; | |||
/** | |||
* code标识 | |||
*/ | |||
private String code; | |||
/** | |||
* 展示name | |||
*/ | |||
private String name; | |||
/** | |||
* 备注信息 | |||
*/ | |||
private String remark; | |||
/** | |||
* 0:菜单项action-permissions; | |||
*/ | |||
private Integer type; | |||
/** | |||
* 关联菜单id | |||
*/ | |||
private Integer menuId; | |||
/** | |||
* 接口路径 | |||
*/ | |||
private String apiUrl; | |||
/** | |||
* 是否选中 | |||
*/ | |||
@TableField(exist = false) | |||
private boolean checked; | |||
/** | |||
* 是否打开 | |||
*/ | |||
@TableField(exist = false) | |||
private boolean open; | |||
} |
@@ -0,0 +1,11 @@ | |||
package com.tuoheng.admin.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.tuoheng.admin.entity.Menu; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/16 | |||
*/ | |||
public interface MenuMapper extends BaseMapper<Menu> { | |||
} |
@@ -0,0 +1,11 @@ | |||
package com.tuoheng.admin.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.tuoheng.admin.entity.OpPermissions; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/16 | |||
*/ | |||
public interface OpPermissionsMapper extends BaseMapper<OpPermissions> { | |||
} |
@@ -0,0 +1,11 @@ | |||
package com.tuoheng.admin.service.menu; | |||
import com.tuoheng.admin.entity.Menu; | |||
import com.tuoheng.common.core.common.IBaseService; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/16 | |||
*/ | |||
public interface IMenuService extends IBaseService<Menu> { | |||
} |
@@ -0,0 +1,14 @@ | |||
package com.tuoheng.admin.service.menu; | |||
import com.tuoheng.admin.entity.Menu; | |||
import com.tuoheng.admin.mapper.MenuMapper; | |||
import com.tuoheng.common.core.common.BaseServiceImpl; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/16 | |||
*/ | |||
@Service | |||
public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implements IMenuService{ | |||
} |
@@ -0,0 +1,11 @@ | |||
package com.tuoheng.admin.service.permissions; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import com.tuoheng.admin.entity.OpPermissions; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/16 | |||
*/ | |||
public interface OpPermissionsService extends IService<OpPermissions> { | |||
} |
@@ -0,0 +1,17 @@ | |||
package com.tuoheng.admin.service.permissions; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import com.tuoheng.admin.entity.OpPermissions; | |||
import com.tuoheng.admin.mapper.OpPermissionsMapper; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/16 | |||
*/ | |||
@Service | |||
@Slf4j | |||
public class OpPermissionsServiceImpl extends ServiceImpl<OpPermissionsMapper, OpPermissions> { | |||
} |
@@ -0,0 +1,7 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.admin.mapper.MenuMapper"> | |||
</mapper> |
@@ -0,0 +1,7 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.admin.mapper.OpPermissionsMapper"> | |||
</mapper> |