Files
quyun-v2/backend/app/http/v1/dto/upload.go
2026-01-08 15:13:15 +08:00

36 lines
957 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package dto
type UploadInitForm struct {
// Hash 文件哈希(用于秒传校验)。
Hash string `json:"hash"`
// Size 文件大小(字节)。
Size int64 `json:"size"`
// Filename 原始文件名。
Filename string `json:"filename"`
// MimeType 文件类型(如 image/png
MimeType string `json:"mime_type"`
// Type 业务类型(如 cover/media/avatar
Type string `json:"type"`
}
type UploadInitResponse struct {
// UploadID 分片上传ID。
UploadID string `json:"upload_id"`
// Key 对象存储KeyS3 直传使用)。
Key string `json:"key"`
// ChunkSize 分片大小(字节)。
ChunkSize int64 `json:"chunk_size"`
}
type UploadPartForm struct {
// UploadID 分片上传ID。
UploadID string `form:"upload_id"`
// PartNumber 分片序号(从 1 开始)。
PartNumber int `form:"part_number"`
}
type UploadCompleteForm struct {
// UploadID 分片上传ID。
UploadID string `json:"upload_id"`
}