郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.gkhy.safePlatform.account.service;
 
import com.gkhy.safePlatform.account.entity.enterprise.DepartmentInfoDO;
import com.gkhy.safePlatform.account.entity.user.MenuInfoDO;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import org.springframework.security.core.GrantedAuthority;
 
import java.util.List;
 
public interface RedisService {
 
    /**
     * @Description: 设置用户的缓存和过期时间
     */
    void setCacheUserAndExpireTime(String key, ContextCacheUser user, Long expireTime);
 
 
    /**
     * @Description: 设置权限缓存
     */
    void setCacheAuthorityAndExpireTime(String key, List<GrantedAuthority> authorities, Long expireTime);
 
    /**
     * @Description: 设置菜单的缓存和过期时间
     */
    void setCacheMenuAndExpireTime(String key, List<MenuInfoDO> menus, Long expireTime);
 
    /**
     * @Description: 设置部门的缓存和过期时间
     */
    void setCacheDepAndExpireTime(String key, List<DepartmentInfoDO> menus, Long expireTime);
 
    /**
     * @Description: 根据 key 获取用户缓存
     */
    String getCacheUserByKey(String key);
 
    /**
     * @Description: 根据 key 获取 菜单
     */
    String getCacheMenuByKey(String key);
 
    /**
     * @Description: 根据 key 获取 部门
     */
    String getCacheDepByKey(String key);
 
    /**
     * @Description: 根据 key 获取剩余 过期时间
     */
    Long  getLeftSecondsByKey(String key);
 
    /**
     * @Description: 重置 key 的 过期时间
     */
    void resetKeyExpireTime(String key,Long expireTime);
 
 
    /**
     * @Description: 根据 key 清除 缓存用户
     */
    void cleanCacheUserByKey(String key);
 
    /**
    * @Description: 根据 key 清除 用户权限
    */
    void cleanCacheAuthorityByKey(String key);
 
}