wxhook.api 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import "../base.api"
  2. type (
  3. LoginQRStatus {
  4. // 登陆二维码
  5. QRCode string `json:"qRCode,optional"`
  6. // 登陆二维码状态
  7. Status string `json:"status,optional"`
  8. // 登陆二维码状态描述
  9. StatusDesc string `json:"statusDesc,optional"`
  10. }
  11. // 刷新登陆二维码请求参数
  12. RefreshLoginQRReq {
  13. // 服务器id
  14. ServerId *uint64 `json:"serverId,optional"`
  15. // 端口号
  16. Port *string `json:"port,optional"`
  17. // 回调地址
  18. Callback *string `json:"callback,optional"`
  19. }
  20. // 刷新登陆二维码返回参数
  21. RefreshLoginQRResp {
  22. BaseDataInfo
  23. // 二维码Base64
  24. Data LoginQRStatus `json:"data,optional"`
  25. }
  26. // 发送微信文本消息请求参数
  27. SendTextMsgReq {
  28. // 属主微信id
  29. WxWxid *string `json:"senderWxId"`
  30. // 微信id 公众号微信ID
  31. Wxid *string `json:"receiverWxId"`
  32. // 微信文本消息内容
  33. Msg *string `json:"msg"`
  34. }
  35. // 发送微信图片消息请求参数
  36. SendPicMsgReq {
  37. // 属主微信id
  38. WxWxid *string `json:"wxWxid"`
  39. // 微信id 公众号微信ID
  40. Wxid *string `json:"wxid"`
  41. // 微信图片路径(本地或网络,本地需要上传操作,如:C:\\x.jpg)
  42. Picpath *string `json:"picpath"`
  43. // 微信图片自定义名称(此属性只有网络图片有)
  44. Diyfilename *string `json:"diyfilename,optional"`
  45. }
  46. // 发送微信图片(本地)请求参数
  47. SendPicMsgLocalReq {
  48. // 属主微信id
  49. WxWxid *string `json:"wxWxid"`
  50. // 微信id 公众号微信ID
  51. Wxid *string `json:"wxid"`
  52. // 微信图片路径(本地或网络,本地需要上传操作,如:C:\\x.jpg)
  53. Picpath *string `json:"picpath"`
  54. }
  55. )
  56. @server(
  57. group: Wxhook
  58. )
  59. service Wechat {
  60. // 发送微信文本消息
  61. @handler sendTextMsg
  62. post /wxhook/sendTextMsg (SendTextMsgReq) returns (BaseMsgResp)
  63. }
  64. @server(
  65. jwt: Auth
  66. group: Wxhook
  67. middleware: Authority
  68. )
  69. service Wechat {
  70. // Refresh login QR code | 刷新登陆二维码
  71. @handler refreshLoginQR
  72. post /wxhook/refreshLoginQR (RefreshLoginQRReq) returns (RefreshLoginQRResp)
  73. // 退出登陆
  74. @handler logout
  75. post /wxhook/logout (IDReq) returns (BaseMsgResp)
  76. // 结束微信
  77. @handler terminateThisWeChat
  78. post /wxhook/terminateThisWeChat (IDReq) returns (BaseMsgResp)
  79. // 获取好友和群信息
  80. @handler getFriendsAndGroups
  81. post /wxhook/getFriendsAndGroups (IDReq) returns (BaseMsgResp)
  82. // // 发送微信文本消息
  83. // @handler sendTextMsg
  84. // post /wxhook/sendTextMsg (SendTextMsgReq) returns (BaseMsgResp)
  85. // 发送微信图片
  86. @handler sendPicMsg
  87. post /wxhook/sendPicMsg (SendPicMsgReq) returns (BaseMsgResp)
  88. // 发送微信图片(本地)
  89. @handler sendPicMsgLocal
  90. post /wxhook/sendPicMsgLocal (SendPicMsgLocalReq) returns (BaseMsgResp)
  91. }