batch_msg.api 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. TemplateName *string `json:"templateName,optional"`
  42. Lang *string `json:"lang,optional"`
  43. }
  44. // The response data of batch msg list | BatchMsg列表数据
  45. BatchMsgListResp {
  46. BaseDataInfo
  47. // BatchMsg list data | BatchMsg列表数据
  48. Data BatchMsgListInfo `json:"data"`
  49. }
  50. // BatchMsg list data | BatchMsg列表数据
  51. BatchMsgListInfo {
  52. BaseListInfo
  53. // The API list data | BatchMsg列表数据
  54. Data []BatchMsgInfo `json:"data"`
  55. }
  56. // Get batch msg list request params | BatchMsg列表请求参数
  57. BatchMsgListReq {
  58. PageInfo
  59. // 批次号
  60. BatchNo *string `json:"batchNo,optional"`
  61. // 发送方微信ID
  62. Fromwxid *string `json:"fromwxid,optional"`
  63. // 内容
  64. Msg *string `json:"msg,optional"`
  65. // 任务名称
  66. TaskName *string `json:"taskName,optional"`
  67. // 群发类型
  68. Type *int32 `json:"type"`
  69. }
  70. // BatchMsg information response | BatchMsg信息返回体
  71. BatchMsgInfoResp {
  72. BaseDataInfo
  73. // BatchMsg information | BatchMsg数据
  74. Data BatchMsgInfo `json:"data"`
  75. }
  76. WhatsappBatchMsgListReq {
  77. PageInfo
  78. // 批次号
  79. BatchNo *string `json:"batchNo,optional"`
  80. // 发送方微信ID
  81. Phone *string `json:"phone,optional"`
  82. // 内容
  83. Msg *string `json:"msg,optional"`
  84. }
  85. WhatsappBatchMsgHistoryReq {
  86. PageInfo
  87. IDReq
  88. Status *uint8 `json:"status,optional"`
  89. Phone *string `json:"phone,optional"`
  90. }
  91. WhatsappBatchMsgHistoryResp {
  92. BaseDataInfo
  93. Data HistoryListInfo `json:"data"`
  94. }
  95. HistoryListInfo {
  96. BaseListInfo
  97. Data []HistoryInfo `json:"data"`
  98. }
  99. HistoryInfo {
  100. Index *uint64 `json:"index,optional"`
  101. From *string `json:"from,optional"`
  102. To *string `json:"to,optional"`
  103. SendTime *int64 `json:"sendTime,optional"`
  104. BatchNo *string `json:"batchNo,optional"`
  105. Cc *string `json:"cc,optional"`
  106. Phone *string `json:"phone,optional"`
  107. Status *uint8 `json:"status,optional"`
  108. }
  109. SendMsgReq {
  110. Phone *string `json:"phone"`
  111. To *string `json:"to"`
  112. Lang *string `json:"lang"`
  113. TemplateCode *string `json:"templateCode"`
  114. }
  115. )
  116. @server(
  117. jwt: Auth
  118. group: batch_msg
  119. middleware: Authority
  120. )
  121. service Wechat {
  122. // Create batch msg information | 创建BatchMsg
  123. @handler createBatchMsg
  124. post /batch_msg/create (BatchMsgInfo) returns (BaseMsgResp)
  125. // Update batch msg information | 更新BatchMsg
  126. @handler updateBatchMsg
  127. post /batch_msg/update (BatchMsgInfo) returns (BaseMsgResp)
  128. // Delete batch msg information | 删除BatchMsg信息
  129. @handler deleteBatchMsg
  130. post /batch_msg/delete (IDsReq) returns (BaseMsgResp)
  131. // Get batch msg list | 获取BatchMsg列表
  132. @handler getBatchMsgList
  133. post /batch_msg/list (BatchMsgListReq) returns (BatchMsgListResp)
  134. // Get batch msg by ID | 通过ID获取BatchMsg
  135. @handler getBatchMsgById
  136. post /batch_msg (IDReq) returns (BatchMsgInfoResp)
  137. // Stop batch_msg by ID | 通过ID停止BatchMsg
  138. @handler stopBatchMsg
  139. post /batch_msg/stop (IDReq) returns (BaseMsgResp)
  140. // 获取Whatsapp 批量任务列表
  141. @handler getWhatcappBatchMsgList
  142. post /batch_msg/getWhatcappBatchMsgList (WhatsappBatchMsgListReq) returns (BatchMsgListResp)
  143. // 创建Whatsapp 群发任务
  144. @handler createWhatcappBatchMsg
  145. post /batch_msg/createWhatcappBatchMsg (BatchMsgInfo) returns (BaseMsgResp)
  146. // 修改Whatsapp 群发任务
  147. @handler updateWhatcappBatchMsg
  148. post /batch_msg/updateWhatcappBatchMsg (BatchMsgInfo) returns (BaseMsgResp)
  149. // 获取Whatsapp 群发任务详情
  150. @handler getWhatcappBatchMsg
  151. post /batch_msg/getWhatcappBatchMsg (IDReq) returns (BatchMsgInfoResp)
  152. // 删除Whatsapp 群发任务
  153. @handler removeWhatcappBatchMsg
  154. post /batch_msg/removeWhatcappBatchMsg (IDsReq) returns (BaseMsgResp)
  155. // 获取Whatsapp 群发任务发送记录
  156. @handler getWhatcappBatchMsgHistory
  157. post /batch_msg/getWhatcappBatchMsgHistory (WhatsappBatchMsgHistoryReq) returns (WhatsappBatchMsgHistoryResp)
  158. // 发送消息
  159. @handler sendBatchMsgText
  160. post /batch_msg/sendBatchMsgText (SendMsgReq) returns (BaseMsgResp)
  161. }