api_key.api 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import "../base.api"
  2. import "./agent.api"
  3. type (
  4. // The data of api_key information | ApiKey信息
  5. ApiKeyInfo {
  6. BaseIDInfo
  7. // Title
  8. Title *string `json:"title,optional"`
  9. // Key
  10. Key *string `json:"key,optional"`
  11. // 租户ID
  12. OrganizationId *uint64 `json:"organization_id,optional"`
  13. AgentId *uint64 `json:"agent_id,optional"`
  14. AgentInfo *AgentInfo `json:"agent_info,optional"`
  15. CustomAgentBase *string `json:"custom_agent_base,optional"`
  16. CustomAgentKey *string `json:"custom_agent_key,optional"`
  17. OpenaiBase *string `json:"openai_base,optional"`
  18. OpenaiKey *string `json:"openai_key,optional"`
  19. }
  20. // The response data of api_key list | ApiKey列表数据
  21. ApiKeyListResp {
  22. BaseDataInfo
  23. // ApiKey list data | ApiKey列表数据
  24. Data ApiKeyListInfo `json:"data"`
  25. }
  26. // ApiKey list data | ApiKey列表数据
  27. ApiKeyListInfo {
  28. BaseListInfo
  29. // The API list data | ApiKey列表数据
  30. Data []ApiKeyInfo `json:"data"`
  31. }
  32. // Get ApiKey list request params | ApiKey列表请求参数
  33. ApiKeyListReq {
  34. PageInfo
  35. // Key
  36. Key *string `json:"key,optional"`
  37. OrganizationId *uint64 `json:"organization_id,optional"`
  38. }
  39. )
  40. @server(
  41. group: api_key
  42. jwt: Auth
  43. middleware: Authority
  44. )
  45. service Wechat {
  46. // Create api_key information | 创建ApiKey
  47. @handler createApiKey
  48. post /api_key/create (ApiKeyInfo) returns (BaseMsgResp)
  49. // Update api_key information | 更新ApiKey
  50. @handler updateApiKey
  51. post /api_key/update (ApiKeyInfo) returns (BaseMsgResp)
  52. // Delete api_key information | 删除ApiKey信息
  53. @handler deleteApiKey
  54. post /api_key/delete (IDsReq) returns (BaseMsgResp)
  55. // Get api_key list | 获取ApiKey列表
  56. @handler getApiKeyList
  57. post /api_key/list (ApiKeyListReq) returns (ApiKeyListResp)
  58. }