forked from binarywang/WxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWxMaDeviceSubscribeService.java
More file actions
91 lines (81 loc) · 2.7 KB
/
WxMaDeviceSubscribeService.java
File metadata and controls
91 lines (81 loc) · 2.7 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
package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.device.*;
import me.chanjar.weixin.common.error.WxErrorException;
import java.util.List;
/**
* 小程序设备订阅消息相关 API
* 文档:
*
* @author <a href="https://github.com/leejuncheng">JCLee</a>
* @since 2021-12-16 17:13:35
*/
public interface WxMaDeviceSubscribeService {
/**
* <pre>
* 获取设备票据
* 应用场景:
* 小程序前端界面拉起设备消息授权订阅弹框界面
* 注意:
* 设备ticket有效时间为5分钟
* </pre>
*
* @param deviceTicketRequest
* @return
* @throws WxErrorException
*/
String getSnTicket(WxMaDeviceTicketRequest deviceTicketRequest) throws WxErrorException;
/**
* <pre>
* 发送设备订阅消息
* </pre>
*
* @param deviceSubscribeMessageRequest 订阅消息
* @throws WxErrorException .
*/
void sendDeviceSubscribeMsg(WxMaDeviceSubscribeMessageRequest deviceSubscribeMessageRequest) throws WxErrorException;
/**
* <pre>
* 创建设备组
* 详情请见:https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/createIotGroupId.html
* </pre>
*
* @param createIotGroupIdRequest 请求参数
* @return 设备组的唯一标识
* @throws WxErrorException
*/
String createIotGroupId(WxMaCreateIotGroupIdRequest createIotGroupIdRequest) throws WxErrorException;
/**
* <pre>
* 查询设备组信息
* 详情请见:https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/getIotGroupInfo.html
* </pre>
*
* @param getIotGroupInfoRequest 请求参数
* @return 设备组信息
* @throws WxErrorException
*/
WxMaIotGroupDeviceInfoResponse getIotGroupInfo(WxMaGetIotGroupInfoRequest getIotGroupInfoRequest) throws WxErrorException;
/**
* <pre>
* 设备组添加设备
* 一个设备组最多添加 50 个设备。 一个设备同一时间只能被添加到一个设备组中。
* 详情请见:https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/addIotGroupDevice.html
* </pre>
*
* @param request 请求参数
* @return 成功添加的设备信息
* @throws WxErrorException
*/
List<WxMaDeviceTicketRequest> addIotGroupDevice(WxMaIotGroupDeviceRequest request) throws WxErrorException;
/**
* <pre>
* 设备组删除设备
* 详情请见:https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/removeIotGroupDevice.html
* </pre>
*
* @param request 请求参数
* @return 成功删除的设备信息
* @throws WxErrorException
*/
List<WxMaDeviceTicketRequest> removeIotGroupDevice(WxMaIotGroupDeviceRequest request) throws WxErrorException;
}