WeUserClient.java
3.71 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package com.linkwechat.wecom.client;
import com.dtflys.forest.annotation.*;
import com.linkwechat.wecom.domain.dto.*;
import com.linkwechat.wecom.domain.dto.customer.AllocateGroupDto;
import com.linkwechat.wecom.domain.dto.customer.JobExtendsCustomer;
import com.linkwechat.wecom.interceptor.WeAccessTokenInterceptor;
import com.linkwechat.wecom.interceptor.WeAppAccessTokenInterceptor;
import com.linkwechat.wecom.interceptor.WeCommonAccessTokenInterceptor;
import com.linkwechat.wecom.retry.WeCommonRetryWhen;
/**
* @description: 企业微信通讯录成员
* @author: HaoN
* @create: 2020-08-27 16:42
**/
@BaseRequest(baseURL = "${weComServerUrl}${weComePrefix}", interceptor = WeCommonAccessTokenInterceptor.class)
@Retry(maxRetryCount = "3", maxRetryInterval = "1000", condition = WeCommonRetryWhen.class)
public interface WeUserClient {
/**
* 创建用户
* @param weUserDto
* @return
*/
@Request(url="/user/create", type = "POST")
WeResultDto createUser(@JSONBody WeUserDto weUserDto);
/**
* 根据用户账号,获取用户详情信息
* @param userid
* @return
*/
@Request(url = "/user/get")
WeUserDto getUserByUserId(@Query("userid") String userid);
/**
* 更新通讯录用户
* @param weUserDto
* @return
*/
@Request(url="/user/update", type = "POST")
WeResultDto updateUser(@JSONBody WeUserDto weUserDto);
/**
* 根据账号删除指定用户
* @param userid
* @return
*/
@Request(url = "/user/delete")
WeResultDto deleteUserByUserId(@Query("userid") String userid);
/**
* 获取部门成员
* @param departmentId
* @param fetchChild
* @return
*/
@Request(url="/user/simplelist")
WeUserListDto simpleList(@Query("department_id") Long departmentId,@Query("fetch_child") Integer fetchChild);
/**
* 获取部门成员
* @param departmentId
* @param fetchChild
* @return
*/
@Request(url="/user/list")
WeUserListDto list(@Query("department_id") Long departmentId,@Query("fetch_child") Integer fetchChild);
/**
* 离职继承分配客户
* @return
*/
@Request(url="/externalcontact/resigned/transfer_customer", type = "POST",interceptor = WeAccessTokenInterceptor.class)
WeResultDto allocateCustomer(@JSONBody AllocateWeCustomerDto allocateWeCustomerDto);
/**
* 在职继承分配客户(在职继承)
* @param allocateWeCustomerDto
* @return
*/
@Request(url = "/externalcontact/transfer_customer", type = "POST",interceptor = WeAccessTokenInterceptor.class)
JobExtendsCustomer transferCustomer(@JSONBody AllocateWeCustomerDto allocateWeCustomerDto);
/**
* 查询客户接替状态
* @param jobExtendsParam
* @return
*/
@Post(url = "externalcontact/transfer_result",interceptor = WeAccessTokenInterceptor.class)
JobExtendsCustomer transferResult(@JSONBody JobExtendsCustomer.JobExtendsParam jobExtendsParam);
/**
* 分配成员群
* @return
*/
@Request(url="/externalcontact/groupchat/transfer", type = "POST",interceptor = WeAccessTokenInterceptor.class)
AllocateGroupDto allocateGroup(@JSONBody AllocateWeGroupDto allocateWeGroupDto);
/**
* 获取离职员工列表
* @return
*/
@Request(url = "/externalcontact/get_unassigned_list",type = "POST")
LeaveWeUserListsDto leaveWeUsers();
/**
* 获取访问用户身份(内部应用)
* @param code
* @param agentId 应用的id,请求头中
* @return
*/
@Request(url = "/user/getuserinfo",interceptor = WeAppAccessTokenInterceptor.class)
WeUserInfoDto getUserInfo(@Query("code")String code,@Header("agentId")String agentId);
}