CloudControlLoginService.java
2.94 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
package cn.com.glsx.entmicro.service.wechatcloudcontrol;
import cn.com.glsx.entmicro.convert.ConvertRequest;
import cn.com.glsx.entmicro.convert.ConvertResponse;
import cn.com.glsx.entmicro.model.request.wechatcloudcontrol.customer.CustomerListResquest;
import cn.com.glsx.entmicro.model.request.wechatcloudcontrol.login.WechatDepositRequest;
import cn.com.glsx.entmicro.model.response.EntmicroStaffResponse;
import cn.com.glsx.entmicro.model.response.wechatcloudcontrol.customer.CustomerInfoResponse;
import cn.com.glsx.entmicro.model.response.wechatcloudcontrol.login.CloudControQccodeResponse;
import cn.com.glsx.entmicro.remote.WechatCloudControlLoginRemote;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.login.CustomerListRopResquest;
import cn.com.glsx.entmicro.request.wechatcloudcontrol.login.QcCodeRequest;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @BelongsProject: scrm_v2.11.0_20221010_1
* @BelongsPackage: cn.com.glsx.entmicro.service.wechatcloudcontrol
* @Author: 11
* @CreateTime: 2022-09-21 19:00
* @Description: 云控登录service
* @Version: 1.0
*/
@Service
public class CloudControlLoginService {
@Autowired
private WechatCloudControlLoginRemote wechatCloudControlLoginRemote;
public CloudControQccodeResponse getLoginQcCode() {
RpcResponse<CloudControQccodeResponse> response = wechatCloudControlLoginRemote.getLoginQcCode();
if (response.isSuccess()) {
return response.getResult();
}
throw new RpcServiceException(response.getError(), response.getMessage());
}
public Boolean getQcCodeDetail(QcCodeRequest qcCodeRequest) {
RpcResponse<Boolean> response = wechatCloudControlLoginRemote.getQcCodeDetail(qcCodeRequest.getId());
if (response.isSuccess()) {
return response.getResult();
}
throw new RpcServiceException(response.getError(), response.getMessage());
}
public Pagination<CustomerInfoResponse> getStaffFriends(CustomerListRopResquest customerListRopResquest) {
RpcPagination<CustomerListResquest> pagination = ConvertRequest.convertPage(customerListRopResquest, new CustomerListResquest());
RpcResponse<RpcPagination<CustomerInfoResponse>> rpcPaginationRpcResponse = wechatCloudControlLoginRemote.getStaffFriends(pagination);
if (rpcPaginationRpcResponse.isSuccess()) {
Pagination<CustomerInfoResponse> responsePagination = ConvertResponse.convertPage(rpcPaginationRpcResponse.getResult(), CustomerInfoResponse.class);
return responsePagination;
}
throw new RpcServiceException(rpcPaginationRpcResponse.getException().getErrId(), rpcPaginationRpcResponse.getMessage());
}
}