diff options
author | 2021-12-28 10:14:42 +0800 | |
---|---|---|
committer | 2022-08-11 20:18:53 +0800 | |
commit | a796bda2f8e2db093ce9f528f6e5960e4aa1b22c (patch) | |
tree | 04642b9f3be109a5ccc051e4876851aa0b4fa3f3 /rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java | |
parent | 71ad58788ebfd666f6922fd9c16f77a9a4e39e27 (diff) |
Migrate from DW to Springboot
Issue-ID: HOLMES-511
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
Change-Id: I1be0775a4fc8b754218cd584a5de7af96b2ee0e2
Diffstat (limited to 'rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java')
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java index 0ad836f..1d245f8 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleQueryWrapper.java @@ -16,37 +16,28 @@ package org.onap.holmes.rulemgt.wrapper; -import org.jvnet.hk2.annotations.Service; import org.onap.holmes.common.api.entity.CorrelationRule; import org.onap.holmes.common.exception.CorrelationException; -import org.onap.holmes.common.utils.DbDaoUtil; -import org.onap.holmes.rulemgt.db.CorrelationRuleDao; +import org.onap.holmes.rulemgt.db.CorrelationRuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; -import javax.inject.Inject; import java.util.List; @Service public class RuleQueryWrapper { - @Inject - private DbDaoUtil daoUtil; - private CorrelationRuleDao correlationRuleDao; + @Autowired + private CorrelationRuleService correlationRuleService; - @PostConstruct - public void initDaoUtil() { - correlationRuleDao = daoUtil.getJdbiDaoByOnDemand(CorrelationRuleDao.class); - } - public List<CorrelationRule> queryRuleByEnable(int enable) throws CorrelationException { - List<CorrelationRule> ruleTemp = daoUtil.getJdbiDaoByOnDemand(CorrelationRuleDao.class) - .queryRuleByRuleEnable(enable); + public List<CorrelationRule> queryRuleByEnable(int enable) { + List<CorrelationRule> ruleTemp = correlationRuleService.queryRuleByRuleEnable(enable); return ruleTemp; } public List<CorrelationRule> queryRuleByEngineInstance(String instance) throws CorrelationException { - List<CorrelationRule> ruleTemp = daoUtil.getJdbiDaoByOnDemand(CorrelationRuleDao.class) - .queryRuleByRuleEngineInstance(instance); + List<CorrelationRule> ruleTemp = correlationRuleService.queryRuleByRuleEngineInstance(instance); return ruleTemp; } } |