Optimize role
This commit is contained in:
@@ -2,10 +2,7 @@ package top.fatweb.api.service.permission
|
||||
|
||||
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.RoleChangeStatusParam
|
||||
import top.fatweb.api.param.authentication.RoleGetParam
|
||||
import top.fatweb.api.param.authentication.RoleUpdateParam
|
||||
import top.fatweb.api.param.authentication.*
|
||||
import top.fatweb.api.vo.PageVo
|
||||
import top.fatweb.api.vo.permission.RoleVo
|
||||
import top.fatweb.api.vo.permission.RoleWithPowerVo
|
||||
@@ -28,4 +25,8 @@ interface IRoleService : IService<Role> {
|
||||
fun update(roleUpdateParam: RoleUpdateParam): RoleVo?
|
||||
|
||||
fun changeStatus(roleChangeStatusParam: RoleChangeStatusParam): Boolean
|
||||
|
||||
fun deleteOne(id: Long)
|
||||
|
||||
fun delete(roleDeleteParam: RoleDeleteParam)
|
||||
}
|
||||
|
||||
@@ -9,10 +9,7 @@ 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.RoleChangeStatusParam
|
||||
import top.fatweb.api.param.authentication.RoleGetParam
|
||||
import top.fatweb.api.param.authentication.RoleUpdateParam
|
||||
import top.fatweb.api.param.authentication.*
|
||||
import top.fatweb.api.service.permission.IPowerRoleService
|
||||
import top.fatweb.api.service.permission.IRoleService
|
||||
import top.fatweb.api.util.PageUtil
|
||||
@@ -124,4 +121,15 @@ class RoleServiceImpl(
|
||||
override fun changeStatus(roleChangeStatusParam: RoleChangeStatusParam): Boolean {
|
||||
return updateById(RoleConverter.roleChangeStatusParamToRole(roleChangeStatusParam))
|
||||
}
|
||||
|
||||
@Transactional
|
||||
override fun deleteOne(id: Long) {
|
||||
this.delete(RoleDeleteParam(listOf(id)))
|
||||
}
|
||||
|
||||
@Transactional
|
||||
override fun delete(roleDeleteParam: RoleDeleteParam) {
|
||||
baseMapper.deleteBatchIds(roleDeleteParam.ids)
|
||||
powerRoleService.remove(KtQueryWrapper(PowerRole()).`in`(PowerRole::roleId, roleDeleteParam.ids))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user