wx.api 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. import "../base.api"
  2. import "./agent.api"
  3. import "./label_relationship.api"
  4. type (
  5. // The response data of wx information | Wx信息
  6. WxInfo {
  7. BaseIDInfo
  8. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  9. Status *uint8 `json:"status,optional"`
  10. // 服务器id
  11. ServerId *uint64 `json:"serverId,optional"`
  12. // 服务器名称
  13. ServerName *string `json:"serverName,optional"`
  14. // 端口号
  15. Port *string `json:"port,optional"`
  16. // 进程号
  17. ProcessId *string `json:"processId,optional"`
  18. // 回调地址
  19. Callback *string `json:"callback,optional"`
  20. // 微信id
  21. Wxid *string `json:"wxid,optional"`
  22. // 微信账号
  23. Account *string `json:"account,optional"`
  24. // 微信昵称
  25. Nickname *string `json:"nickname,optional"`
  26. // 手机号
  27. Tel *string `json:"tel,optional"`
  28. // 微信头像
  29. HeadBig *string `json:"headBig,optional"`
  30. // 组织ID
  31. OrganizationId *uint64 `json:"organizationId,optional"`
  32. // 组织名称
  33. OrganizationName *string `json:"organizationName,optional"`
  34. // 模式ID
  35. AgentId *uint64 `json:"agentId,optional"`
  36. // 模式信息
  37. AgentInfo *AgentInfo `json:"agentInfo,optional"`
  38. // 大模型服务地址
  39. ApiBase *string `json:"apiBase,optional"`
  40. // 大模型服务密钥
  41. ApiKey *string `json:"apiKey,optional"`
  42. // 白名单
  43. AllowList []ContactInfo `json:"allowList,optional"`
  44. // 群白名单
  45. GroupAllowList []ContactInfo `json:"groupAllowList,optional"`
  46. // 黑名单
  47. BlockList []ContactInfo `json:"blockList,optional"`
  48. // 群黑名单
  49. GroupBlockList []ContactInfo `json:"groupBlockList,optional"`
  50. }
  51. UpdateBlockAndAllowListReq {
  52. BaseIDInfo
  53. // 白名单
  54. AllowList []string `json:"allowList,optional"`
  55. // 群白名单
  56. GroupAllowList []string `json:"groupAllowList,optional"`
  57. // 黑名单
  58. BlockList []string `json:"blockList,optional"`
  59. // 群黑名单
  60. GroupBlockList []string `json:"groupBlockList,optional"`
  61. }
  62. // The response data of wx list | Wx列表数据
  63. WxListResp {
  64. BaseDataInfo
  65. // Wx list data | Wx列表数据
  66. Data WxListInfo `json:"data"`
  67. }
  68. // Wx list data | Wx列表数据
  69. WxListInfo {
  70. BaseListInfo
  71. // The API list data | Wx列表数据
  72. Data []WxInfo `json:"data"`
  73. }
  74. // Get wx list request params | Wx列表请求参数
  75. WxListReq {
  76. PageInfo
  77. // 服务器id
  78. ServerId *uint64 `json:"serverId,optional"`
  79. // 租户id
  80. OrganizationId *uint64 `json:"organizationId,optional"`
  81. // 租户名称
  82. OrganizationName *string `json:"organizationName,optional"`
  83. // 端口号
  84. Port *string `json:"port,optional"`
  85. // 进程号
  86. ProcessId *string `json:"processId,optional"`
  87. // 回调地址
  88. Callback *string `json:"callback,optional"`
  89. }
  90. // Wx information response | Wx信息返回体
  91. WxInfoResp {
  92. BaseDataInfo
  93. // Wx information | Wx数据
  94. Data WxInfo `json:"data"`
  95. }
  96. // 获取黑白名单列表返回体
  97. AllowBlockListResp {
  98. BaseDataInfo
  99. // Wx information | Wx数据
  100. Data AllowBlockListRespData `json:"data"`
  101. }
  102. // AllowBlockListRespData
  103. AllowBlockListRespData {
  104. // 白名单
  105. AllowList []*AllowBlockData `json:"allowList,optional"`
  106. // 群白名单
  107. GroupAllowList []*AllowBlockData `json:"groupAllowList,optional"`
  108. // 黑名单
  109. BlockList []*AllowBlockData `json:"blockList,optional"`
  110. // 群黑名单
  111. GroupBlockList []*AllowBlockData `json:"groupBlockList,optional"`
  112. }
  113. // AllowBlockData
  114. AllowBlockData {
  115. // 微信id 公众号微信ID
  116. Wxid string `json:"wxid,optional"`
  117. // 微信昵称 群备注名称
  118. Nickname string `json:"nickname,optional"`
  119. }
  120. )
  121. @server(
  122. jwt: Auth
  123. group: Wx
  124. middleware: Authority
  125. )
  126. service Wechat {
  127. // Create wx information | 创建Wx
  128. @handler createWx
  129. post /wx/create (WxInfo) returns (BaseMsgResp)
  130. // Check wx information | 检查并更新Wx状态
  131. @handler checkWx
  132. post /wx/check (WxInfo) returns (BaseMsgResp)
  133. // Update wx information | 更新Wx
  134. @handler updateWx
  135. post /wx/update (WxInfo) returns (BaseMsgResp)
  136. // Update wx information | 更新黑白名单
  137. @handler updateBlockAndAllowList
  138. post /wx/updateBlockAndAllowList (UpdateBlockAndAllowListReq) returns (BaseMsgResp)
  139. // Delete wx information | 删除Wx信息
  140. @handler deleteWx
  141. post /wx/delete (IDReq) returns (BaseMsgResp)
  142. // Get wx list | 获取Wx列表
  143. @handler getWxList
  144. post /wx/list (WxListReq) returns (WxListResp)
  145. // Get wx allow and block list | 获取黑白名单列表
  146. @handler getWxAllowBlockList
  147. post /wx/getWxAllowBlockList (IDReq) returns (AllowBlockListResp)
  148. // Get wx by ID | 通过ID获取Wx
  149. @handler getWxById
  150. post /wx (IDReq) returns (WxInfoResp)
  151. }