feat: 补充注释
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
// server/api/images/stats.get.ts - 生图统计接口:返回全局生图请求与成功失败统计。
|
||||
import type { IImageGenerationStatsData } from "#shared/types/openai";
|
||||
import {
|
||||
createApiLogger,
|
||||
createSuccessResponse,
|
||||
createUpstreamErrorResponse,
|
||||
getGenerationStats,
|
||||
toSafeLogError
|
||||
} from "~~/server/utils";
|
||||
|
||||
/**
|
||||
* GET /api/images/stats
|
||||
*
|
||||
* 流程:
|
||||
* 1. 读取 GenerationStats 的 global 单行统计。
|
||||
* 2. 没有统计行时返回全 0,避免前端需要处理空状态。
|
||||
* 3. 该接口返回全局统计,不包含用户输入、图片地址或上游响应。
|
||||
*/
|
||||
export default defineEventHandler(async () => {
|
||||
const logger = createApiLogger("images.stats");
|
||||
logger.info("开始");
|
||||
|
||||
Reference in New Issue
Block a user