xuefei
2023-08-08 6c764f473b1e0e9dd2fb13034fe0d7295ab3724e
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
package cn.exrick.xboot.core.service;
 
import cn.exrick.xboot.core.entity.Setting;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
 
 
/**
 * 配置接口
 * @author Exrick
 */
@CacheConfig(cacheNames = "setting")
public interface SettingService {
 
    /**
     * 通过id获取
     * @param id
     * @return
     */
    @Cacheable(key = "#id")
    Setting get(String id);
 
    /**
     * 修改
     * @param setting
     * @return
     */
    @CacheEvict(key = "#setting.id")
    Setting saveOrUpdate(Setting setting);
}