mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-17 14:13:27 +08:00
feat: 添加 ui 部分
This commit is contained in:
200
ui/src/api/Model.ts
Normal file
200
ui/src/api/Model.ts
Normal file
@@ -0,0 +1,200 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
// @ts-nocheck
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
||||
* ## ##
|
||||
* ## AUTHOR: acacode ##
|
||||
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
||||
* ---------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import request, { ContentType, RequestParams } from "./httpClient";
|
||||
import {
|
||||
DomainAllModelResp,
|
||||
DomainCheckModelReq,
|
||||
DomainCreateModelReq,
|
||||
DomainModel,
|
||||
DomainModelTokenUsageResp,
|
||||
DomainUpdateModelReq,
|
||||
GetGetTokenUsageParams,
|
||||
GetMyModelListParams,
|
||||
WebResp,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
* @description 获取模型列表
|
||||
*
|
||||
* @tags Model
|
||||
* @name GetListModel
|
||||
* @summary 获取模型列表
|
||||
* @request GET:/api/v1/model
|
||||
* @response `200` `(WebResp & {
|
||||
data?: DomainAllModelResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getListModel = (params: RequestParams = {}) =>
|
||||
request<
|
||||
WebResp & {
|
||||
data?: DomainAllModelResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/v1/model`,
|
||||
method: "GET",
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 更新模型
|
||||
*
|
||||
* @tags Model
|
||||
* @name PutUpdateModel
|
||||
* @summary 更新模型
|
||||
* @request PUT:/api/v1/model
|
||||
* @response `200` `(WebResp & {
|
||||
data?: DomainModel,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const putUpdateModel = (
|
||||
model: DomainUpdateModelReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
request<
|
||||
WebResp & {
|
||||
data?: DomainModel;
|
||||
}
|
||||
>({
|
||||
path: `/api/v1/model`,
|
||||
method: "PUT",
|
||||
body: model,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 创建模型
|
||||
*
|
||||
* @tags Model
|
||||
* @name PostCreateModel
|
||||
* @summary 创建模型
|
||||
* @request POST:/api/v1/model
|
||||
* @response `200` `(WebResp & {
|
||||
data?: DomainModel,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postCreateModel = (
|
||||
model: DomainCreateModelReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
request<
|
||||
WebResp & {
|
||||
data?: DomainModel;
|
||||
}
|
||||
>({
|
||||
path: `/api/v1/model`,
|
||||
method: "POST",
|
||||
body: model,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 检查模型
|
||||
*
|
||||
* @tags Model
|
||||
* @name PostCheckModel
|
||||
* @summary 检查模型
|
||||
* @request POST:/api/v1/model/check
|
||||
* @response `200` `(WebResp & {
|
||||
data?: DomainModel,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const postCheckModel = (
|
||||
model: DomainCheckModelReq,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
request<
|
||||
WebResp & {
|
||||
data?: DomainModel;
|
||||
}
|
||||
>({
|
||||
path: `/api/v1/model/check`,
|
||||
method: "POST",
|
||||
body: model,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 获取我的模型列表
|
||||
*
|
||||
* @tags Model
|
||||
* @name GetMyModelList
|
||||
* @summary 获取我的模型列表
|
||||
* @request GET:/api/v1/model/my
|
||||
* @response `200` `(WebResp & {
|
||||
data?: (DomainModel)[],
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getMyModelList = (
|
||||
query: GetMyModelListParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
request<
|
||||
WebResp & {
|
||||
data?: DomainModel[];
|
||||
}
|
||||
>({
|
||||
path: `/api/v1/model/my`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description 获取模型token使用情况
|
||||
*
|
||||
* @tags Model
|
||||
* @name GetGetTokenUsage
|
||||
* @summary 获取模型token使用情况
|
||||
* @request GET:/api/v1/model/token-usage
|
||||
* @response `200` `(WebResp & {
|
||||
data?: DomainModelTokenUsageResp,
|
||||
|
||||
})` OK
|
||||
*/
|
||||
|
||||
export const getGetTokenUsage = (
|
||||
query: GetGetTokenUsageParams,
|
||||
params: RequestParams = {},
|
||||
) =>
|
||||
request<
|
||||
WebResp & {
|
||||
data?: DomainModelTokenUsageResp;
|
||||
}
|
||||
>({
|
||||
path: `/api/v1/model/token-usage`,
|
||||
method: "GET",
|
||||
query: query,
|
||||
type: ContentType.Json,
|
||||
format: "json",
|
||||
...params,
|
||||
});
|
||||
Reference in New Issue
Block a user