wuyouming666
2024-04-18 e8d3676793d4194485afec7940aaf355af594901
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;
    }
 
 
 
}