Tool History
工具任务记录与结果。
Base URL https://api.sniphunter.com
请求与响应中的 $ref 在 OpenAPI 的 components 中定义。
5 个接口
Tool History
POST/api/v1/tool-history创建工具使用历史记录
记录用户使用工具的历史
{
"security": [
{
"HTTPBearer": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolHistoryCreate"
}
}
}
},
"responses": {
"201": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolHistoryResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}GET/api/v1/tool-history获取工具使用历史记录列表
分页获取当前用户的工具使用历史记录
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"description": "页码",
"default": 1,
"title": "Page"
},
"description": "页码"
},
{
"name": "page_size",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"maximum": 100,
"minimum": 1,
"description": "每页数量",
"default": 20,
"title": "Page Size"
},
"description": "每页数量"
},
{
"name": "tool_category",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "工具分类筛选",
"title": "Tool Category"
},
"description": "工具分类筛选"
},
{
"name": "tool_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "工具ID筛选",
"title": "Tool Id"
},
"description": "工具ID筛选"
},
{
"name": "status_filter",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "状态筛选",
"title": "Status Filter"
},
"description": "状态筛选"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolHistoryListResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}DELETE/api/v1/tool-history/批量删除工具使用历史记录
根据条件批量删除工具使用历史记录
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "tool_category",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "工具分类筛选",
"title": "Tool Category"
},
"description": "工具分类筛选"
},
{
"name": "tool_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "工具ID筛选",
"title": "Tool Id"
},
"description": "工具ID筛选"
},
{
"name": "status_filter",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "状态筛选",
"title": "Status Filter"
},
"description": "状态筛选"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolHistoryDeleteResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}GET/api/v1/tool-history/{history_id}获取单个工具使用历史记录
根据ID获取工具使用历史记录详情
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "history_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"title": "History Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolHistoryResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}DELETE/api/v1/tool-history/{history_id}删除工具使用历史记录
根据ID删除工具使用历史记录
{
"security": [
{
"HTTPBearer": []
}
],
"parameters": [
{
"name": "history_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"title": "History Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ToolHistoryDeleteResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}数据模型
展开 components
{
"schemas": {
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"ToolHistoryCreate": {
"properties": {
"tool_id": {
"type": "string",
"title": "Tool Id",
"description": "工具ID"
},
"tool_name": {
"type": "string",
"title": "Tool Name",
"description": "工具名称"
},
"tool_category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Tool Category",
"description": "工具分类"
},
"input_params": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Input Params",
"description": "输入参数"
},
"output_result": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output Result",
"description": "输出结果"
},
"output_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output Type",
"description": "输出类型"
},
"status": {
"type": "string",
"title": "Status",
"description": "状态: pending, processing, completed, failed"
},
"error_message": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error Message",
"description": "错误信息"
},
"processing_time": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Processing Time",
"description": "处理时间(毫秒)"
},
"file_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "File Size",
"description": "文件大小(字节)"
},
"input_file_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Input File Url",
"description": "输入文件URL"
},
"input_file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Input File Name",
"description": "输入文件名"
},
"input_file_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Input File Size",
"description": "输入文件大小(字节)"
},
"input_file_format": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Input File Format",
"description": "输入文件格式"
},
"output_file_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output File Url",
"description": "输出文件URL"
},
"output_file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output File Name",
"description": "输出文件名"
},
"output_file_format": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output File Format",
"description": "输出文件格式"
},
"duration": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Duration",
"description": "视频/音频时长(秒)"
},
"resolution": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Resolution",
"description": "视频分辨率"
},
"bitrate": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Bitrate",
"description": "比特率(bps)"
},
"sample_rate": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Sample Rate",
"description": "音频采样率(Hz)"
},
"channels": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Channels",
"description": "音频声道数"
},
"platform": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Platform",
"description": "平台名称"
},
"source_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Url",
"description": "原始URL"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Metadata",
"description": "其他元数据"
}
},
"type": "object",
"required": [
"tool_id",
"tool_name",
"status"
],
"title": "ToolHistoryCreate",
"description": "创建工具历史记录请求模型"
},
"ToolHistoryDeleteResponse": {
"properties": {
"success": {
"type": "boolean",
"title": "Success",
"default": true
},
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ToolHistoryDeleteResponse",
"description": "删除工具历史记录响应模型"
},
"ToolHistoryListResponse": {
"properties": {
"success": {
"type": "boolean",
"title": "Success",
"default": true
},
"data": {
"items": {
"$ref": "#/components/schemas/ToolHistoryResponse"
},
"type": "array",
"title": "Data"
},
"total": {
"type": "integer",
"title": "Total"
},
"page": {
"type": "integer",
"title": "Page"
},
"page_size": {
"type": "integer",
"title": "Page Size"
},
"total_pages": {
"type": "integer",
"title": "Total Pages"
}
},
"type": "object",
"required": [
"data",
"total",
"page",
"page_size",
"total_pages"
],
"title": "ToolHistoryListResponse",
"description": "工具历史记录列表响应模型"
},
"ToolHistoryResponse": {
"properties": {
"tool_id": {
"type": "string",
"title": "Tool Id",
"description": "工具ID"
},
"tool_name": {
"type": "string",
"title": "Tool Name",
"description": "工具名称"
},
"tool_category": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Tool Category",
"description": "工具分类"
},
"input_params": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Input Params",
"description": "输入参数"
},
"output_result": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output Result",
"description": "输出结果"
},
"output_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output Type",
"description": "输出类型"
},
"status": {
"type": "string",
"title": "Status",
"description": "状态: pending, processing, completed, failed"
},
"error_message": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error Message",
"description": "错误信息"
},
"processing_time": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Processing Time",
"description": "处理时间(毫秒)"
},
"file_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "File Size",
"description": "文件大小(字节)"
},
"input_file_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Input File Url",
"description": "输入文件URL"
},
"input_file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Input File Name",
"description": "输入文件名"
},
"input_file_size": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Input File Size",
"description": "输入文件大小(字节)"
},
"input_file_format": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Input File Format",
"description": "输入文件格式"
},
"output_file_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output File Url",
"description": "输出文件URL"
},
"output_file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output File Name",
"description": "输出文件名"
},
"output_file_format": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Output File Format",
"description": "输出文件格式"
},
"duration": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Duration",
"description": "视频/音频时长(秒)"
},
"resolution": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Resolution",
"description": "视频分辨率"
},
"bitrate": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Bitrate",
"description": "比特率(bps)"
},
"sample_rate": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Sample Rate",
"description": "音频采样率(Hz)"
},
"channels": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Channels",
"description": "音频声道数"
},
"platform": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Platform",
"description": "平台名称"
},
"source_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Url",
"description": "原始URL"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Metadata",
"description": "其他元数据"
},
"id": {
"type": "integer",
"title": "Id"
},
"user_id": {
"type": "integer",
"title": "User Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
}
},
"type": "object",
"required": [
"tool_id",
"tool_name",
"status",
"id",
"user_id",
"created_at"
],
"title": "ToolHistoryResponse",
"description": "工具历史记录响应模型"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
},
"securitySchemes": {
"HTTPBearer": {
"type": "http",
"scheme": "bearer"
}
}
}