Files
ipms-sjy-ui/src/api/ai/model/apiKey/index.ts

45 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-05-09 23:02:57 +08:00
import request from '@/config/axios'
// AI API 密钥 VO
export interface ApiKeyVO {
id: number // 编号
name: string // 名称
apiKey: string // 密钥
platform: string // 平台
url: string // 自定义 API 地址
status: number // 状态
}
// AI API 密钥 API
export const ApiKeyApi = {
2024-05-10 22:48:33 +08:00
// 查询 API 密钥分页
2024-05-09 23:02:57 +08:00
getApiKeyPage: async (params: any) => {
return await request.get({ url: `/ai/api-key/page`, params })
},
// 获得 API 密钥列表
getApiKeyList: async () => {
return await request.get({ url: `/ai/api-key/simple-list` })
},
2024-05-10 22:48:33 +08:00
// 查询 API 密钥详情
2024-05-09 23:02:57 +08:00
getApiKey: async (id: number) => {
return await request.get({ url: `/ai/api-key/get?id=` + id })
},
2024-05-10 22:48:33 +08:00
// 新增 API 密钥
2024-05-09 23:02:57 +08:00
createApiKey: async (data: ApiKeyVO) => {
return await request.post({ url: `/ai/api-key/create`, data })
},
2024-05-10 22:48:33 +08:00
// 修改 API 密钥
2024-05-09 23:02:57 +08:00
updateApiKey: async (data: ApiKeyVO) => {
return await request.put({ url: `/ai/api-key/update`, data })
},
2024-05-10 22:48:33 +08:00
// 删除 API 密钥
2024-05-09 23:02:57 +08:00
deleteApiKey: async (id: number) => {
return await request.delete({ url: `/ai/api-key/delete?id=` + id })
}
}