12345678910111213141516171819202122232425262728293031323334 |
- 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)
- }
- }
|