切换批次和文件的 ID 类型为 UUID,更新相关逻辑和文档

This commit is contained in:
2026-01-14 13:30:50 +08:00
parent 5160ae78cc
commit 1ffa16cf48
11 changed files with 66 additions and 59 deletions

View File

@@ -291,8 +291,8 @@ const docTemplate = `{
"summary": "获取批次详情",
"parameters": [
{
"type": "integer",
"description": "批次 ID",
"type": "string",
"description": "批次 ID (UUID)",
"name": "batch_id",
"in": "path",
"required": true
@@ -344,8 +344,8 @@ const docTemplate = `{
"summary": "修改批次信息",
"parameters": [
{
"type": "integer",
"description": "批次 ID",
"type": "string",
"description": "批次 ID (UUID)",
"name": "batch_id",
"in": "path",
"required": true
@@ -403,8 +403,8 @@ const docTemplate = `{
"summary": "删除批次",
"parameters": [
{
"type": "integer",
"description": "批次 ID",
"type": "string",
"description": "批次 ID (UUID)",
"name": "batch_id",
"in": "path",
"required": true
@@ -710,8 +710,8 @@ const docTemplate = `{
"summary": "下载单个文件",
"parameters": [
{
"type": "integer",
"description": "文件 ID",
"type": "string",
"description": "文件 ID (UUID)",
"name": "file_id",
"in": "path",
"required": true
@@ -883,7 +883,7 @@ const docTemplate = `{
}
},
"id": {
"type": "integer"
"type": "string"
},
"max_downloads": {
"type": "integer"
@@ -911,13 +911,13 @@ const docTemplate = `{
"type": "object",
"properties": {
"batch_id": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
"type": "string"
},
"mime_type": {
"type": "string"
@@ -983,7 +983,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"batch_id": {
"type": "integer"
"type": "string"
},
"expire_at": {
"type": "string"

View File

@@ -284,8 +284,8 @@
"summary": "获取批次详情",
"parameters": [
{
"type": "integer",
"description": "批次 ID",
"type": "string",
"description": "批次 ID (UUID)",
"name": "batch_id",
"in": "path",
"required": true
@@ -337,8 +337,8 @@
"summary": "修改批次信息",
"parameters": [
{
"type": "integer",
"description": "批次 ID",
"type": "string",
"description": "批次 ID (UUID)",
"name": "batch_id",
"in": "path",
"required": true
@@ -396,8 +396,8 @@
"summary": "删除批次",
"parameters": [
{
"type": "integer",
"description": "批次 ID",
"type": "string",
"description": "批次 ID (UUID)",
"name": "batch_id",
"in": "path",
"required": true
@@ -703,8 +703,8 @@
"summary": "下载单个文件",
"parameters": [
{
"type": "integer",
"description": "文件 ID",
"type": "string",
"description": "文件 ID (UUID)",
"name": "file_id",
"in": "path",
"required": true
@@ -876,7 +876,7 @@
}
},
"id": {
"type": "integer"
"type": "string"
},
"max_downloads": {
"type": "integer"
@@ -904,13 +904,13 @@
"type": "object",
"properties": {
"batch_id": {
"type": "integer"
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
"type": "string"
},
"mime_type": {
"type": "string"
@@ -976,7 +976,7 @@
"type": "object",
"properties": {
"batch_id": {
"type": "integer"
"type": "string"
},
"expire_at": {
"type": "string"

View File

@@ -94,7 +94,7 @@ definitions:
$ref: '#/definitions/model.FileItem'
type: array
id:
type: integer
type: string
max_downloads:
type: integer
pickup_code:
@@ -113,11 +113,11 @@ definitions:
model.FileItem:
properties:
batch_id:
type: integer
type: string
created_at:
type: string
id:
type: integer
type: string
mime_type:
type: string
original_name:
@@ -161,7 +161,7 @@ definitions:
public.UploadResponse:
properties:
batch_id:
type: integer
type: string
expire_at:
type: string
pickup_code:
@@ -353,11 +353,11 @@ paths:
delete:
description: 标记批次为已删除,并物理删除关联的存储文件
parameters:
- description: 批次 ID
- description: 批次 ID (UUID)
in: path
name: batch_id
required: true
type: integer
type: string
produces:
- application/json
responses:
@@ -377,11 +377,11 @@ paths:
get:
description: 根据批次 ID 获取批次信息及关联的文件列表
parameters:
- description: 批次 ID
- description: 批次 ID (UUID)
in: path
name: batch_id
required: true
type: integer
type: string
produces:
- application/json
responses:
@@ -408,11 +408,11 @@ paths:
- application/json
description: 允许修改备注、过期策略、最大下载次数、状态等
parameters:
- description: 批次 ID
- description: 批次 ID (UUID)
in: path
name: batch_id
required: true
type: integer
type: string
- description: 修改内容
in: body
name: request
@@ -611,11 +611,11 @@ paths:
get:
description: 根据文件 ID 下载单个文件
parameters:
- description: 文件 ID
- description: 文件 ID (UUID)
in: path
name: file_id
required: true
type: integer
type: string
produces:
- application/octet-stream
responses: