|
@@ -2,12 +2,8 @@ package com.jiayue.ipfcst.spare2.baseinfos.service;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.jiayue.ipfcst.common.data.entity.SysParameter;
|
|
import com.jiayue.ipfcst.common.data.entity.SysParameter;
|
|
-import com.jiayue.ipfcst.common.data.entity.SysParameter;
|
|
|
|
import com.jiayue.ipfcst.spare2.base4.BaseService;
|
|
import com.jiayue.ipfcst.spare2.base4.BaseService;
|
|
-import com.jiayue.ipfcst.spare2.baseinfos.repository.SysParameterRepository;
|
|
|
|
-import com.jiayue.ipfcst.spare2.baseinfos.repository.SysParameterRepository;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -17,11 +13,12 @@ import java.util.Optional;
|
|
@Slf4j
|
|
@Slf4j
|
|
public class SysParameterService extends BaseService {
|
|
public class SysParameterService extends BaseService {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- SysParameterRepository sysParameterRepository;
|
|
|
|
-
|
|
|
|
private final String cacheKey = SysParameter.class.getSimpleName();
|
|
private final String cacheKey = SysParameter.class.getSimpleName();
|
|
|
|
|
|
|
|
+ public String findValueByKey(String key, String defaultValue) throws Exception {
|
|
|
|
+ return getSysParameter(key, defaultValue);
|
|
|
|
+ }
|
|
|
|
+
|
|
public SysParameter findById(String id) throws Exception {
|
|
public SysParameter findById(String id) throws Exception {
|
|
List<SysParameter> list = findAll();
|
|
List<SysParameter> list = findAll();
|
|
Optional<SysParameter> optional = list.stream().filter(t -> ObjectUtil.equal(t.getId(), id)).findFirst();
|
|
Optional<SysParameter> optional = list.stream().filter(t -> ObjectUtil.equal(t.getId(), id)).findFirst();
|