|
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl
|
|
|
import com.gxzc.zen.api.sys.mapper.SysResourceMapper
|
|
|
import com.gxzc.zen.api.sys.model.SysResource
|
|
|
import com.gxzc.zen.api.sys.service.ISysPermissionService
|
|
|
+import com.gxzc.zen.api.sys.service.ISysResourceRoleService
|
|
|
import com.gxzc.zen.api.sys.service.ISysResourceService
|
|
|
import com.gxzc.zen.common.exception.ZenException
|
|
|
import com.gxzc.zen.common.exception.ZenExceptionEnum
|
|
|
+import com.gxzc.zen.orm.annotation.ZenTransactional
|
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
|
import org.springframework.stereotype.Service
|
|
|
|
|
@@ -24,6 +26,9 @@ class SysResourceServiceImpl : ServiceImpl<SysResourceMapper, SysResource>(), IS
|
|
|
@Autowired
|
|
|
private lateinit var permissionService: ISysPermissionService
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private lateinit var resourceRoleService: ISysResourceRoleService
|
|
|
+
|
|
|
override fun getResourcesByRoleIds(roleIds: List<Long>): MutableList<SysResource> {
|
|
|
return baseMapper.selectByRoleIds(roleIds)
|
|
|
}
|
|
@@ -62,8 +67,11 @@ class SysResourceServiceImpl : ServiceImpl<SysResourceMapper, SysResource>(), IS
|
|
|
return sysResource
|
|
|
}
|
|
|
|
|
|
+ @ZenTransactional
|
|
|
override fun deleteResourceById(id: Long) {
|
|
|
baseMapper.physicalDeleteById(id)
|
|
|
+ // 还要同时删掉 sys_resource_role 对应id的记录
|
|
|
+ resourceRoleService.physicalDeleteByResourceId(id)
|
|
|
////
|
|
|
permissionService.updateAllSysPermission()
|
|
|
permissionService.updateAllSessionPermission()
|