Browse Source

添加系统参数RPC接口 修改util

NorthLan 6 years ago
parent
commit
2477945932

+ 12 - 4
zen-api/src/main/kotlin/com/gxzc/zen/api/sys/model/SysParam.kt

@@ -22,13 +22,21 @@ open class SysParam : BaseModel() {
      */
     var value: String? = null
     /**
-     * 标签
+     * 扩展字段1
      */
-    var label: String? = null
+    var ext1: String? = null
     /**
-     * 扩展字段
+     * 扩展字段2
      */
-    var extend: String? = null
+    var ext2: String? = null
+    /**
+     * 扩展字段3
+     */
+    var ext3: String? = null
+    /**
+     * 扩展字段4
+     */
+    var ext4: String? = null
     /**
      * 排序号
      */

+ 26 - 34
zen-api/src/main/kotlin/com/gxzc/zen/api/util/SysParamUtil.kt

@@ -1,34 +1,26 @@
-//package com.gxzc.zen.api.util
-//
-//import com.gxzc.zen.api.sys.model.SysParam
-//import com.gxzc.zen.api.sys.service.ISysParamService
-//import com.gxzc.zen.common.util.SpringContextHolder
-//
-///**
-// * 系统参数工具类
-// * 缓存中获取
-// * @author NorthLan
-// * @date 2018/3/19
-// * @url https://noahlan.com
-// */
-//object SysParamUtil {
-//    private var sysParamService: ISysParamService? = SpringContextHolder.getBean(ISysParamService::class.java)
-//        get() {
-//            if (field == null) {
-//                field = SpringContextHolder.getBean(ISysParamService::class.java)
-//            }
-//            return field
-//        }
-//
-//    fun getAllList(): MutableList<SysParam> {
-//        return sysParamService!!.getListCacheable()
-//    }
-//
-//    fun getListByKey(key: String): MutableList<SysParam> {
-//        return sysParamService!!.getListByKey(key)
-//    }
-//
-//    fun getOne(key: String, value: String?, sort: Int?): SysParam? {
-//        return sysParamService!!.getOneByKey(key, value, sort)
-//    }
-//}
+package com.gxzc.zen.api.util
+
+import com.gxzc.zen.api.sys.model.SysParam
+import com.gxzc.zen.common.util.SpringContextHolder
+import com.gxzc.zen.rpc.api.sys.RParamService
+
+/**
+ * 系统参数工具类
+ * 缓存中获取
+ * @author NorthLan
+ * @date 2018/3/19
+ * @url https://noahlan.com
+ */
+object SysParamUtil {
+    private var sysParamService: RParamService? = null
+        get() {
+            if (field == null) {
+                field = SpringContextHolder.getBean(RParamService::class.java)
+            }
+            return field
+        }
+
+    fun getByKey(key: String): SysParam? {
+        return sysParamService!!.getByKey(key)
+    }
+}

+ 2 - 1
zen-web/src/main/resources/dubbo/dubbo-consumer.xml

@@ -7,5 +7,6 @@
     http://code.alibabatech.com/schema/dubbo
     http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
 
-    <dubbo:reference id="rDictService" interface="com.gxzc.zen.rpc.api.sys.RDictService" version="1.0" />
+    <dubbo:reference id="rDictService" interface="com.gxzc.zen.rpc.api.sys.RDictService" version="1.0"/>
+    <dubbo:reference id="rParamService" interface="com.gxzc.zen.rpc.api.sys.RParamService" version="1.0"/>
 </beans>