wx.api 6.3 KB

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