Reconstruct the permission system

This commit is contained in:
2023-10-30 16:28:32 +08:00
parent 97af1331e2
commit 69680dd4ad
48 changed files with 191 additions and 112 deletions

View File

@@ -10,7 +10,7 @@ import top.fatweb.api.vo.authentication.UserInfoVo
/**
* <p>
* 用户 前端控制器
* 用户 前端控制器
* </p>
*
* @author FatttSnake

View File

@@ -54,7 +54,6 @@ object UserConverter {
name = it.name,
code = it.code,
powerId = it.powerId,
parentId = it.parentId,
elementId = it.elementId
)
}

View File

@@ -7,7 +7,7 @@ import java.io.Serializable
/**
* <p>
* 页面元素
* 页面元素
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import java.io.Serializable
/**
* <p>
* 用户组
* 用户组
* </p>
*
* @author FatttSnake

View File

@@ -7,7 +7,7 @@ import java.io.Serializable
/**
* <p>
* 菜单
* 菜单
* </p>
*
* @author FatttSnake
@@ -43,7 +43,13 @@ class Menu : Serializable {
@TableField("parent_id")
var parentId: Long? = null
/**
* 模块ID
*/
@TableField("module_id")
var moduleId: Long? = null
override fun toString(): String {
return "Menu(id=$id, name=$name, url=$url, powerId=$powerId, parentId=$parentId)"
return "Menu(id=$id, name=$name, url=$url, powerId=$powerId, parentId=$parentId, moduleId=$moduleId)"
}
}

View File

@@ -0,0 +1,38 @@
package top.fatweb.api.entity.permission
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import java.io.Serializable
/**
* <p>
* 模块表
* </p>
*
* @author FatttSnake
* @since 2023-10-25
*/
@TableName("t_module")
class Module : Serializable {
@TableId("id")
var id: Long? = null
/**
* 模块名
*/
@TableField("name")
var name: String? = null
/**
* 权限ID
*/
@TableField("power_id")
var powerId: Long? = null
override fun toString(): String {
return "Module(id=$id, name=$name, powerId=$powerId)"
}
}

View File

@@ -7,7 +7,7 @@ import java.io.Serializable
/**
* <p>
* 功能
* 功能
* </p>
*
* @author FatttSnake
@@ -37,12 +37,6 @@ class Operation : Serializable {
@TableField("power_id")
var powerId: Long? = null
/**
* 父ID
*/
@TableField("parent_id")
var parentId: Long? = null
/**
* 页面元素ID
*/
@@ -50,6 +44,6 @@ class Operation : Serializable {
var elementId: Long? = null
override fun toString(): String {
return "Operation(id=$id, name=$name, code=$code, powerId=$powerId, parentId=$parentId, elementId=$elementId)"
return "Operation(id=$id, name=$name, code=$code, powerId=$powerId, elementId=$elementId)"
}
}

View File

