batch_msg.api 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. import "../base.api"
  2. type (
  3. // The data of batch msg information | BatchMsg信息
  4. BatchMsgInfo {
  5. BaseIDInfo
  6. // 状态 0 未开始 1 开始发送 2 发送完成 3 发送中止
  7. Status *uint8 `json:"status,optional"`
  8. // 批次号
  9. BatchNo *string `json:"batchNo,optional"`
  10. // 任务名称
  11. TaskName *string `json:"taskName,optional"`
  12. // 发送方微信ID
  13. Fromwxid *string `json:"fromwxid,optional"`
  14. // 内容
  15. Msg *string `json:"msg,optional"`
  16. // 发送规则 all 全部 tag1,tag2 按tag发送
  17. Tag *string `json:"tag,optional"`
  18. // 总数
  19. Total *int32 `json:"total,optional"`
  20. // 成功数量
  21. Success *int32 `json:"success,optional"`
  22. // 失败数量
  23. Fail *int32 `json:"fail,optional"`
  24. // 开始时间
  25. StartTime *int64 `json:"startTime,optional"`
  26. StartTimeStr *string `json:"startTimeStr,optional"`
  27. // 结束时间
  28. StopTime *int64 `json:"stopTime,optional"`
  29. // 发送时间
  30. SendTime *int64 `json:"sendTime,optional"`
  31. // 标签列表
  32. Labels []uint64 `json:"labels,optional"`
  33. GroupLabels []uint64 `json:"groupLabels,optional"`
  34. // 标签列表
  35. Type *int32 `json:"type,optional"`
  36. // 内容类型:1-微信 2-whatsapp
  37. Ctype *uint64 `json:"ctype,optional"`
  38. Cc *string `json:"cc,optional"`
  39. Phone *string `json:"phone,optional"`
  40. TemplateCode *string `json:"templateCode,optional"`
  41. Lang *string `json:"lang,optional"`
  42. }
  43. // The response data of batch msg list | BatchMsg列表数据
  44. BatchMsgListResp {
  45. BaseDataInfo
  46. // BatchMsg list data | BatchMsg列表数据
  47. Data BatchMsgListInfo `json:"data"`
  48. }
  49. // BatchMsg list data | BatchMsg列表数据
  50. BatchMsgListInfo {
  51. BaseListInfo
  52. // The API list data | BatchMsg列表数据
  53. Data []BatchMsgInfo `json:"data"`
  54. }
  55. // Get batch msg list request params | BatchMsg列表请求参数
  56. BatchMsgListReq {
  57. PageInfo
  58. // 批次号
  59. BatchNo *string `json:"batchNo,optional"`
  60. // 发送方微信ID
  61. Fromwxid *string `json:"fromwxid,optional"`
  62. // 内容
  63. Msg *string `json:"msg,optional"`
  64. // 任务名称
  65. TaskName *string `json:"taskName,optional"`
  66. // 群发类型
  67. Type *int32 `json:"type"`
  68. }
  69. // BatchMsg information response | BatchMsg信息返回体
  70. BatchMsgInfoResp {
  71. BaseDataInfo
  72. // BatchMsg information | BatchMsg数据
  73. Data BatchMsgInfo `json:"data"`
  74. }
  75. WhatsappBatchMsgListReq {
  76. PageInfo
  77. // 批次号
  78. BatchNo *string `json:"batchNo,optional"`
  79. // 发送方微信ID
  80. Phone *string `json:"phone,optional"`
  81. // 内容
  82. Msg *string `json:"msg,optional"`
  83. }
  84. WhatsappBatchMsgHistoryReq {
  85. PageInfo
  86. IDReq
  87. }
  88. WhatsappBatchMsgHistoryResp {
  89. BaseDataInfo
  90. Data HistoryListInfo `json:"data"`
  91. }
  92. HistoryListInfo {
  93. BaseListInfo
  94. Data []HistoryInfo `json:"data"`
  95. }
  96. HistoryInfo {
  97. Index *uint64 `json:"index,optional"`
  98. From *string `json:"from,optional"`
  99. To *string `json:"to,optional"`
  100. SendTime *int64 `json:"sendTime,optional"`
  101. BatchNo *string `json:"batchNo,optional"`
  102. }
  103. SendMsgReq {
  104. Phone *string `json:"phone"`
  105. To *string `json:"to"`
  106. Lang *string `json:"lang"`
  107. TemplateCode *string `json:"templateCode"`
  108. }
  109. )
  110. @server(
  111. jwt: Auth
  112. group: batch_msg
  113. middleware: Authority
  114. )
  115. service Wechat {
  116. // Create batch msg information | 创建BatchMsg
  117. @handler createBatchMsg
  118. post /batch_msg/create (BatchMsgInfo) returns (BaseMsgResp)
  119. // Update batch msg information | 更新BatchMsg
  120. @handler updateBatchMsg
  121. post /batch_msg/update (BatchMsgInfo) returns (BaseMsgResp)
  122. // Delete batch msg information | 删除BatchMsg信息
  123. @handler deleteBatchMsg
  124. post /batch_msg/delete (IDsReq) returns (BaseMsgResp)
  125. // Get batch msg list | 获取BatchMsg列表
  126. @handler getBatchMsgList
  127. post /batch_msg/list (BatchMsgListReq) returns (BatchMsgListResp)
  128. // Get batch msg by ID | 通过ID获取BatchMsg
  129. @handler getBatchMsgById
  130. post /batch_msg (IDReq) returns (BatchMsgInfoResp)
  131. // Stop batch_msg by ID | 通过ID停止BatchMsg
  132. @handler stopBatchMsg
  133. post /batch_msg/stop (IDReq) returns (BaseMsgResp)
  134. // 获取Whatsapp 批量任务列表
  135. @handler getWhatcappBatchMsgList
  136. post /batch_msg/getWhatcappBatchMsgList (WhatsappBatchMsgListReq) returns (BatchMsgListResp)
  137. // 创建Whatsapp 群发任务
  138. @handler createWhatcappBatchMsg
  139. post /batch_msg/createWhatcappBatchMsg (BatchMsgInfo) returns (BaseMsgResp)
  140. // 修改Whatsapp 群发任务
  141. @handler updateWhatcappBatchMsg
  142. post /batch_msg/updateWhatcappBatchMsg (BatchMsgInfo) returns (BaseMsgResp)
  143. // 获取Whatsapp 群发任务详情
  144. @handler getWhatcappBatchMsg
  145. post /batch_msg/getWhatcappBatchMsg (IDReq) returns (BatchMsgInfoResp)
  146. // 删除Whatsapp 群发任务
  147. @handler removeWhatcappBatchMsg
  148. post /batch_msg/removeWhatcappBatchMsg (IDsReq) returns (BaseMsgResp)
  149. // 获取Whatsapp 群发任务发送记录
  150. @handler getWhatcappBatchMsgHistory
  151. post /batch_msg/getWhatcappBatchMsgHistory (WhatsappBatchMsgHistoryReq) returns (WhatsappBatchMsgHistoryResp)
  152. // 发送消息
  153. @handler sendBatchMsgText
  154. post /batch_msg/sendBatchMsgText (SendMsgReq) returns (BaseMsgResp)
  155. }