batch_msg.api 5.7 KB

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