Optimize role

This commit is contained in:
2023-11-14 18:08:51 +08:00
parent a1844973fa
commit f86028a449
20 changed files with 115 additions and 16 deletions

View File

@@ -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))
}
}