OrganizationService.java
2.01 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
69
70
71
72
73
74
75
76
77
78
package cn.com.glsx.usercenter.api.feign;
import cn.com.glsx.usercenter.api.dto.response.Organization;
import cn.com.glsx.usercenter.api.feign.factory.OrganizationServiceFallbackFactory;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
@FeignClient(
name = "${feign.usercenter.name}",
path = "${feign.usercenter.path}" + "/org",
contextId = "feignorgz",
fallbackFactory = OrganizationServiceFallbackFactory.class,
decode404 = true
)
public interface OrganizationService {
/**
* 根据userId获取租户机构
*
* @param userId
* @return
*/
@GetMapping(value = "/getTenantPathsByUserId")
R<List<Organization>> getTenantPathsByUserId(@RequestParam("userId") Long userId);
/**
* 根据userIds获取租户机构
*
* @param userIds
* @return
*/
@GetMapping(value = "/getTenantByUserIds")
R<List<Organization>> getTenantByUserIds(@RequestParam("userIds") List<Long> userIds);
/**
* 获取根组织层级
*
* @return
*/
@GetMapping(value = "/getRootOrgs")
R<List<Organization>> getRootOrganizations();
/**
* 获取下级组织
*
* @param orgId
* @return
*/
@GetMapping(value = "/getSubOrgsBySuperiorId")
R<List<Organization>> getSubOrganizations(@RequestParam("orgId") Long orgId);
/**
* 根据用户id获取组织层级
*
* @param userIds
* @return
*/
@GetMapping(value = "/getOrgsByUserIds")
R<List<Organization>> getOrgsByUserIds(@RequestParam("userIds") Collection<Long> userIds);
/**
* 获取特定层级的机构
*
* @param level
* @return
*/
@GetMapping(value = "/getSpecialLevelOrgs")
R<List<Organization>> getSpecialLevelOrganizations(@RequestParam("level") Integer level);
}