yujian
2019-06-25 491f5c8e304f2ad4d26e261f536ae98f1705772b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.yeshi.fanli.service.impl.tlj;
 
import javax.annotation.Resource;
 
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
 
import com.yeshi.fanli.dao.mybatis.tlj.ConfigTaoLiJinMapper;
import com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
 
@Service
public class ConfigTaoLiJinServiceImpl implements ConfigTaoLiJinService{
 
    @Resource
    private ConfigTaoLiJinMapper configTaoLiJinMapper;
 
    @Override
    public ConfigTaoLiJin getByKey(String key) {
        return configTaoLiJinMapper.getByKey(key);
    }
 
    
    @Override
    @Cacheable(value = "config", key = "'getValueByKey-' + #key")
    public String getValueByKey(String key) {
        ConfigTaoLiJin config = configTaoLiJinMapper.getByKey(key);
        if(config != null) {
            return config.getValue();
        }
        return null;
    }
 
    
    
}