batch_msg.api 5.6 KB

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