msg.api 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import "../base.api"
  2. type (
  3. // The data of msg information | Msg信息
  4. MsgInfo {
  5. BaseIDInfo
  6. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  7. Status *uint8 `json:"status,optional"`
  8. // 发送方微信ID
  9. Fromwxid *string `json:"fromwxid,optional"`
  10. // 接收人微信ID/群ID
  11. Toid *string `json:"toid,optional"`
  12. // 消息类型
  13. Msgtype *int32 `json:"msgtype,optional"`
  14. // 消息
  15. Msg *string `json:"msg,optional"`
  16. // 批次号
  17. BatchNo *string `json:"batchNo,optional"`
  18. }
  19. // The response data of msg list | Msg列表数据
  20. MsgListResp {
  21. BaseDataInfo
  22. // Msg list data | Msg列表数据
  23. Data MsgListInfo `json:"data"`
  24. }
  25. // Msg list data | Msg列表数据
  26. MsgListInfo {
  27. BaseListInfo
  28. // The API list data | Msg列表数据
  29. Data []MsgInfo `json:"data"`
  30. }
  31. // Get msg list request params | Msg列表请求参数
  32. MsgListReq {
  33. PageInfo
  34. // 状态
  35. Status *uint8 `json:"status,optional"`
  36. // 接收人微信ID/群ID
  37. Toid *string `json:"toid,optional"`
  38. // 群发消息ID
  39. BatchId *uint64 `json:"batchId"`
  40. }
  41. // Msg information response | Msg信息返回体
  42. MsgInfoResp {
  43. BaseDataInfo
  44. // Msg information | Msg数据
  45. Data MsgInfo `json:"data"`
  46. }
  47. )
  48. @server(
  49. jwt: Auth
  50. group: Msg
  51. middleware: Authority
  52. )
  53. service Wechat {
  54. // Create msg information | 创建Msg
  55. @handler createMsg
  56. post /msg/create (MsgInfo) returns (BaseMsgResp)
  57. // Update msg information | 更新Msg
  58. @handler updateMsg
  59. post /msg/update (MsgInfo) returns (BaseMsgResp)
  60. // Delete msg information | 删除Msg信息
  61. @handler deleteMsg
  62. post /msg/delete (IDsReq) returns (BaseMsgResp)
  63. // Get msg list | 获取Msg列表
  64. @handler getMsgList
  65. post /msg/list (MsgListReq) returns (MsgListResp)
  66. // Get msg by ID | 通过ID获取Msg
  67. @handler getMsgById
  68. post /msg (IDReq) returns (MsgInfoResp)
  69. }