wx.api 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. import "../base.api"
  2. import "./agent.api"
  3. type (
  4. // The response data of wx information | Wx信息
  5. WxInfo {
  6. BaseIDInfo
  7. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  8. Status *uint8 `json:"status,optional"`
  9. // 服务器id
  10. ServerId *uint64 `json:"serverId,optional"`
  11. // 服务器名称
  12. ServerName *string `json:"serverName,optional"`
  13. // 端口号
  14. Port *string `json:"port,optional"`
  15. // 进程号
  16. ProcessId *string `json:"processId,optional"`
  17. // 回调地址
  18. Callback *string `json:"callback,optional"`
  19. // 微信id
  20. Wxid *string `json:"wxid,optional"`
  21. // 微信账号
  22. Account *string `json:"account,optional"`
  23. // 微信昵称
  24. Nickname *string `json:"nickname,optional"`
  25. // 手机号
  26. Tel *string `json:"tel,optional"`
  27. // 微信头像
  28. HeadBig *string `json:"headBig,optional"`
  29. // 组织ID
  30. OrganizationId *uint64 `json:"organizationId,optional"`
  31. // 组织名称
  32. OrganizationName *string `json:"organizationName,optional"`
  33. // 模式ID
  34. AgentId *uint64 `json:"agentId,optional"`
  35. // 模式信息
  36. AgentInfo *AgentInfo `json:"agentInfo,optional"`
  37. // 大模型服务地址
  38. ApiBase *string `json:"apiBase,optional"`
  39. // 大模型服务密钥
  40. ApiKey *string `json:"apiKey,optional"`
  41. }
  42. // The response data of wx list | Wx列表数据
  43. WxListResp {
  44. BaseDataInfo
  45. // Wx list data | Wx列表数据
  46. Data WxListInfo `json:"data"`
  47. }
  48. // Wx list data | Wx列表数据
  49. WxListInfo {
  50. BaseListInfo
  51. // The API list data | Wx列表数据
  52. Data []WxInfo `json:"data"`
  53. }
  54. // Get wx list request params | Wx列表请求参数
  55. WxListReq {
  56. PageInfo
  57. // 服务器id
  58. ServerId *uint64 `json:"serverId,optional"`
  59. // 租户id
  60. OrganizationId *uint64 `json:"organizationId,optional"`
  61. // 租户名称
  62. OrganizationName *string `json:"organizationName,optional"`
  63. // 端口号
  64. Port *string `json:"port,optional"`
  65. // 进程号
  66. ProcessId *string `json:"processId,optional"`
  67. // 回调地址
  68. Callback *string `json:"callback,optional"`
  69. }
  70. // Wx information response | Wx信息返回体
  71. WxInfoResp {
  72. BaseDataInfo
  73. // Wx information | Wx数据
  74. Data WxInfo `json:"data"`
  75. }
  76. )
  77. @server(
  78. jwt: Auth
  79. group: Wx
  80. middleware: Authority
  81. )
  82. service Wechat {
  83. // Create wx information | 创建Wx
  84. @handler createWx
  85. post /wx/create (WxInfo) returns (BaseMsgResp)
  86. // Check wx information | 检查并更新Wx状态
  87. @handler checkWx
  88. post /wx/check (WxInfo) returns (BaseMsgResp)
  89. // Update wx information | 更新Wx
  90. @handler updateWx
  91. post /wx/update (WxInfo) returns (BaseMsgResp)
  92. // Delete wx information | 删除Wx信息
  93. @handler deleteWx
  94. post /wx/delete (IDReq) returns (BaseMsgResp)
  95. // Get wx list | 获取Wx列表
  96. @handler getWxList
  97. post /wx/list (WxListReq) returns (WxListResp)
  98. // Get wx by ID | 通过ID获取Wx
  99. @handler getWxById
  100. post /wx (IDReq) returns (WxInfoResp)
  101. }