batch_msg.api 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. Cc *string `json:"cc,optional"`
  103. Phone *string `json:"phone,optional"`
  104. }
  105. SendMsgReq {
  106. Phone *string `json:"phone"`
  107. To *string `json:"to"`
  108. Lang *string `json:"lang"`
  109. TemplateCode *string `json:"templateCode"`
  110. }
  111. )
  112. @server(
  113. jwt: Auth
  114. group: batch_msg
  115. middleware: Authority
  116. )
  117. service Wechat {
  118. // Create batch msg information | 创建BatchMsg
  119. @handler createBatchMsg
  120. post /batch_msg/create (BatchMsgInfo) returns (BaseMsgResp)
  121. // Update batch msg information | 更新BatchMsg
  122. @handler updateBatchMsg
  123. post /batch_msg/update (BatchMsgInfo) returns (BaseMsgResp)
  124. // Delete batch msg information | 删除BatchMsg信息
  125. @handler deleteBatchMsg
  126. post /batch_msg/delete (IDsReq) returns (BaseMsgResp)
  127. // Get batch msg list | 获取BatchMsg列表
  128. @handler getBatchMsgList
  129. post /batch_msg/list (BatchMsgListReq) returns (BatchMsgListResp)
  130. // Get batch msg by ID | 通过ID获取BatchMsg
  131. @handler getBatchMsgById
  132. post /batch_msg (IDReq) returns (BatchMsgInfoResp)
  133. // Stop batch_msg by ID | 通过ID停止BatchMsg
  134. @handler stopBatchMsg
  135. post /batch_msg/stop (IDReq) returns (BaseMsgResp)
  136. // 获取Whatsapp 批量任务列表
  137. @handler getWhatcappBatchMsgList
  138. post /batch_msg/getWhatcappBatchMsgList (WhatsappBatchMsgListReq) returns (BatchMsgListResp)
  139. // 创建Whatsapp 群发任务
  140. @handler createWhatcappBatchMsg
  141. post /batch_msg/createWhatcappBatchMsg (BatchMsgInfo) returns (BaseMsgResp)
  142. // 修改Whatsapp 群发任务
  143. @handler updateWhatcappBatchMsg
  144. post /batch_msg/updateWhatcappBatchMsg (BatchMsgInfo) returns (BaseMsgResp)
  145. // 获取Whatsapp 群发任务详情
  146. @handler getWhatcappBatchMsg
  147. post /batch_msg/getWhatcappBatchMsg (IDReq) returns (BatchMsgInfoResp)
  148. // 删除Whatsapp 群发任务
  149. @handler removeWhatcappBatchMsg
  150. post /batch_msg/removeWhatcappBatchMsg (IDsReq) returns (BaseMsgResp)
  151. // 获取Whatsapp 群发任务发送记录
  152. @handler getWhatcappBatchMsgHistory
  153. post /batch_msg/getWhatcappBatchMsgHistory (WhatsappBatchMsgHistoryReq) returns (WhatsappBatchMsgHistoryResp)
  154. // 发送消息
  155. @handler sendBatchMsgText
  156. post /batch_msg/sendBatchMsgText (SendMsgReq) returns (BaseMsgResp)
  157. }