From 158b3be9024917bc5798486777dead4dd167abc7 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 03 七月 2024 18:26:43 +0800
Subject: [PATCH] bug修改

---
 src/main/java/com/taoke/autopay/service/impl/SystemConfigServiceImpl.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/taoke/autopay/service/impl/SystemConfigServiceImpl.java b/src/main/java/com/taoke/autopay/service/impl/SystemConfigServiceImpl.java
index 2e33367..d02655a 100644
--- a/src/main/java/com/taoke/autopay/service/impl/SystemConfigServiceImpl.java
+++ b/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);
+        }
+    }
+
 
 }

--
Gitblit v1.8.0