summaryrefslogtreecommitdiff
path: root/src/main/java/com/mesasoft/cn/service/impl/ConfigServiceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/mesasoft/cn/service/impl/ConfigServiceImpl.java')
-rw-r--r--src/main/java/com/mesasoft/cn/service/impl/ConfigServiceImpl.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main/java/com/mesasoft/cn/service/impl/ConfigServiceImpl.java b/src/main/java/com/mesasoft/cn/service/impl/ConfigServiceImpl.java
new file mode 100644
index 0000000..1de92b2
--- /dev/null
+++ b/src/main/java/com/mesasoft/cn/service/impl/ConfigServiceImpl.java
@@ -0,0 +1,33 @@
+package com.mesasoft.cn.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.mesasoft.cn.SketchApplication;
+import com.mesasoft.cn.modules.constant.ConfigConsts;
+import com.mesasoft.cn.service.IConfigService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author pantao
+ * @since 2018/1/22
+ */
+@Service
+public class ConfigServiceImpl implements IConfigService {
+
+ @Override
+ public String getGlobalConfig() {
+ JSONObject jsonObject = (JSONObject) SketchApplication.settings.getObjectUseEval(ConfigConsts
+ .GLOBAL_OF_SETTINGS).clone();
+ jsonObject.remove(ConfigConsts.UPLOAD_PATH_OF_GLOBAL);
+ jsonObject.remove(ConfigConsts.TOKEN_PATH_OF_GLOBAL);
+ jsonObject.remove(ConfigConsts.UPLOAD_FORM_OF_SETTING);
+ return jsonObject.toString();
+ }
+
+ @Override
+ public String getUserConfig() {
+ JSONObject jsonObject = (JSONObject) SketchApplication.settings.getObjectUseEval(ConfigConsts.USER_OF_SETTINGS)
+ .clone();
+ jsonObject.remove(ConfigConsts.EMAIL_CONFIG_OF_USER);
+ return jsonObject.toString();
+ }
+}