admin
2024-07-27 65aaf1c05bd06cefa82ebc40cc3e01cf4ac233c0
src/main/java/com/taoke/autopay/service/impl/SystemConfigServiceImpl.java
@@ -10,6 +10,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
@@ -65,6 +66,15 @@
        return get(key);
    }
    @Override
    public String getValue(SystemConfigKeyEnum key) {
        SystemConfig config = get(key);
        if (config != null) {
            return config.getValue();
        }
        return null;
    }
    @Cacheable(value = "configCache", key = "'getValueCache-'+#key")
    @Override
    public String getValueCache(SystemConfigKeyEnum key) {
@@ -81,5 +91,17 @@
    }
    @Override
    public void setValue(SystemConfigKeyEnum key, String val) {
        SystemConfig config = get(key);
        if (config != null) {
            SystemConfig update = new SystemConfig();
            update.setId(config.getId());
            update.setValue(val);
            update.setUpdateTime(new Date());
            systemConfigMapper.updateByPrimaryKeySelective(update);
        }
    }
}