diff --git a/src/main/kotlin/top/fatweb/api/controller/permission/GroupController.kt b/src/main/kotlin/top/fatweb/api/controller/permission/GroupController.kt new file mode 100644 index 0000000..fefe3a1 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/controller/permission/GroupController.kt @@ -0,0 +1,40 @@ +package top.fatweb.api.controller.permission + +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.tags.Tag +import jakarta.validation.Valid +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController +import top.fatweb.api.converter.permission.GroupConverter +import top.fatweb.api.entity.common.ResponseCode +import top.fatweb.api.entity.common.ResponseResult +import top.fatweb.api.param.authentication.GroupGetParam +import top.fatweb.api.service.permission.IGroupService +import top.fatweb.api.vo.PageVo +import top.fatweb.api.vo.permission.GroupVo + +/** + *

+ * 用户组表 前端控制器 + *

+ * + * @author FatttSnake + * @since 2023-11-09 + */ +@Tag(name = "用户组管理", description = "用户组管理相关接口") +@RestController +@RequestMapping("/system/group") +class GroupController( + val groupService: IGroupService +) { + @Operation(summary = "获取用户组列表") + @GetMapping + fun get(@Valid groupGetParam: GroupGetParam?): ResponseResult> { + return ResponseResult.success( + ResponseCode.DATABASE_SELECT_SUCCESS, data = GroupConverter.groupPageToGroupPageVo( + groupService.getPage(groupGetParam) + ) + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/controller/permission/RoleController.kt b/src/main/kotlin/top/fatweb/api/controller/permission/RoleController.kt new file mode 100644 index 0000000..32af4e6 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/controller/permission/RoleController.kt @@ -0,0 +1,47 @@ +package top.fatweb.api.controller.permission + +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.tags.Tag +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController +import top.fatweb.api.converter.permission.RoleConverter +import top.fatweb.api.entity.common.ResponseCode +import top.fatweb.api.entity.common.ResponseResult +import top.fatweb.api.param.authentication.RoleAddParam +import top.fatweb.api.param.authentication.RoleGetParam +import top.fatweb.api.service.permission.IRoleService +import top.fatweb.api.vo.PageVo +import top.fatweb.api.vo.permission.RoleVo + +/** + * 角色表 前端控制器 + * + * @author FatttSnake + * @since 2023-11-09 + */ +@Tag(name = "角色管理", description = "角色管理相关接口") +@RestController +@RequestMapping("/system/role") +class RoleController( + private val roleService: IRoleService +) { + @Operation(summary = "获取角色列表") + @GetMapping + fun get(roleGetParam: RoleGetParam?): ResponseResult> { + return ResponseResult.success( + ResponseCode.DATABASE_SELECT_SUCCESS, data = RoleConverter.rolePageToRolePageVo( + roleService.getPage(roleGetParam) + ) + ) + } + + @Operation(summary = "添加角色") + @PostMapping + fun add(roleAddParam: RoleAddParam): ResponseResult { + return roleService.add(roleAddParam) + ?.let { ResponseResult.success(ResponseCode.DATABASE_INSERT_SUCCESS, data = it) } + ?: let { ResponseResult.fail(ResponseCode.DATABASE_INSERT_FAILED) } + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/converter/permission/GroupConverter.kt b/src/main/kotlin/top/fatweb/api/converter/permission/GroupConverter.kt new file mode 100644 index 0000000..2b73ffd --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/converter/permission/GroupConverter.kt @@ -0,0 +1,22 @@ +package top.fatweb.api.converter.permission + +import com.baomidou.mybatisplus.core.metadata.IPage +import top.fatweb.api.entity.permission.Group +import top.fatweb.api.vo.PageVo +import top.fatweb.api.vo.permission.GroupVo + +object GroupConverter { + fun groupPageToGroupPageVo(groupPage: IPage): PageVo = PageVo( + groupPage.total, + groupPage.pages, + groupPage.size, + groupPage.current, + groupPage.records.map { + GroupVo( + id = it.id, + name = it.name, + enable = it.enable == 1 + ) + } + ) +} \ 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 new file mode 100644 index 0000000..2a0924f --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/converter/permission/RoleConverter.kt @@ -0,0 +1,36 @@ +package top.fatweb.api.converter.permission + +import com.baomidou.mybatisplus.core.metadata.IPage +import top.fatweb.api.entity.permission.Power +import top.fatweb.api.entity.permission.Role +import top.fatweb.api.param.authentication.RoleAddParam +import top.fatweb.api.vo.PageVo +import top.fatweb.api.vo.permission.RoleVo + +object RoleConverter { + fun rolePageToRolePageVo(rolePage: IPage): PageVo = PageVo( + rolePage.total, + rolePage.pages, + rolePage.size, + rolePage.current, + rolePage.records.map { + RoleVo( + id = it.id, + name = it.name, + enable = it.enable == 1 + ) + } + ) + + fun roleAddParamToRole(roleAddParam: RoleAddParam): Role = Role().apply { + name = roleAddParam.name + enable = if (roleAddParam.enable) 1 else 0 + powers = roleAddParam.powerIds?.map { Power().apply { id = it } } + } + + fun roleToRoleVo(role: Role): RoleVo = RoleVo( + id = role.id, + name = role.name, + enable = role.enable == 1 + ) +} \ 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 03565e9..65dcfb1 100644 --- a/src/main/kotlin/top/fatweb/api/entity/permission/Role.kt +++ b/src/main/kotlin/top/fatweb/api/entity/permission/Role.kt @@ -37,6 +37,9 @@ class Role : Serializable { @Version var version: Int? = null + @TableField(exist = false) + var modules: List? = null + @TableField(exist = false) var menus: List? = null @@ -50,6 +53,6 @@ class Role : Serializable { var powers: List? = null override fun toString(): String { - return "Role(id=$id, name=$name, enable=$enable, deleted=$deleted, version=$version, menus=$menus, elements=$elements, operations=$operations, powers=$powers)" + return "Role(id=$id, name=$name, enable=$enable, deleted=$deleted, version=$version, modules=$modules, menus=$menus, elements=$elements, operations=$operations, powers=$powers)" } } diff --git a/src/main/kotlin/top/fatweb/api/mapper/permission/GroupMapper.kt b/src/main/kotlin/top/fatweb/api/mapper/permission/GroupMapper.kt index 208f4a9..f42b78a 100644 --- a/src/main/kotlin/top/fatweb/api/mapper/permission/GroupMapper.kt +++ b/src/main/kotlin/top/fatweb/api/mapper/permission/GroupMapper.kt @@ -1,6 +1,7 @@ package top.fatweb.api.mapper.permission import com.baomidou.mybatisplus.core.mapper.BaseMapper +import com.baomidou.mybatisplus.core.metadata.IPage import org.apache.ibatis.annotations.Mapper import top.fatweb.api.entity.permission.Group @@ -13,4 +14,6 @@ import top.fatweb.api.entity.permission.Group * @since 2023-10-25 */ @Mapper -interface GroupMapper : BaseMapper +interface GroupMapper : BaseMapper { + fun selectPage(page: IPage): IPage +} diff --git a/src/main/kotlin/top/fatweb/api/mapper/permission/RoleMapper.kt b/src/main/kotlin/top/fatweb/api/mapper/permission/RoleMapper.kt index a7c8157..3c6bc49 100644 --- a/src/main/kotlin/top/fatweb/api/mapper/permission/RoleMapper.kt +++ b/src/main/kotlin/top/fatweb/api/mapper/permission/RoleMapper.kt @@ -1,6 +1,7 @@ package top.fatweb.api.mapper.permission import com.baomidou.mybatisplus.core.mapper.BaseMapper +import com.baomidou.mybatisplus.core.metadata.IPage import org.apache.ibatis.annotations.Mapper import top.fatweb.api.entity.permission.Role @@ -13,4 +14,6 @@ import top.fatweb.api.entity.permission.Role * @since 2023-10-25 */ @Mapper -interface RoleMapper : BaseMapper +interface RoleMapper : BaseMapper { + fun selectPage(page: IPage): IPage +} diff --git a/src/main/kotlin/top/fatweb/api/param/PageParam.kt b/src/main/kotlin/top/fatweb/api/param/PageSortParam.kt similarity index 66% rename from src/main/kotlin/top/fatweb/api/param/PageParam.kt rename to src/main/kotlin/top/fatweb/api/param/PageSortParam.kt index 1478722..ed10a0e 100644 --- a/src/main/kotlin/top/fatweb/api/param/PageParam.kt +++ b/src/main/kotlin/top/fatweb/api/param/PageSortParam.kt @@ -3,7 +3,7 @@ package top.fatweb.api.param import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.Min -open class PageParam { +open class PageSortParam { @Schema(description = "分页页码", example = "1", defaultValue = "1") @field:Min(1, message = "Pagination page number must be a positive integer") var currentPage: Long = 1 @@ -11,4 +11,10 @@ open class PageParam { @Schema(description = "分页大小", example = "20", defaultValue = "20") @field:Min(1, message = "The number of data per page must be a positive integer") var pageSize: Long = 20 + + @Schema(description = "排序字段", example = "id") + val sortField: String? = null + + @Schema(description = "排序方式", example = "desc", allowableValues = ["desc", "asc"]) + val sortOrder: String? = null } \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/param/authentication/GroupGetParam.kt b/src/main/kotlin/top/fatweb/api/param/authentication/GroupGetParam.kt new file mode 100644 index 0000000..f076290 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/param/authentication/GroupGetParam.kt @@ -0,0 +1,12 @@ +package top.fatweb.api.param.authentication + +import io.swagger.v3.oas.annotations.media.Schema +import top.fatweb.api.param.PageSortParam + +data class GroupGetParam( + @Schema(description = "查询用户组名称") + val searchName: String? = null, + + @Schema(description = "查询使用正则表达式") + val searchRegex: Boolean = false, +) : PageSortParam() diff --git a/src/main/kotlin/top/fatweb/api/param/authentication/RoleAddParam.kt b/src/main/kotlin/top/fatweb/api/param/authentication/RoleAddParam.kt new file mode 100644 index 0000000..ca80a38 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/param/authentication/RoleAddParam.kt @@ -0,0 +1,16 @@ +package top.fatweb.api.param.authentication + +import io.swagger.v3.oas.annotations.media.Schema +import jakarta.validation.constraints.NotBlank + +data class RoleAddParam( + @Schema(description = "角色名称") + @field:NotBlank + val name: String, + + @Schema(description = "启用") + val enable: Boolean = true, + + @Schema(description = "权限 ID 列表") + val powerIds: List? = null +) diff --git a/src/main/kotlin/top/fatweb/api/param/authentication/RoleGetParam.kt b/src/main/kotlin/top/fatweb/api/param/authentication/RoleGetParam.kt new file mode 100644 index 0000000..99e44e3 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/param/authentication/RoleGetParam.kt @@ -0,0 +1,12 @@ +package top.fatweb.api.param.authentication + +import io.swagger.v3.oas.annotations.media.Schema +import top.fatweb.api.param.PageSortParam + +data class RoleGetParam( + @Schema(description = "查询角色名称") + val searchName: String? = null, + + @Schema(description = "查询使用正则表达式") + val searchRegex: Boolean = false, +) : PageSortParam() diff --git a/src/main/kotlin/top/fatweb/api/param/system/SysLogGetParam.kt b/src/main/kotlin/top/fatweb/api/param/system/SysLogGetParam.kt index 929f2ae..c605079 100644 --- a/src/main/kotlin/top/fatweb/api/param/system/SysLogGetParam.kt +++ b/src/main/kotlin/top/fatweb/api/param/system/SysLogGetParam.kt @@ -2,17 +2,11 @@ package top.fatweb.api.param.system import io.swagger.v3.oas.annotations.media.Schema import org.springframework.format.annotation.DateTimeFormat -import top.fatweb.api.param.PageParam +import top.fatweb.api.param.PageSortParam import java.time.LocalDateTime @Schema(description = "获取系统日志请求参数") data class SysLogGetParam( - @Schema(description = "排序字段", example = "id") - val sortField: String? = null, - - @Schema(description = "排序方式", example = "desc", allowableValues = ["desc", "asc"]) - val sortOrder: String? = null, - @Schema(description = "类型过滤(多个使用逗号分隔)", example = "INFO", allowableValues = ["INFO", "ERROR"]) val logType: String? = null, @@ -36,4 +30,4 @@ data class SysLogGetParam( @Schema(description = "查询结束时间") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") val searchEndTime: LocalDateTime? = null -) : PageParam() \ No newline at end of file +) : PageSortParam() \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/service/permission/IGroupService.kt b/src/main/kotlin/top/fatweb/api/service/permission/IGroupService.kt index 7361f63..73c88b3 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/IGroupService.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/IGroupService.kt @@ -1,7 +1,9 @@ package top.fatweb.api.service.permission +import com.baomidou.mybatisplus.core.metadata.IPage import com.baomidou.mybatisplus.extension.service.IService import top.fatweb.api.entity.permission.Group +import top.fatweb.api.param.authentication.GroupGetParam /** *

@@ -11,4 +13,6 @@ import top.fatweb.api.entity.permission.Group * @author FatttSnake * @since 2023-10-25 */ -interface IGroupService : IService +interface IGroupService : IService { + fun getPage(groupGetParam: GroupGetParam?): IPage +} diff --git a/src/main/kotlin/top/fatweb/api/service/permission/IRoleService.kt b/src/main/kotlin/top/fatweb/api/service/permission/IRoleService.kt index afe7289..a019bc6 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/IRoleService.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/IRoleService.kt @@ -1,7 +1,11 @@ package top.fatweb.api.service.permission +import com.baomidou.mybatisplus.core.metadata.IPage import com.baomidou.mybatisplus.extension.service.IService import top.fatweb.api.entity.permission.Role +import top.fatweb.api.param.authentication.RoleAddParam +import top.fatweb.api.param.authentication.RoleGetParam +import top.fatweb.api.vo.permission.RoleVo /** *

@@ -11,4 +15,8 @@ import top.fatweb.api.entity.permission.Role * @author FatttSnake * @since 2023-10-25 */ -interface IRoleService : IService +interface IRoleService : IService { + fun getPage(roleGetParam: RoleGetParam?): IPage + + fun add(roleAddParam: RoleAddParam): RoleVo? +} diff --git a/src/main/kotlin/top/fatweb/api/service/permission/impl/GroupServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/permission/impl/GroupServiceImpl.kt index f7f5694..811464d 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/impl/GroupServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/impl/GroupServiceImpl.kt @@ -1,10 +1,14 @@ package top.fatweb.api.service.permission.impl +import com.baomidou.mybatisplus.core.metadata.IPage +import com.baomidou.mybatisplus.extension.plugins.pagination.Page import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl import org.springframework.stereotype.Service import top.fatweb.api.entity.permission.Group import top.fatweb.api.mapper.permission.GroupMapper +import top.fatweb.api.param.authentication.GroupGetParam import top.fatweb.api.service.permission.IGroupService +import top.fatweb.api.util.PageUtil /** *

@@ -15,4 +19,12 @@ import top.fatweb.api.service.permission.IGroupService * @since 2023-10-25 */ @Service -class GroupServiceImpl : ServiceImpl(), IGroupService +class GroupServiceImpl : ServiceImpl(), IGroupService { + override fun getPage(groupGetParam: GroupGetParam?): IPage { + val groupPage = Page(groupGetParam?.currentPage ?: 1, groupGetParam?.pageSize ?: 20) + + PageUtil.setPageSort(groupGetParam, groupPage) + + return baseMapper.selectPage(groupPage) + } +} 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 34ab16a..931d6d9 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 @@ -1,10 +1,20 @@ package top.fatweb.api.service.permission.impl +import com.baomidou.mybatisplus.core.metadata.IPage +import com.baomidou.mybatisplus.extension.plugins.pagination.Page import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl import org.springframework.stereotype.Service +import org.springframework.transaction.annotation.Transactional +import top.fatweb.api.converter.permission.RoleConverter +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.authentication.RoleAddParam +import top.fatweb.api.param.authentication.RoleGetParam +import top.fatweb.api.service.permission.IPowerRoleService import top.fatweb.api.service.permission.IRoleService +import top.fatweb.api.util.PageUtil +import top.fatweb.api.vo.permission.RoleVo /** *

@@ -15,4 +25,35 @@ import top.fatweb.api.service.permission.IRoleService * @since 2023-10-25 */ @Service -class RoleServiceImpl : ServiceImpl(), IRoleService +class RoleServiceImpl( + private val powerRoleService: IPowerRoleService +) : ServiceImpl(), IRoleService { + override fun getPage(roleGetParam: RoleGetParam?): IPage { + val rolePage = Page(roleGetParam?.currentPage ?: 1, roleGetParam?.pageSize ?: 20) + + PageUtil.setPageSort(roleGetParam, rolePage) + + return baseMapper.selectPage(rolePage) + } + + + @Transactional + override fun add(roleAddParam: RoleAddParam): RoleVo? { + val role = RoleConverter.roleAddParamToRole(roleAddParam) + if (baseMapper.insert(role) == 1) { + if (powerRoleService.saveBatch( + roleAddParam.powerIds?.map { + PowerRole().apply { + roleId = role.id + powerId = it + } + } + ) + ) { + return RoleConverter.roleToRoleVo(role) + } + } + + return null + } +} diff --git a/src/main/kotlin/top/fatweb/api/service/system/impl/SysLogServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/system/impl/SysLogServiceImpl.kt index 403b6a5..518983d 100644 --- a/src/main/kotlin/top/fatweb/api/service/system/impl/SysLogServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/api/service/system/impl/SysLogServiceImpl.kt @@ -9,7 +9,7 @@ import top.fatweb.api.entity.system.SysLog import top.fatweb.api.mapper.system.SysLogMapper import top.fatweb.api.param.system.SysLogGetParam import top.fatweb.api.service.system.ISysLogService -import top.fatweb.api.util.StrUtil +import top.fatweb.api.util.PageUtil /** *

@@ -24,20 +24,7 @@ class SysLogServiceImpl : ServiceImpl(), ISysLogService { override fun getPage(sysLogGetParam: SysLogGetParam?): IPage { val sysLogPage = Page(sysLogGetParam?.currentPage ?: 1, sysLogGetParam?.pageSize ?: 20) - if (sysLogGetParam?.sortField == null && sysLogGetParam?.sortOrder == null) { - sysLogPage.addOrder(OrderItem.desc("start_time")) - } else { - sysLogPage.addOrder( - if (sysLogGetParam.sortOrder?.startsWith( - "desc", true - ) == true - ) OrderItem.desc(StrUtil.upperToUnderLetter(sysLogGetParam.sortField)) else OrderItem.asc( - StrUtil.upperToUnderLetter( - sysLogGetParam.sortField - ) - ) - ) - } + PageUtil.setPageSort(sysLogGetParam, sysLogPage, OrderItem.desc("start_time")) return baseMapper.selectPage( sysLogPage, diff --git a/src/main/kotlin/top/fatweb/api/util/PageUtil.kt b/src/main/kotlin/top/fatweb/api/util/PageUtil.kt new file mode 100644 index 0000000..2d5c11a --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/util/PageUtil.kt @@ -0,0 +1,24 @@ +package top.fatweb.api.util + +import com.baomidou.mybatisplus.core.metadata.OrderItem +import com.baomidou.mybatisplus.extension.plugins.pagination.Page +import top.fatweb.api.param.PageSortParam + +object PageUtil { + fun > setPageSort(pageSortParam: PageSortParam?, page: T, defaultOrder: OrderItem? = null) { + if (pageSortParam?.sortField != null || pageSortParam?.sortOrder != null) { + page.addOrder( + if (pageSortParam.sortOrder?.startsWith( + "desc", true + ) == true + ) OrderItem.desc(StrUtil.upperToUnderLetter(pageSortParam.sortField)) else OrderItem.asc( + StrUtil.upperToUnderLetter( + pageSortParam.sortField + ) + ) + ) + } else { + defaultOrder?.let { page.addOrder(defaultOrder) } + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/vo/permission/RoleWithPowerVo.kt b/src/main/kotlin/top/fatweb/api/vo/permission/RoleWithPowerVo.kt new file mode 100644 index 0000000..da12b43 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/vo/permission/RoleWithPowerVo.kt @@ -0,0 +1,17 @@ +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 + +@Schema(description = "角色返回参数") +data class RoleWithPowerVo( + @JsonSerialize(using = ToStringSerializer::class) + val id: Long?, + + @Schema(description = "角色名", example = "Role") + val name: String?, + + @Schema(description = "启用", example = "true") + val enable: Boolean? +) diff --git a/src/main/resources/db/migration/R__Basic_data.sql b/src/main/resources/db/migration/R__Basic_data.sql index 61c4500..4a12727 100644 --- a/src/main/resources/db/migration/R__Basic_data.sql +++ b/src/main/resources/db/migration/R__Basic_data.sql @@ -6,7 +6,35 @@ insert into t_power_type (id, name) on duplicate key update name = new_value.name; insert into t_power (id, type_id) - values (1000000, 1) as new_value + values (1000000, 1), + (1990000, 2), + (1010000, 2), + (1020000, 2), + (1030000, 2), + (1010100, 3), + (1010200, 3), + (1010300, 3), + (1020100, 3), + (1020200, 3), + (1020300, 3), + (1020400, 3), + (1030100, 3), + (1030200, 3), + (1030300, 3), + (1030400, 3), + (1010101, 4), + (1010102, 4), + (1010201, 4), + (1010301, 4), + (1020101, 4), + (1020201, 4), + (1020301, 4), + (1020401, 4), + (1030101, 4), + (1030201, 4), + (1030301, 4), + (1030401, 4) + as new_value on duplicate key update type_id = new_value.type_id; insert into t_module (id, name, power_id) diff --git a/src/main/resources/mapper/permission/ElementMapper.xml b/src/main/resources/mapper/permission/ElementMapper.xml index f29cb9f..f0ee1c0 100644 --- a/src/main/resources/mapper/permission/ElementMapper.xml +++ b/src/main/resources/mapper/permission/ElementMapper.xml @@ -1,5 +1,11 @@ - + + + + + + + diff --git a/src/main/resources/mapper/permission/GroupMapper.xml b/src/main/resources/mapper/permission/GroupMapper.xml index 861ee18..5879801 100644 --- a/src/main/resources/mapper/permission/GroupMapper.xml +++ b/src/main/resources/mapper/permission/GroupMapper.xml @@ -1,5 +1,15 @@ + + + + + + + + + diff --git a/src/main/resources/mapper/permission/MenuMapper.xml b/src/main/resources/mapper/permission/MenuMapper.xml index aaf1664..22b998f 100644 --- a/src/main/resources/mapper/permission/MenuMapper.xml +++ b/src/main/resources/mapper/permission/MenuMapper.xml @@ -1,5 +1,12 @@ - + + + + + + + + diff --git a/src/main/resources/mapper/permission/ModuleMapper.xml b/src/main/resources/mapper/permission/ModuleMapper.xml index 4e9b314..36764b2 100644 --- a/src/main/resources/mapper/permission/ModuleMapper.xml +++ b/src/main/resources/mapper/permission/ModuleMapper.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/src/main/resources/mapper/permission/OperationMapper.xml b/src/main/resources/mapper/permission/OperationMapper.xml index 174b17b..50e1e15 100644 --- a/src/main/resources/mapper/permission/OperationMapper.xml +++ b/src/main/resources/mapper/permission/OperationMapper.xml @@ -1,5 +1,11 @@ - + + + + + + + diff --git a/src/main/resources/mapper/permission/PowerMapper.xml b/src/main/resources/mapper/permission/PowerMapper.xml index c9854f0..dde3f8c 100644 --- a/src/main/resources/mapper/permission/PowerMapper.xml +++ b/src/main/resources/mapper/permission/PowerMapper.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/src/main/resources/mapper/permission/RoleMapper.xml b/src/main/resources/mapper/permission/RoleMapper.xml index b84d046..2f9b5ac 100644 --- a/src/main/resources/mapper/permission/RoleMapper.xml +++ b/src/main/resources/mapper/permission/RoleMapper.xml @@ -1,5 +1,52 @@ + + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/permission/UserInfoMapper.xml b/src/main/resources/mapper/permission/UserInfoMapper.xml index 6ad303b..bdaf75a 100644 --- a/src/main/resources/mapper/permission/UserInfoMapper.xml +++ b/src/main/resources/mapper/permission/UserInfoMapper.xml @@ -1,5 +1,15 @@ - + + + + + + + + + + + diff --git a/src/main/resources/mapper/permission/UserMapper.xml b/src/main/resources/mapper/permission/UserMapper.xml index 1102e10..248568e 100644 --- a/src/main/resources/mapper/permission/UserMapper.xml +++ b/src/main/resources/mapper/permission/UserMapper.xml @@ -125,65 +125,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - + + +