2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
37
38
39
40
41
42
43
44
45
46
47
48
package com.landtool.lanbase.modules.res.redis;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import com.landtool.lanbase.common.utils.RedisUtils;
import com.landtool.lanbase.modules.res.entity.Res_Catalog; 
 
/**
 * @author lxb
 * @Description: TODO()
 * @date 2018-12-16 15:44
 */
@Component
public class ResCatalogRedis {
 
    private static final String NAME="ResCatalog:";
 
    @Autowired
    private RedisUtils redisUtils;
 
    public void saveOrUpdate(Res_Catalog catalog) {
        if(catalog==null){
            return ;
        }
 
        String id=NAME+catalog.getCatlogid();
        redisUtils.set(id, catalog); 
        
    }
 
    public void delete(Res_Catalog catalog) {
        if(catalog==null){
            return ;
        }
 
        redisUtils.delete(NAME+catalog.getCatlogid()); 
    }
    
    public void delete(int catalogid) {
        redisUtils.delete(NAME+catalogid);
    }
 
    public  Res_Catalog get(Object key){
        return redisUtils.get(NAME+key, Res_Catalog.class);
    }
 
}