guoyuji
2024-04-24 9b9a62a2b23b3dd86c8b87be3b790f4ae9d0849a
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.example.erp.common;
 
import com.example.erp.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;
    }
 
 
 
}