diff --git a/src/main/kotlin/top/fatweb/api/converter/permission/ElementConverter.kt b/src/main/kotlin/top/fatweb/api/converter/permission/ElementConverter.kt deleted file mode 100644 index 2a7f5b6..0000000 --- a/src/main/kotlin/top/fatweb/api/converter/permission/ElementConverter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package top.fatweb.api.converter.permission - -import top.fatweb.api.entity.permission.Element -import top.fatweb.api.vo.permission.base.ElementVo - -/** - * Element converter - * - * @author FatttSnake, fatttsnake@gmail.com - * @since 1.0.0 - */ -object ElementConverter { - fun elementToElementVo(element: Element) = ElementVo( - id = element.id, - name = element.name, - parentId = element.parentId, - menuId = element.menuId - ) -} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/converter/permission/FuncConverter.kt b/src/main/kotlin/top/fatweb/api/converter/permission/FuncConverter.kt new file mode 100644 index 0000000..70e7410 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/converter/permission/FuncConverter.kt @@ -0,0 +1,19 @@ +package top.fatweb.api.converter.permission + +import top.fatweb.api.entity.permission.Func +import top.fatweb.api.vo.permission.base.FuncVo + +/** + * Function converter + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ +object FuncConverter { + fun funcToFuncVo(func: Func) = FuncVo( + id = func.id, + name = func.name, + parentId = func.parentId, + menuId = func.menuId + ) +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/converter/permission/OperationConverter.kt b/src/main/kotlin/top/fatweb/api/converter/permission/OperationConverter.kt index 43c87b4..b6a4b36 100644 --- a/src/main/kotlin/top/fatweb/api/converter/permission/OperationConverter.kt +++ b/src/main/kotlin/top/fatweb/api/converter/permission/OperationConverter.kt @@ -14,6 +14,6 @@ object OperationConverter { id = operation.id, name = operation.name, code = operation.code, - elementId = operation.elementId + funcId = operation.funcId ) } \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/converter/permission/PowerConverter.kt b/src/main/kotlin/top/fatweb/api/converter/permission/PowerConverter.kt index 526b888..65db452 100644 --- a/src/main/kotlin/top/fatweb/api/converter/permission/PowerConverter.kt +++ b/src/main/kotlin/top/fatweb/api/converter/permission/PowerConverter.kt @@ -13,7 +13,7 @@ object PowerConverter { fun powerSetToPowerSetVo(powerSet: PowerSet) = PowerSetVo( moduleList = powerSet.moduleList?.map { ModuleConverter.moduleToModuleVo(it) }, menuList = powerSet.menuList?.map { MenuConverter.menuToMenuVo(it) }, - elementList = powerSet.elementList?.map { ElementConverter.elementToElementVo(it) }, + funcList = powerSet.funcList?.map { FuncConverter.funcToFuncVo(it) }, operationList = powerSet.operationList?.map { OperationConverter.operationToOperationVo(it) } ) } \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/converter/permission/RoleConverter.kt b/src/main/kotlin/top/fatweb/api/converter/permission/RoleConverter.kt index 66363f2..a55d749 100644 --- a/src/main/kotlin/top/fatweb/api/converter/permission/RoleConverter.kt +++ b/src/main/kotlin/top/fatweb/api/converter/permission/RoleConverter.kt @@ -33,7 +33,7 @@ object RoleConverter { updateTime = role.updateTime, modules = role.modules?.map { ModuleConverter.moduleToModuleVo(it) }, menus = role.menus?.map { MenuConverter.menuToMenuVo(it) }, - elements = role.elements?.map { ElementConverter.elementToElementVo(it) }, + funcs = role.funcs?.map { FuncConverter.funcToFuncVo(it) }, operations = role.operations?.map { OperationConverter.operationToOperationVo(it) } ) diff --git a/src/main/kotlin/top/fatweb/api/converter/permission/UserConverter.kt b/src/main/kotlin/top/fatweb/api/converter/permission/UserConverter.kt index fbb8c24..55dc200 100644 --- a/src/main/kotlin/top/fatweb/api/converter/permission/UserConverter.kt +++ b/src/main/kotlin/top/fatweb/api/converter/permission/UserConverter.kt @@ -50,8 +50,8 @@ object UserConverter { menus = user.menus?.map { MenuConverter.menuToMenuVo(it) }, - elements = user.elements?.map { - ElementConverter.elementToElementVo(it) + funcs = user.funcs?.map { + FuncConverter.funcToFuncVo(it) }, operations = user.operations?.map { OperationConverter.operationToOperationVo(it) diff --git a/src/main/kotlin/top/fatweb/api/entity/permission/Element.kt b/src/main/kotlin/top/fatweb/api/entity/permission/Func.kt similarity index 78% rename from src/main/kotlin/top/fatweb/api/entity/permission/Element.kt rename to src/main/kotlin/top/fatweb/api/entity/permission/Func.kt index 6594a82..731a9f6 100644 --- a/src/main/kotlin/top/fatweb/api/entity/permission/Element.kt +++ b/src/main/kotlin/top/fatweb/api/entity/permission/Func.kt @@ -6,19 +6,19 @@ import com.baomidou.mybatisplus.annotation.TableName import java.io.Serializable /** - * Element entity + * Function entity * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 */ -@TableName("t_element") -class Element : Serializable { +@TableName("t_func") +class Func : Serializable { @TableId("id") var id: Long? = null /** - * 元素名 + * 功能名 */ @TableField("name") var name: String? = null @@ -36,6 +36,6 @@ class Element : Serializable { var menuId: Long? = null override fun toString(): String { - return "Element(id=$id, name=$name, parentId=$parentId, menuId=$menuId)" + return "Func(id=$id, name=$name, parentId=$parentId, menuId=$menuId)" } } diff --git a/src/main/kotlin/top/fatweb/api/entity/permission/Operation.kt b/src/main/kotlin/top/fatweb/api/entity/permission/Operation.kt index 2ca5a17..b0e9a68 100644 --- a/src/main/kotlin/top/fatweb/api/entity/permission/Operation.kt +++ b/src/main/kotlin/top/fatweb/api/entity/permission/Operation.kt @@ -18,24 +18,24 @@ class Operation : Serializable { var id: Long? = null /** - * 功能名 + * 操作名 */ @TableField("name") var name: String? = null /** - * 功能编码 + * 操作编码 */ @TableField("code") var code: String? = null /** - * 页面元素ID + * 功能ID */ - @TableField("element_id") - var elementId: Long? = null + @TableField("func_id") + var funcId: Long? = null override fun toString(): String { - return "Operation(id=$id, name=$name, code=$code, elementId=$elementId)" + return "Operation(id=$id, name=$name, code=$code, funcId=$funcId)" } } diff --git a/src/main/kotlin/top/fatweb/api/entity/permission/PowerSet.kt b/src/main/kotlin/top/fatweb/api/entity/permission/PowerSet.kt index f5f81ff..4dfb94c 100644 --- a/src/main/kotlin/top/fatweb/api/entity/permission/PowerSet.kt +++ b/src/main/kotlin/top/fatweb/api/entity/permission/PowerSet.kt @@ -13,7 +13,7 @@ class PowerSet : Serializable { var menuList: List? = null - var elementList: List? = null + var funcList: List? = null var operationList: List? = null } \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/entity/permission/Role.kt b/src/main/kotlin/top/fatweb/api/entity/permission/Role.kt index bea00eb..ede34ca 100644 --- a/src/main/kotlin/top/fatweb/api/entity/permission/Role.kt +++ b/src/main/kotlin/top/fatweb/api/entity/permission/Role.kt @@ -55,7 +55,7 @@ class Role : Serializable { var menus: List? = null @TableField(exist = false) - var elements: List? = null + var funcs: List? = null @TableField(exist = false) var operations: List? = null @@ -64,6 +64,6 @@ class Role : Serializable { var powers: List? = null override fun toString(): String { - return "Role(id=$id, name=$name, enable=$enable, deleted=$deleted, version=$version, modules=$modules, menus=$menus, elements=$elements, operations=$operations, powers=$powers)" + return "Role(id=$id, name=$name, enable=$enable, deleted=$deleted, version=$version, modules=$modules, menus=$menus, funcs=$funcs, operations=$operations, powers=$powers)" } } diff --git a/src/main/kotlin/top/fatweb/api/entity/permission/User.kt b/src/main/kotlin/top/fatweb/api/entity/permission/User.kt index ce6954a..c63b362 100644 --- a/src/main/kotlin/top/fatweb/api/entity/permission/User.kt +++ b/src/main/kotlin/top/fatweb/api/entity/permission/User.kt @@ -118,12 +118,12 @@ class User() : Serializable { var menus: List? = null @TableField(exist = false) - var elements: List? = null + var funcs: List? = null @TableField(exist = false) var operations: List? = null override fun toString(): String { - return "User(id=$id, username=$username, password=$password, locking=$locking, expiration=$expiration, credentialsExpiration=$credentialsExpiration, enable=$enable, currentLoginTime=$currentLoginTime, currentLoginIp=$currentLoginIp, lastLoginTime=$lastLoginTime, lastLoginIp=$lastLoginIp, createTime=$createTime, updateTime=$updateTime, deleted=$deleted, version=$version, userInfo=$userInfo, roles=$roles, groups=$groups, modules=$modules, menus=$menus, elements=$elements, operations=$operations)" + return "User(id=$id, username=$username, password=$password, locking=$locking, expiration=$expiration, credentialsExpiration=$credentialsExpiration, enable=$enable, currentLoginTime=$currentLoginTime, currentLoginIp=$currentLoginIp, lastLoginTime=$lastLoginTime, lastLoginIp=$lastLoginIp, createTime=$createTime, updateTime=$updateTime, deleted=$deleted, version=$version, userInfo=$userInfo, roles=$roles, groups=$groups, modules=$modules, menus=$menus, funcs=$funcs, operations=$operations)" } } diff --git a/src/main/kotlin/top/fatweb/api/mapper/permission/ElementMapper.kt b/src/main/kotlin/top/fatweb/api/mapper/permission/FuncMapper.kt similarity index 66% rename from src/main/kotlin/top/fatweb/api/mapper/permission/ElementMapper.kt rename to src/main/kotlin/top/fatweb/api/mapper/permission/FuncMapper.kt index 145167b..1d3a7ee 100644 --- a/src/main/kotlin/top/fatweb/api/mapper/permission/ElementMapper.kt +++ b/src/main/kotlin/top/fatweb/api/mapper/permission/FuncMapper.kt @@ -2,13 +2,13 @@ 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.Element +import top.fatweb.api.entity.permission.Func /** - * Element mapper + * Function mapper * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 */ @Mapper -interface ElementMapper : BaseMapper +interface FuncMapper : BaseMapper diff --git a/src/main/kotlin/top/fatweb/api/service/permission/IElementService.kt b/src/main/kotlin/top/fatweb/api/service/permission/IFuncService.kt similarity index 58% rename from src/main/kotlin/top/fatweb/api/service/permission/IElementService.kt rename to src/main/kotlin/top/fatweb/api/service/permission/IFuncService.kt index 3e1bc80..fd33201 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/IElementService.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/IFuncService.kt @@ -1,12 +1,12 @@ package top.fatweb.api.service.permission import com.baomidou.mybatisplus.extension.service.IService -import top.fatweb.api.entity.permission.Element +import top.fatweb.api.entity.permission.Func /** - * Element service interface + * Function service interface * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 */ -interface IElementService : IService +interface IFuncService : IService diff --git a/src/main/kotlin/top/fatweb/api/service/permission/impl/ElementServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/permission/impl/ElementServiceImpl.kt deleted file mode 100644 index 8756d21..0000000 --- a/src/main/kotlin/top/fatweb/api/service/permission/impl/ElementServiceImpl.kt +++ /dev/null @@ -1,16 +0,0 @@ -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.Element -import top.fatweb.api.mapper.permission.ElementMapper -import top.fatweb.api.service.permission.IElementService - -/** - * Element service implement - * - * @author FatttSnake, fatttsnake@gmail.com - * @since 1.0.0 - */ -@Service -class ElementServiceImpl : ServiceImpl(), IElementService diff --git a/src/main/kotlin/top/fatweb/api/service/permission/impl/FuncServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/permission/impl/FuncServiceImpl.kt new file mode 100644 index 0000000..29c2686 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/service/permission/impl/FuncServiceImpl.kt @@ -0,0 +1,16 @@ +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.Func +import top.fatweb.api.mapper.permission.FuncMapper +import top.fatweb.api.service.permission.IFuncService + +/** + * Function service implement + * + * @author FatttSnake, fatttsnake@gmail.com + * @since 1.0.0 + */ +@Service +class FuncServiceImpl : ServiceImpl(), IFuncService diff --git a/src/main/kotlin/top/fatweb/api/service/permission/impl/PowerServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/permission/impl/PowerServiceImpl.kt index 565429d..1e08c83 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/impl/PowerServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/impl/PowerServiceImpl.kt @@ -18,13 +18,13 @@ import top.fatweb.api.service.permission.* class PowerServiceImpl( private val moduleService: IModuleService, private val menuService: IMenuService, - private val elementService: IElementService, + private val funcService: IFuncService, private val operationService: IOperationService ) : ServiceImpl(), IPowerService { override fun getList() = PowerConverter.powerSetToPowerSetVo(PowerSet().apply { moduleList = moduleService.list() menuList = menuService.list() - elementList = elementService.list() + funcList = funcService.list() operationList = operationService.list() }) } diff --git a/src/main/kotlin/top/fatweb/api/service/permission/impl/RoleServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/permission/impl/RoleServiceImpl.kt index 970d9c1..7f2b3ce 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/impl/RoleServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/impl/RoleServiceImpl.kt @@ -10,7 +10,7 @@ import top.fatweb.api.entity.permission.PowerRole import top.fatweb.api.entity.permission.Role import top.fatweb.api.mapper.permission.RoleMapper import top.fatweb.api.param.permission.role.* -import top.fatweb.api.service.permission.IElementService +import top.fatweb.api.service.permission.IFuncService import top.fatweb.api.service.permission.IMenuService import top.fatweb.api.service.permission.IPowerRoleService import top.fatweb.api.service.permission.IRoleService @@ -28,7 +28,7 @@ import top.fatweb.api.vo.permission.RoleWithPowerVo @Service class RoleServiceImpl( private val powerRoleService: IPowerRoleService, - private val elementService: IElementService, + private val funcService: IFuncService, private val menuService: IMenuService ) : ServiceImpl(), IRoleService { override fun getPage(roleGetParam: RoleGetParam?): PageVo { @@ -150,7 +150,7 @@ class RoleServiceImpl( private fun getElementParent(id: Long, parentIds: HashSet) { parentIds.add(id) - elementService.getById(id)?.parentId?.let { + funcService.getById(id)?.parentId?.let { getElementParent(it, parentIds) } } diff --git a/src/main/kotlin/top/fatweb/api/service/permission/impl/UserServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/permission/impl/UserServiceImpl.kt index 27627e9..de34c1b 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/impl/UserServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/impl/UserServiceImpl.kt @@ -38,7 +38,7 @@ class UserServiceImpl( private val userInfoService: IUserInfoService, private val moduleService: IModuleService, private val menuService: IMenuService, - private val elementService: IElementService, + private val funcService: IFuncService, private val operationService: IOperationService, private val userRoleService: IUserRoleService, private val userGroupService: IUserGroupService @@ -50,7 +50,7 @@ class UserServiceImpl( if (user.id == 0L) { user.modules = moduleService.list() user.menus = menuService.list() - user.elements = elementService.list() + user.funcs = funcService.list() user.operations = operationService.list() } diff --git a/src/main/kotlin/top/fatweb/api/vo/permission/PowerSetVo.kt b/src/main/kotlin/top/fatweb/api/vo/permission/PowerSetVo.kt index c6c2a2e..7f88490 100644 --- a/src/main/kotlin/top/fatweb/api/vo/permission/PowerSetVo.kt +++ b/src/main/kotlin/top/fatweb/api/vo/permission/PowerSetVo.kt @@ -1,7 +1,7 @@ package top.fatweb.api.vo.permission import io.swagger.v3.oas.annotations.media.Schema -import top.fatweb.api.vo.permission.base.ElementVo +import top.fatweb.api.vo.permission.base.FuncVo import top.fatweb.api.vo.permission.base.MenuVo import top.fatweb.api.vo.permission.base.ModuleVo import top.fatweb.api.vo.permission.base.OperationVo @@ -20,9 +20,9 @@ data class PowerSetVo( @Schema(description = "菜单列表") val menuList: List?, - @Schema(description = "页面元素列表") - val elementList: List?, - @Schema(description = "功能列表") + val funcList: List?, + + @Schema(description = "操作列表") val operationList: List? ) diff --git a/src/main/kotlin/top/fatweb/api/vo/permission/RoleWithPowerVo.kt b/src/main/kotlin/top/fatweb/api/vo/permission/RoleWithPowerVo.kt index 92ed33e..28cecf5 100644 --- a/src/main/kotlin/top/fatweb/api/vo/permission/RoleWithPowerVo.kt +++ b/src/main/kotlin/top/fatweb/api/vo/permission/RoleWithPowerVo.kt @@ -3,7 +3,7 @@ package top.fatweb.api.vo.permission import com.fasterxml.jackson.databind.annotation.JsonSerialize import com.fasterxml.jackson.databind.ser.std.ToStringSerializer import io.swagger.v3.oas.annotations.media.Schema -import top.fatweb.api.vo.permission.base.ElementVo +import top.fatweb.api.vo.permission.base.FuncVo import top.fatweb.api.vo.permission.base.MenuVo import top.fatweb.api.vo.permission.base.ModuleVo import top.fatweb.api.vo.permission.base.OperationVo @@ -38,9 +38,9 @@ data class RoleWithPowerVo( @Schema(description = "菜单列表") val menus: List?, - @Schema(description = "页面元素列表") - val elements: List?, - @Schema(description = "功能列表") + val funcs: List?, + + @Schema(description = "操作列表") val operations: List? ) diff --git a/src/main/kotlin/top/fatweb/api/vo/permission/UserWithPowerInfoVo.kt b/src/main/kotlin/top/fatweb/api/vo/permission/UserWithPowerInfoVo.kt index 11277db..bdc4aa6 100644 --- a/src/main/kotlin/top/fatweb/api/vo/permission/UserWithPowerInfoVo.kt +++ b/src/main/kotlin/top/fatweb/api/vo/permission/UserWithPowerInfoVo.kt @@ -59,9 +59,9 @@ data class UserWithPowerInfoVo( @Schema(description = "菜单列表") val menus: List?, - @Schema(description = "页面元素列表") - val elements: List?, - @Schema(description = "功能列表") + val funcs: List?, + + @Schema(description = "操作列表") val operations: List? ) \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/vo/permission/base/ElementVo.kt b/src/main/kotlin/top/fatweb/api/vo/permission/base/FuncVo.kt similarity index 67% rename from src/main/kotlin/top/fatweb/api/vo/permission/base/ElementVo.kt rename to src/main/kotlin/top/fatweb/api/vo/permission/base/FuncVo.kt index 0a24cca..66c0651 100644 --- a/src/main/kotlin/top/fatweb/api/vo/permission/base/ElementVo.kt +++ b/src/main/kotlin/top/fatweb/api/vo/permission/base/FuncVo.kt @@ -3,16 +3,16 @@ package top.fatweb.api.vo.permission.base import io.swagger.v3.oas.annotations.media.Schema /** - * Element value object + * Function value object * * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 */ -@Schema(description = "页面元素返回参数") -data class ElementVo( +@Schema(description = "功能返回参数") +data class FuncVo( val id: Long?, - @Schema(description = "元素名", example = "AddButton") + @Schema(description = "功能名", example = "AddButton") val name: String?, @Schema(description = "父 ID") diff --git a/src/main/kotlin/top/fatweb/api/vo/permission/base/OperationVo.kt b/src/main/kotlin/top/fatweb/api/vo/permission/base/OperationVo.kt index 0841273..efbde75 100644 --- a/src/main/kotlin/top/fatweb/api/vo/permission/base/OperationVo.kt +++ b/src/main/kotlin/top/fatweb/api/vo/permission/base/OperationVo.kt @@ -8,16 +8,16 @@ import io.swagger.v3.oas.annotations.media.Schema * @author FatttSnake, fatttsnake@gmail.com * @since 1.0.0 */ -@Schema(description = "功能返回参数") +@Schema(description = "操作返回参数") data class OperationVo( val id: Long?, - @Schema(description = "功能名", example = "Add User") + @Schema(description = "操作名", example = "Add User") val name: String?, - @Schema(description = "功能编码", example = "system:user:add") + @Schema(description = "操作编码", example = "system:user:add") val code: String?, - @Schema(description = "页面元素 ID") - val elementId: Long? + @Schema(description = "功能 ID") + val funcId: Long? ) diff --git a/src/main/resources/db/migration/R__Basic_data.sql b/src/main/resources/db/migration/R__Basic_data.sql index 3549d08..6c1892d 100644 --- a/src/main/resources/db/migration/R__Basic_data.sql +++ b/src/main/resources/db/migration/R__Basic_data.sql @@ -1,7 +1,7 @@ insert into t_power_type (id, name) values (1, 'module'), (2, 'menu'), - (3, 'element'), + (3, 'func'), (4, 'operation') as new_value on duplicate key update name = new_value.name; @@ -68,7 +68,7 @@ on duplicate key update name =new_value.name, url =new_value.url, parent_id =new_value.parent_id; -insert into t_element(id, name, menu_id, parent_id) +insert into t_func(id, name, menu_id, parent_id) values (1010100, '查询', 1010000, null), (1010200, '增加', 1010000, null), (1010300, '修改', 1010000, null), @@ -87,7 +87,7 @@ on duplicate key update name = new_value.name, menu_id = new_value.menu_id, parent_id = new_value.parent_id; -insert into t_operation(id, name, code, element_id) +insert into t_operation(id, name, code, func_id) values (1010101, '单个', 'system:user:query:one', 1010100), (1010102, '全部', 'system:user:query:all', 1010100), (1010103, '列表', 'system:user:query:list', 1010100), @@ -116,4 +116,4 @@ insert into t_operation(id, name, code, element_id) (1510101, '列表', 'system:log:query:all', 1510100) as new_value on duplicate key update name=new_value.name, code=new_value.code, - element_id=new_value.element_id; \ No newline at end of file + func_id=new_value.func_id; \ No newline at end of file diff --git a/src/main/resources/db/migration/V1_0_0_231026__Add_table_'t_element'.sql b/src/main/resources/db/migration/V1_0_0_231026__Add_table_'t_func'.sql similarity index 50% rename from src/main/resources/db/migration/V1_0_0_231026__Add_table_'t_element'.sql rename to src/main/resources/db/migration/V1_0_0_231026__Add_table_'t_func'.sql index 18e52d8..4951d9f 100644 --- a/src/main/resources/db/migration/V1_0_0_231026__Add_table_'t_element'.sql +++ b/src/main/resources/db/migration/V1_0_0_231026__Add_table_'t_func'.sql @@ -1,9 +1,9 @@ -drop table if exists t_element; +drop table if exists t_func; -create table if not exists t_element +create table if not exists t_func ( id bigint not null primary key, - name varchar(100) not null comment '元素名', + name varchar(100) not null comment '功能名', parent_id bigint null comment '父ID', menu_id bigint not null comment '菜单ID' -) comment '页面元素表'; \ No newline at end of file +) comment '功能表'; \ No newline at end of file diff --git a/src/main/resources/db/migration/V1_0_0_231027__Add_table_'t_operation'.sql b/src/main/resources/db/migration/V1_0_0_231027__Add_table_'t_operation'.sql index 94838be..4ffe588 100644 --- a/src/main/resources/db/migration/V1_0_0_231027__Add_table_'t_operation'.sql +++ b/src/main/resources/db/migration/V1_0_0_231027__Add_table_'t_operation'.sql @@ -3,7 +3,7 @@ drop table if exists t_operation; create table if not exists t_operation ( id bigint not null primary key, - name varchar(50) not null comment '功能名', - code varchar(50) null comment '功能编码', - element_id bigint not null comment '页面元素ID' -) comment '功能表'; \ No newline at end of file + name varchar(50) not null comment '操作名', + code varchar(50) null comment '操作编码', + func_id bigint not null comment '功能ID' +) comment '操作表'; \ No newline at end of file diff --git a/src/main/resources/mapper/permission/ElementMapper.xml b/src/main/resources/mapper/permission/ElementMapper.xml deleted file mode 100644 index 6711e5c..0000000 --- a/src/main/resources/mapper/permission/ElementMapper.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/main/resources/mapper/permission/FuncMapper.xml b/src/main/resources/mapper/permission/FuncMapper.xml new file mode 100644 index 0000000..f2211cb --- /dev/null +++ b/src/main/resources/mapper/permission/FuncMapper.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/main/resources/mapper/permission/OperationMapper.xml b/src/main/resources/mapper/permission/OperationMapper.xml index 5f354c9..6b683eb 100644 --- a/src/main/resources/mapper/permission/OperationMapper.xml +++ b/src/main/resources/mapper/permission/OperationMapper.xml @@ -5,6 +5,6 @@ - + diff --git a/src/main/resources/mapper/permission/RoleMapper.xml b/src/main/resources/mapper/permission/RoleMapper.xml index 6b1829e..df716e0 100644 --- a/src/main/resources/mapper/permission/RoleMapper.xml +++ b/src/main/resources/mapper/permission/RoleMapper.xml @@ -34,20 +34,20 @@ tmn.url as menu_url, tmn.parent_id as menu_parent_id, tmn.module_id as menu_module_id, - te.id as element_id, - te.name as element_name, - te.parent_id as element_parent_id, - te.menu_id as element_menu_id, + tf.id as func_id, + tf.name as func_name, + tf.parent_id as func_parent_id, + tf.menu_id as func_menu_id, t.id as operation_id, t.name as operation_name, t.code as operation_code, - t.element_id as operation_element_id + t.func_id as operation_func_id from (select * from t_role where deleted = 0) as t_role left join (select * from t_power_role where deleted = 0) as tpr on t_role.id = tpr.role_id left join t_power tp on tp.id = tpr.power_id left join t_module tm on tp.id = tm.id left join t_menu tmn on tp.id = tmn.id - left join t_element te on tp.id = te.id + left join t_func tf on tp.id = tf.id left join t_operation t on tp.id = t.id @@ -103,7 +103,7 @@ - + diff --git a/src/main/resources/mapper/permission/UserMapper.xml b/src/main/resources/mapper/permission/UserMapper.xml index d9b6541..d35e579 100644 --- a/src/main/resources/mapper/permission/UserMapper.xml +++ b/src/main/resources/mapper/permission/UserMapper.xml @@ -32,14 +32,14 @@ tm.name as menu_name, tm.url as menu_url, tm.parent_id as menu_parent_id, - te.id as element_id, - te.name as element_name, - te.parent_id as element_parent_id, - te.menu_id as element_menu_id, + tf.id as func_id, + tf.name as func_name, + tf.parent_id as func_parent_id, + tf.menu_id as func_menu_id, t.id as operation_id, t.name as operation_name, t.code as operation_code, - t.element_id as operation_element_id + t.func_id as operation_func_id from t_user left join (select * from t_user_info where deleted = 0) as tui on t_user.id = tui.user_id left join (select * from t_user_group where deleted = 0) as tug on t_user.id = tug.user_id @@ -52,7 +52,7 @@ left join t_power as tp on tp.id = tpr.power_id left join t_module as tmo on tp.id = tmo.id left join t_menu as tm on tp.id = tm.id - left join t_element as te on tp.id = te.id + left join t_func as tf on tp.id = tf.id left join t_operation as t on tp.id = t.id where t_user.deleted = 0 and t_user.username = #{username}; @@ -276,7 +276,7 @@ - +