wxhook.api 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. Ctype *uint64 `json:"ctype,optional"`
  35. }
  36. // 发送微信图片消息请求参数
  37. SendPicMsgReq {
  38. // 属主微信id
  39. WxWxid *string `json:"wxWxid"`
  40. // 微信id 公众号微信ID
  41. Wxid *string `json:"wxid"`
  42. // 微信图片路径(本地或网络,本地需要上传操作,如:C:\\x.jpg)
  43. Picpath *string `json:"picpath"`
  44. // 微信图片自定义名称(此属性只有网络图片有)
  45. Diyfilename *string `json:"diyfilename,optional"`
  46. }
  47. // 发送微信图片(本地)请求参数
  48. SendPicMsgLocalReq {
  49. // 属主微信id
  50. WxWxid *string `json:"wxWxid"`
  51. // 微信id 公众号微信ID
  52. Wxid *string `json:"wxid"`
  53. // 微信图片路径(本地或网络,本地需要上传操作,如:C:\\x.jpg)
  54. Picpath *string `json:"picpath"`
  55. }
  56. )
  57. @server(
  58. group: Wxhook
  59. )
  60. service Wechat {
  61. // 发送微信文本消息
  62. @handler sendTextMsg
  63. post /wxhook/sendTextMsg (SendTextMsgReq) returns (BaseMsgResp)
  64. }
  65. @server(
  66. jwt: Auth
  67. group: Wxhook
  68. middleware: Authority
  69. )
  70. service Wechat {
  71. // Refresh login QR code | 刷新登陆二维码
  72. @handler refreshLoginQR
  73. post /wxhook/refreshLoginQR (RefreshLoginQRReq) returns (RefreshLoginQRResp)
  74. // 退出登陆
  75. @handler logout
  76. post /wxhook/logout (IDReq) returns (BaseMsgResp)
  77. // 结束微信
  78. @handler terminateThisWeChat
  79. post /wxhook/terminateThisWeChat (IDReq) returns (BaseMsgResp)
  80. // 获取好友和群信息
  81. @handler getFriendsAndGroups
  82. post /wxhook/getFriendsAndGroups (IDReq) returns (BaseMsgResp)
  83. // // 发送微信文本消息
  84. // @handler sendTextMsg
  85. // post /wxhook/sendTextMsg (SendTextMsgReq) returns (BaseMsgResp)
  86. // 发送微信图片
  87. @handler sendPicMsg
  88. post /wxhook/sendPicMsg (SendPicMsgReq) returns (BaseMsgResp)
  89. // 发送微信图片(本地)
  90. @handler sendPicMsgLocal
  91. post /wxhook/sendPicMsgLocal (SendPicMsgLocalReq) returns (BaseMsgResp)
  92. }