AuthFeignClient.java
1.98 KB
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
package cn.com.glsx.auth.api;
import cn.com.glsx.auth.model.MenuPermission;
import cn.com.glsx.auth.model.SyntheticUser;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Set;
/**
* @author payu
*/
@FeignClient(name = "glsx-ne-shield-usercenter", contextId = "authcenter", path = "/usercenter/auth/")
public interface AuthFeignClient {
/**
* 嗅探token是否有效(走feign不走网关,走网关网关直接验证了,当需要判断token状态是否有效,可能会使用此接口)
*
* @return
*/
@GetMapping(value = "/sniff", consumes = MediaType.APPLICATION_JSON_VALUE)
R<Boolean> sniff();
/**
* 获取当前登录用户对应资源等权限
*
* @return
*/
@GetMapping(value = "/getAuthUser", consumes = MediaType.APPLICATION_JSON_VALUE)
R<SyntheticUser> getAuthUser();
/**
* 获取userId用户对应资源等权限
*
* @return
*/
@GetMapping(value = "/getAuthUserById", consumes = MediaType.APPLICATION_JSON_VALUE)
R<SyntheticUser> getAuthUserById(@RequestParam("userId") Long userId);
/**
* 获取当前登录用户角色数据权限内的部门id
*
* @return
*/
@GetMapping(value = "/getAuthDeptIds", consumes = MediaType.APPLICATION_JSON_VALUE)
R<Set<Long>> getAuthDeptIds();
/**
* 获取当前登录用户角色数据权限内的用户id
*
* @return
*/
@GetMapping(value = "/getAuthUserIds", consumes = MediaType.APPLICATION_JSON_VALUE)
R<Set<Long>> getAuthUserIds();
/**
* 获取当前登录用户角色授权的功能菜单
*
* @return
*/
@GetMapping(value = "/getPermMenus", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<MenuPermission>> getPermMenus();
}