feat: 兼容claude格式
This commit is contained in:
17
Yi.Ai.Vue3/src/api/systemStatistics/index.ts
Normal file
17
Yi.Ai.Vue3/src/api/systemStatistics/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { post } from '@/utils/request';
|
||||
import type {
|
||||
ProfitStatisticsInput,
|
||||
ProfitStatisticsOutput,
|
||||
TokenStatisticsInput,
|
||||
TokenStatisticsOutput,
|
||||
} from './types';
|
||||
|
||||
// 获取利润统计数据
|
||||
export function getProfitStatistics(data: ProfitStatisticsInput) {
|
||||
return post<ProfitStatisticsOutput>('/system-statistics/profit', data).json();
|
||||
}
|
||||
|
||||
// 获取指定日期各模型Token统计
|
||||
export function getTokenStatistics(data: TokenStatisticsInput) {
|
||||
return post<TokenStatisticsOutput>('/system-statistics/token', data).json();
|
||||
}
|
||||
41
Yi.Ai.Vue3/src/api/systemStatistics/types.ts
Normal file
41
Yi.Ai.Vue3/src/api/systemStatistics/types.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
// 利润统计输入
|
||||
export interface ProfitStatisticsInput {
|
||||
currentCost: number;
|
||||
}
|
||||
|
||||
// 利润统计输出
|
||||
export interface ProfitStatisticsOutput {
|
||||
date: string;
|
||||
totalUsedTokens: number;
|
||||
totalUsedTokensInHundredMillion: number;
|
||||
totalRemainingTokens: number;
|
||||
totalRemainingTokensInHundredMillion: number;
|
||||
currentCost: number;
|
||||
costPerHundredMillion: number;
|
||||
totalCost: number;
|
||||
totalRevenue: number;
|
||||
profitRate: number;
|
||||
costAt200Price: number;
|
||||
}
|
||||
|
||||
// Token统计输入
|
||||
export interface TokenStatisticsInput {
|
||||
date: string;
|
||||
}
|
||||
|
||||
// 模型Token统计DTO
|
||||
export interface ModelTokenStatisticsDto {
|
||||
modelId: string;
|
||||
modelName: string;
|
||||
tokens: number;
|
||||
tokensInWan: number;
|
||||
count: number;
|
||||
cost: number;
|
||||
costPerHundredMillion: number;
|
||||
}
|
||||
|
||||
// Token统计输出
|
||||
export interface TokenStatisticsOutput {
|
||||
date: string;
|
||||
modelStatistics: ModelTokenStatisticsDto[];
|
||||
}
|
||||
Reference in New Issue
Block a user