guoyuji
2024-03-22 73be6b08f5a94e71550fe788c5d74705daa91be0
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;
    }
 
 
 
}