zhoushihao
2024-03-27 6fc499a266240a0087f2d62ce0ef0be2b85db5b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.mes.common;
 
import com.mes.controller.dto.UserDTO;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;
 
@Component
public class CacheUtil {
    @Cacheable(value="users", key="#id")
    public UserDTO getCacheData(String id){
        return null;
    }
 
    @Cacheable(value="users", key="#userDTO.getUserId()")
    public UserDTO setCacheData(UserDTO userDTO){
 
        return userDTO;
    }
 
 
 
}