message_records.api 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import "../base.api"
  2. type (
  3. // The response data of message records information | MessageRecords信息
  4. MessageRecordsInfo {
  5. BaseIDInfo
  6. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  7. Status *uint8 `json:"status,optional"`
  8. // 机器人微信 id
  9. BotWxid *string `json:"botWxid,optional"`
  10. // 联系人 id
  11. ContactId *uint64 `json:"contactId,optional"`
  12. // 类型:1好友,2群组,3企业微信联系人
  13. ContactType *int `json:"contactType,optional"`
  14. // 接收方微信 id
  15. ContactWxid *string `json:"contactWxid,optional"`
  16. // 内容类型 1 文本 2 文件
  17. ContentType *int `json:"contentType,optional"`
  18. // 发送内容
  19. Content *string `json:"content,optional"`
  20. // 异常原因
  21. ErrorDetail *string `json:"errorDetail,optional"`
  22. // 发送时间
  23. SendTime *int64 `json:"sendTime,optional"`
  24. // 源类型 1 点发 2 群发 3 SOP
  25. SourceType *int `json:"sourceType,optional"`
  26. // 源 ID
  27. SourceId *uint64 `json:"sourceId,optional"`
  28. // 次源 ID
  29. SubSourceId *uint64 `json:"subSourceId,optional"`
  30. }
  31. // The response data of message records list | MessageRecords列表数据
  32. MessageRecordsListResp {
  33. BaseDataInfo
  34. // MessageRecords list data | MessageRecords列表数据
  35. Data MessageRecordsListInfo `json:"data"`
  36. }
  37. // MessageRecords list data | MessageRecords列表数据
  38. MessageRecordsListInfo {
  39. BaseListInfo
  40. // The API list data | MessageRecords列表数据
  41. Data []MessageRecordsInfo `json:"data"`
  42. }
  43. // Get message records list request params | MessageRecords列表请求参数
  44. MessageRecordsListReq {
  45. PageInfo
  46. // 机器人微信 id
  47. BotWxid *string `json:"botWxid,optional"`
  48. // 接收方微信 id
  49. ContactWxid *string `json:"contactWxid,optional"`
  50. // 发送内容
  51. Content *string `json:"content,optional"`
  52. }
  53. // MessageRecords information response | MessageRecords信息返回体
  54. MessageRecordsInfoResp {
  55. BaseDataInfo
  56. // MessageRecords information | MessageRecords数据
  57. Data MessageRecordsInfo `json:"data"`
  58. }
  59. )
  60. @server(
  61. jwt: Auth
  62. group: message_records
  63. middleware: Authority
  64. )
  65. service Wechat {
  66. // Create message records information | 创建MessageRecords
  67. @handler createMessageRecords
  68. post /message_records/create (MessageRecordsInfo) returns (BaseMsgResp)
  69. // Update message records information | 更新MessageRecords
  70. @handler updateMessageRecords
  71. post /message_records/update (MessageRecordsInfo) returns (BaseMsgResp)
  72. // Delete message records information | 删除MessageRecords信息
  73. @handler deleteMessageRecords
  74. post /message_records/delete (IDsReq) returns (BaseMsgResp)
  75. // Get message records list | 获取MessageRecords列表
  76. @handler getMessageRecordsList
  77. post /message_records/list (MessageRecordsListReq) returns (MessageRecordsListResp)
  78. // Get message records by ID | 通过ID获取MessageRecords
  79. @handler getMessageRecordsById
  80. post /message_records (IDReq) returns (MessageRecordsInfoResp)
  81. }