WxMpDeviceService.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package me.chanjar.weixin.mp.api;
  2. import me.chanjar.weixin.common.exception.WxErrorException;
  3. import me.chanjar.weixin.mp.bean.device.*;
  4. /**
  5. * Created by keungtung on 10/12/2016.
  6. */
  7. public interface WxMpDeviceService {
  8. /**
  9. * <pre>
  10. * 主动发送消息给设备
  11. * 详情请见:http://iot.weixin.qq.com/wiki/new/index.html?page=3-4-3
  12. * </pre>
  13. */
  14. TransMsgResp transMsg(WxDeviceMsg msg) throws WxErrorException;
  15. /**
  16. * <pre>
  17. * 获取一组新的deviceid和设备二维码
  18. * 详情请见:http://iot.weixin.qq.com/wiki/new/index.html?page=3-4-6
  19. * </pre>
  20. * @param productId 产品id
  21. * @return 返回WxDeviceQrCodeResult
  22. */
  23. WxDeviceQrCodeResult getQrCode(String productId) throws WxErrorException;
  24. /**
  25. * <pre>
  26. * 将device id及其属性信息提交公众平台进行授权
  27. * 详情请见:http://iot.weixin.qq.com/wiki/new/index.html?page=3-4-6
  28. * </pre>
  29. * @param wxDeviceAuthorize 授权请求对象
  30. * @return WxDeviceAuthorizeResult
  31. */
  32. WxDeviceAuthorizeResult authorize(WxDeviceAuthorize wxDeviceAuthorize) throws WxErrorException;
  33. /**
  34. * <pre>
  35. * 第三方后台绑定成功后,通知公众平台
  36. * 详情请见:http://iot.weixin.qq.com/wiki/new/index.html/page=3-4-7
  37. * </pre>
  38. * @param wxDeviceBind 绑定请求对象
  39. * @return WxDeviceBindResult
  40. */
  41. WxDeviceBindResult bind(WxDeviceBind wxDeviceBind) throws WxErrorException;
  42. /**
  43. * <pre>
  44. * 强制绑定用户和设备
  45. * 详情请见:http://iot.weixin.qq.com/wiki/new/index.html?page=3-4-7
  46. * </pre>
  47. * @param wxDeviceBind 强制绑定请求对象
  48. * @return WxDeviceBindResult
  49. */
  50. WxDeviceBindResult compelBind(WxDeviceBind wxDeviceBind) throws WxErrorException;
  51. /**
  52. * <pre>
  53. * 第三方确认用户和设备的解绑操作
  54. * 详情请见:http://iot.weixin.qq.com/wiki/new/index.html/page=3-4-7
  55. * </pre>
  56. * @param wxDeviceBind 绑定请求对象
  57. * @return WxDeviceBidResult
  58. */
  59. WxDeviceBindResult unbind(WxDeviceBind wxDeviceBind) throws WxErrorException;
  60. /**
  61. * <pre>
  62. * 强制解绑用户和设备
  63. * 详情请见:http://iot.weixin.qq.com/wiki/new/index.html?page=3-4-7
  64. * </pre>
  65. * @param wxDeviceBind 强制解绑请求对象
  66. * @return WxDeviceBindResult
  67. */
  68. WxDeviceBindResult compelUnbind(WxDeviceBind wxDeviceBind) throws WxErrorException;
  69. }