wx.api 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. // 使用token总数
  51. TotalTokens *uint64 `json:"totalTokens,optional"`
  52. Ctype *uint64 `json:"ctype,optional"`
  53. }
  54. UpdateBlockAndAllowListReq {
  55. BaseIDInfo
  56. // 白名单
  57. AllowList []string `json:"allowList,optional"`
  58. // 群白名单
  59. GroupAllowList []string `json:"groupAllowList,optional"`
  60. // 黑名单
  61. BlockList []string `json:"blockList,optional"`
  62. // 群黑名单
  63. GroupBlockList []string `json:"groupBlockList,optional"`
  64. }
  65. // The response data of wx list | Wx列表数据
  66. WxListResp {
  67. BaseDataInfo
  68. // Wx list data | Wx列表数据
  69. Data WxListInfo `json:"data"`
  70. }
  71. // Wx list data | Wx列表数据
  72. WxListInfo {
  73. BaseListInfo
  74. // The API list data | Wx列表数据
  75. Data []WxInfo `json:"data"`
  76. }
  77. // Get wx list request params | Wx列表请求参数
  78. WxListReq {
  79. PageInfo
  80. // 服务器id
  81. ServerId *uint64 `json:"serverId,optional"`
  82. // 租户id
  83. OrganizationId *uint64 `json:"organizationId,optional"`
  84. // 租户名称
  85. OrganizationName *string `json:"organizationName,optional"`
  86. // 端口号
  87. Port *string `json:"port,optional"`
  88. // 进程号
  89. ProcessId *string `json:"processId,optional"`
  90. // 回调地址
  91. Callback *string `json:"callback,optional"`
  92. // 账号类型 1-个微 3-企微
  93. Ctype *uint64 `json:"ctype,optional"`
  94. }
  95. // Get wx list request params | Wx列表请求参数
  96. WxSelectListReq {
  97. // 租户id
  98. OrganizationId *uint64 `json:"organizationId,optional"`
  99. // 账号类型 1-个微 3-企微
  100. Ctype *uint64 `json:"ctype,optional"`
  101. }
  102. // The response data of wx list | Wx列表数据
  103. WxSelectListResp {
  104. BaseDataInfo
  105. // Wx list data | Wx列表数据
  106. Data []WxSelectListInfo `json:"data"`
  107. }
  108. WxSelectListInfo {
  109. BaseIDInfo
  110. // 微信id
  111. Wxid *string `json:"wxid,optional"`
  112. // 微信昵称
  113. Nickname *string `json:"nickname,optional"`
  114. // 内容类型:1-个微 3-企微
  115. Ctype *uint64 `json:"ctype,optional"`
  116. }
  117. // Wx information response | Wx信息返回体
  118. WxInfoResp {
  119. BaseDataInfo
  120. // Wx information | Wx数据
  121. Data WxInfo `json:"data"`
  122. }
  123. // 获取黑白名单列表返回体
  124. AllowBlockListResp {
  125. BaseDataInfo
  126. // Wx information | Wx数据
  127. Data AllowBlockListRespData `json:"data"`
  128. }
  129. // AllowBlockListRespData
  130. AllowBlockListRespData {
  131. // 白名单
  132. AllowList []*AllowBlockData `json:"allowList,optional"`
  133. // 群白名单
  134. GroupAllowList []*AllowBlockData `json:"groupAllowList,optional"`
  135. // 黑名单
  136. BlockList []*AllowBlockData `json:"blockList,optional"`
  137. // 群黑名单
  138. GroupBlockList []*AllowBlockData `json:"groupBlockList,optional"`
  139. }
  140. // AllowBlockData
  141. AllowBlockData {
  142. // 微信id 公众号微信ID
  143. Wxid string `json:"wxid,optional"`
  144. // 微信昵称 群备注名称
  145. Nickname string `json:"nickname,optional"`
  146. }
  147. )
  148. @server(
  149. jwt: Auth
  150. group: Wx
  151. middleware: Authority
  152. )
  153. service Wechat {
  154. // Create wx information | 创建Wx
  155. @handler createWx
  156. post /wx/create (WxInfo) returns (BaseMsgResp)
  157. // Check wx information | 检查并更新Wx状态
  158. @handler checkWx
  159. post /wx/check (WxInfo) returns (BaseMsgResp)
  160. // Update wx information | 更新Wx
  161. @handler updateWx
  162. post /wx/update (WxInfo) returns (BaseMsgResp)
  163. // Update wx information | 更新黑白名单
  164. @handler updateBlockAndAllowList
  165. post /wx/updateBlockAndAllowList (UpdateBlockAndAllowListReq) returns (BaseMsgResp)
  166. // Delete wx information | 删除Wx信息
  167. @handler deleteWx
  168. post /wx/delete (IDReq) returns (BaseMsgResp)
  169. // Get wx list | 获取Wx列表
  170. @handler getWxList
  171. post /wx/list (WxListReq) returns (WxListResp)
  172. // Get wx list | 获取Wx列表
  173. @handler getSelectWxList
  174. post /wx/selectList (WxSelectListReq) returns (WxSelectListResp)
  175. // Get wx allow and block list | 获取黑白名单列表
  176. @handler getWxAllowBlockList
  177. post /wx/getWxAllowBlockList (IDReq) returns (AllowBlockListResp)
  178. // Get wx by ID | 通过ID获取Wx
  179. @handler getWxById
  180. post /wx (IDReq) returns (WxInfoResp)
  181. }