admin
2024-10-30 010ef2a907e66efd4702443c06cdd18f8a7ffa5b
src/main/java/com/yeshi/buwan/service/imp/DetailSystemConfigService.java
@@ -36,6 +36,10 @@
        return configDao.list(systemId, key);
    }
    public List<DetailSystemConfig> listConfigByValue(Long systemId, String value) {
        return configDao.listByValue(systemId, value);
    }
    @Cacheable(value = "configCache", key = "'getConfigAsMap-'+#system.id+'-'+#version")
    public Map<String, String> getConfigAsMap(DetailSystem system, int version) {
        Map<String, String> map = new HashMap<String, String>();
@@ -50,6 +54,14 @@
        return configDao.selectByKey(key, Long.parseLong(system.getId()), version);
    }
    @Cacheable(value = "configCache", key = "'getConfigValueByKey-'+#key+'-'+#detailSystemId+'-'+#version")
    public String getConfigValueByKey(String key, String detailSystemId, int version) {
        DetailSystemConfig detailSystemConfig = configDao.selectByKey(key, Long.parseLong(detailSystemId), version);
        if (detailSystemConfig == null)
            return null;
        return detailSystemConfig.getValue();
    }
    // 更新某个配置文件
    public void updateConfig(final DetailSystemConfig cg) {
        configDao.excute(new HibernateCallback() {