diff --git a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/SysResourceServiceImpl.java b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/SysResourceServiceImpl.java index c12bd05ad..eac954c6e 100644 --- a/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/SysResourceServiceImpl.java +++ b/kernel-s-system/system-business-resource/src/main/java/cn/stylefeng/roses/kernel/system/modular/resource/service/impl/SysResourceServiceImpl.java @@ -31,16 +31,15 @@ import cn.stylefeng.roses.kernel.auth.api.LoginUserApi; import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; import cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleRoleInfo; import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; +import cn.stylefeng.roses.kernel.db.api.context.DbOperatorContext; import cn.stylefeng.roses.kernel.db.api.factory.PageFactory; import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory; -import cn.stylefeng.roses.kernel.db.api.pojo.druid.DruidProperties; import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult; import cn.stylefeng.roses.kernel.rule.constants.RuleConstants; import cn.stylefeng.roses.kernel.rule.constants.TreeConstants; import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum; import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum; import cn.stylefeng.roses.kernel.rule.tree.factory.DefaultTreeBuildFactory; -import cn.stylefeng.roses.kernel.rule.util.DatabaseTypeUtil; import cn.stylefeng.roses.kernel.scanner.api.ResourceReportApi; import cn.stylefeng.roses.kernel.scanner.api.pojo.resource.ReportResourceParam; import cn.stylefeng.roses.kernel.scanner.api.pojo.resource.ResourceDefinition; @@ -90,9 +89,6 @@ public class SysResourceServiceImpl extends ServiceImpl resourceCache; - @Resource - private DruidProperties druidProperties; - @Override public PageResult findPage(ResourceRequest resourceRequest) { LambdaQueryWrapper wrapper = createWrapper(resourceRequest); @@ -306,7 +302,7 @@ public class SysResourceServiceImpl extends ServiceImpl> roleResourceCacheApi; - @Resource - private DruidProperties druidProperties; - @Override @Transactional(rollbackFor = Exception.class) public void grantResource(SysRoleRequest sysRoleRequest) { @@ -151,7 +147,7 @@ public class SysRoleResourceServiceImpl extends ServiceImpl sysRoleResourceList) { - DbTypeEnum currentDbType = DatabaseTypeUtil.getDbType(druidProperties.getUrl()); + DbTypeEnum currentDbType = DbOperatorContext.me().getCurrentDbType(); if (DbTypeEnum.MYSQL.equals(currentDbType)) { this.getBaseMapper().insertBatchSomeColumn(sysRoleResourceList); } else {