package com.yeshi.fanli.service.impl.common;
|
|
import com.yeshi.fanli.dao.mybatis.common.CommonConfigMapper;
|
import com.yeshi.fanli.entity.config.CommonConfig;
|
import com.yeshi.fanli.service.inter.common.CommonConfigService;
|
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
@Service
|
public class CommonConfigServiceImpl implements CommonConfigService {
|
|
@Resource
|
private CommonConfigMapper commonConfigMapper;
|
|
@Override
|
public String getValue(String key) {
|
CommonConfig config = commonConfigMapper.selectByKey(key);
|
if (config == null)
|
return null;
|
return config.getValue();
|
}
|
|
@Cacheable(value = "config", key = "'Common-getValue-'+#key")
|
@Override
|
public String getValueCache(String key) {
|
return getValue(key);
|
}
|
}
|