SysParamUtil.kt 974 B

12345678910111213141516171819202122232425262728293031323334
  1. package com.gxzc.zen.api.util
  2. import com.gxzc.zen.api.sys.model.SysParam
  3. import com.gxzc.zen.api.sys.service.ISysParamService
  4. import com.gxzc.zen.common.util.SpringContextHolder
  5. /**
  6. * 系统参数工具类
  7. * 缓存中获取
  8. * @author NorthLan
  9. * @date 2018/3/19
  10. * @url https://noahlan.com
  11. */
  12. object SysParamUtil {
  13. private var sysParamService: ISysParamService? = SpringContextHolder.getBean(ISysParamService::class.java)
  14. get() {
  15. if (field == null) {
  16. field = SpringContextHolder.getBean(ISysParamService::class.java)
  17. }
  18. return field
  19. }
  20. fun getAllList(): MutableList<SysParam> {
  21. return sysParamService!!.getListCacheable()
  22. }
  23. fun getListByKey(key: String): MutableList<SysParam> {
  24. return sysParamService!!.getListByKey(key)
  25. }
  26. fun getOne(key: String, value: String?, sort: Int?): SysParam? {
  27. return sysParamService!!.getOneByKey(key, value, sort)
  28. }
  29. }