@@ -7,7 +7,7 @@ import java.io.Serializable
/**
* <p>
* 权限
* 权限
* </p>
*
* @author FatttSnake
@@ -23,7 +23,7 @@ class Power : Serializable {
* 权限类型
*/
@TableField("type_id")
var typeId: Long? = null
var typeId: Int? = null
override fun toString(): String {
return "Power(id=$id, typeId=$typeId)"

View File

@@ -7,7 +7,7 @@ import java.io.Serializable
/**
* <p>
* 权限类型
* 权限类型
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import java.io.Serializable
/**
* <p>
* 角色
* 角色
* </p>
*
* @author FatttSnake

View File

@@ -6,7 +6,7 @@ import top.fatweb.api.entity.permission.Element
/**
* <p>
* 页面元素 Mapper 接口
* 页面元素 Mapper 接口
* </p>
*
* @author FatttSnake

View File

@@ -6,7 +6,7 @@ import top.fatweb.api.entity.permission.Group
/**
* <p>
* 用户组 Mapper 接口
* 用户组 Mapper 接口
* </p>
*
* @author FatttSnake

View File

@@ -6,7 +6,7 @@ import top.fatweb.api.entity.permission.Menu
/**
* <p>
* 菜单 Mapper 接口
* 菜单 Mapper 接口
* </p>
*
* @author FatttSnake

View File

@@ -0,0 +1,16 @@
package top.fatweb.api.mapper.permission
import com.baomidou.mybatisplus.core.mapper.BaseMapper
import org.apache.ibatis.annotations.Mapper
import top.fatweb.api.entity.permission.Module
/**
* <p>
* 模块表 Mapper 接口
* </p>
*
* @author FatttSnake
* @since 2023-10-25
*/
@Mapper
interface ModuleMapper : BaseMapper<Module>

View File

@@ -6,7 +6,7 @@ import top.fatweb.api.entity.permission.Operation
/**
* <p>
* 功能 Mapper 接口
* 功能 Mapper 接口
* </p>
*
* @author FatttSnake

View File

@@ -6,7 +6,7 @@ import top.fatweb.api.entity.permission.Power
/**
* <p>
* 权限 Mapper 接口
* 权限 Mapper 接口
* </p>
*
* @author FatttSnake

View File

@@ -6,7 +6,7 @@ import top.fatweb.api.entity.permission.PowerType
/**
* <p>
* 权限类型 Mapper 接口
* 权限类型 Mapper 接口
* </p>
*
* @author FatttSnake

View File

@@ -6,7 +6,7 @@ import top.fatweb.api.entity.permission.Role
/**
* <p>
* 角色 Mapper 接口
* 角色 Mapper 接口
* </p>
*
* @author FatttSnake

View File

@@ -7,7 +7,7 @@ import top.fatweb.api.entity.permission.User
/**
* <p>
* 用户 Mapper 接口
* 用户 Mapper 接口
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import top.fatweb.api.entity.permission.Element
/**
* <p>
* 页面元素 服务类
* 页面元素 服务类
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import top.fatweb.api.entity.permission.Group
/**
* <p>
* 用户组 服务类
* 用户组 服务类
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import top.fatweb.api.entity.permission.Menu
/**
* <p>
* 菜单 服务类
* 菜单 服务类
* </p>
*
* @author FatttSnake

View File

@@ -0,0 +1,14 @@
package top.fatweb.api.service.permission
import com.baomidou.mybatisplus.extension.service.IService
import top.fatweb.api.entity.permission.Module
/**
* <p>
* 模块表 服务类
* </p>
*
* @author FatttSnake
* @since 2023-10-25
*/
interface IModuleService : IService<Module>

View File

@@ -5,7 +5,7 @@ import top.fatweb.api.entity.permission.Operation
/**
* <p>
* 功能 服务类
* 功能 服务类
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import top.fatweb.api.entity.permission.Power
/**
* <p>
* 权限 服务类
* 权限 服务类
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import top.fatweb.api.entity.permission.PowerType
/**
* <p>
* 权限类型 服务类
* 权限类型 服务类
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import top.fatweb.api.entity.permission.Role
/**
* <p>
* 角色 服务类
* 角色 服务类
* </p>
*
* @author FatttSnake

View File

@@ -5,7 +5,7 @@ import top.fatweb.api.entity.permission.User
/**
* <p>
* 用户 服务类
* 用户 服务类
* </p>
*
* @author FatttSnake

View File

@@ -8,7 +8,7 @@ import top.fatweb.api.service.permission.IElementService
/**
* <p>
* 页面元素 服务实现类
* 页面元素 服务实现类
* </p>
*
* @author FatttSnake

View File

@@ -8,7 +8,7 @@ import top.fatweb.api.service.permission.IGroupService
/**
* <p>
* 用户组 服务实现类
* 用户组 服务实现类
* </p>
*
* @author FatttSnake

View File

@@ -8,7 +8,7 @@ import top.fatweb.api.service.permission.IMenuService
/**
* <p>
* 菜单 服务实现类
* 菜单 服务实现类
* </p>
*
* @author FatttSnake

View File

@@ -0,0 +1,18 @@
package top.fatweb.api.service.permission.impl
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
import org.springframework.stereotype.Service
import top.fatweb.api.entity.permission.Module
import top.fatweb.api.mapper.permission.ModuleMapper
import top.fatweb.api.service.permission.IModuleService
/**
* <p>
* 模块表 服务实现类
* </p>
*
* @author FatttSnake
* @since 2023-10-25
*/
@Service
class ModuleServiceImpl : ServiceImpl<ModuleMapper, Module>(), IModuleService

View File

@@ -8,7 +8,7 @@ import top.fatweb.api.service.permission.IOperationService
/**
* <p>
* 功能 服务实现类
* 功能 服务实现类
* </p>
*
* @author FatttSnake

View File

@@ -8,7 +8,7 @@ import top.fatweb.api.service.permission.IPowerService
/**
* <p>
* 权限 服务实现类
* 权限 服务实现类
* </p>
*
* @author FatttSnake

View File

@@ -8,7 +8,7 @@ import top.fatweb.api.service.permission.IPowerTypeService
/**
* <p>
* 权限类型 服务实现类
* 权限类型 服务实现类
* </p>
*
* @author FatttSnake

View File

@@ -8,7 +8,7 @@ import top.fatweb.api.service.permission.IRoleService
/**
* <p>
* 角色 服务实现类
* 角色 服务实现类
* </p>
*
* @author FatttSnake

View File

@@ -12,7 +12,7 @@ import top.fatweb.api.util.WebUtil
/**
* <p>
* 用户 服务实现类
* 用户 服务实现类
* </p>
*
* @author FatttSnake

View File

@@ -15,9 +15,6 @@ data class OperationVo(
@Schema(description = "权限 ID")
val powerId: Long?,
@Schema(description = "父 ID")
val parentId: Long?,
@Schema(description = "页面元素 ID")
val elementId: Long?
)