whatsapp.api 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import "../base.api"
  2. import "./agent.api"
  3. import "./label_relationship.api"
  4. type (
  5. // The data of whatsapp information | Whatsapp信息
  6. WhatsappInfo {
  7. BaseIDInfo
  8. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  9. Status *uint8 `json:"status,optional"`
  10. // ak
  11. Ak *string `json:"ak,optional"`
  12. // 端口号
  13. Sk *string `json:"sk,optional"`
  14. // 回调地址
  15. Callback *string `json:"callback,optional"`
  16. // 微信账号
  17. Account *string `json:"account,optional"`
  18. // 昵称
  19. Nickname *string `json:"nickname,optional"`
  20. // 手机号
  21. Phone *string `json:"phone,optional"`
  22. // 机构 ID
  23. OrganizationId *uint64 `json:"organizationId,optional"`
  24. // 模式ID
  25. AgentId *uint64 `json:"agentId,optional"`
  26. // 大模型服务地址
  27. ApiBase *string `json:"apiBase,optional"`
  28. // 大模型服务密钥
  29. ApiKey *string `json:"apiKey,optional"`
  30. // 白名单
  31. AllowList []ContactInfo `json:"allowList,optional"`
  32. // 群白名单
  33. GroupAllowList []ContactInfo `json:"groupAllowList,optional"`
  34. // 黑名单
  35. BlockList []ContactInfo `json:"blockList,optional"`
  36. // 群黑名单
  37. GroupBlockList []ContactInfo `json:"groupBlockList,optional"`
  38. }
  39. // The response data of whatsapp list | Whatsapp列表数据
  40. WhatsappListResp {
  41. BaseDataInfo
  42. // Whatsapp list data | Whatsapp列表数据
  43. Data WhatsappListInfo `json:"data"`
  44. }
  45. // Whatsapp list data | Whatsapp列表数据
  46. WhatsappListInfo {
  47. BaseListInfo
  48. // The API list data | Whatsapp列表数据
  49. Data []WhatsappInfo `json:"data"`
  50. }
  51. // Get whatsapp list request params | Whatsapp列表请求参数
  52. WhatsappListReq {
  53. PageInfo
  54. // ak
  55. Ak *string `json:"ak,optional"`
  56. // 端口号
  57. Sk *string `json:"sk,optional"`
  58. // 回调地址
  59. Callback *string `json:"callback,optional"`
  60. }
  61. // Whatsapp information response | Whatsapp信息返回体
  62. WhatsappInfoResp {
  63. BaseDataInfo
  64. // Whatsapp information | Whatsapp数据
  65. Data WhatsappInfo `json:"data"`
  66. }
  67. )
  68. @server(
  69. jwt: Auth
  70. group: whatsapp
  71. middleware: Authority
  72. )
  73. service Wechat {
  74. // Create whatsapp information | 创建Whatsapp
  75. @handler createWhatsapp
  76. post /whatsapp/create (WhatsappInfo) returns (BaseMsgResp)
  77. // Update whatsapp information | 更新Whatsapp
  78. @handler updateWhatsapp
  79. post /whatsapp/update (WhatsappInfo) returns (BaseMsgResp)
  80. // Delete whatsapp information | 删除Whatsapp信息
  81. @handler deleteWhatsapp
  82. post /whatsapp/delete (IDsReq) returns (BaseMsgResp)
  83. // Get whatsapp list | 获取Whatsapp列表
  84. @handler getWhatsappList
  85. post /whatsapp/list (WhatsappListReq) returns (WhatsappListResp)
  86. // Get whatsapp by ID | 通过ID获取Whatsapp
  87. @handler getWhatsappById
  88. post /whatsapp (IDReq) returns (WhatsappInfoResp)
  89. }