zn-cloud/sql/mysql/multipart_upload_session.sql
aikai 79e96d3546 feat(infra): 实现 MinIO 分片上传功能
- 新增分片上传相关接口和 VO 类
- 实现分片上传服务,包括初始化、获取预签名 URL、完成上传和取消上传
- 添加分片上传会话的数据库表结构和 Mapper
- 优化错误处理和参数验证
2025-07-03 11:18:53 +08:00

25 lines
1.4 KiB
SQL
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.

-- 分片上传会话表
CREATE TABLE `multipart_upload_session` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
`upload_id` varchar(255) NOT NULL COMMENT '上传会话ID',
`object_name` varchar(500) NOT NULL COMMENT '对象名称',
`file_size` bigint(20) NOT NULL COMMENT '文件大小',
`chunk_size` int(11) NOT NULL COMMENT '分片大小',
`total_chunks` int(11) NOT NULL COMMENT '总分片数',
`file_name` varchar(255) NOT NULL COMMENT '文件名',
`file_type` varchar(100) NOT NULL COMMENT '文件类型',
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
`expires_at` datetime NOT NULL COMMENT '过期时间',
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态0-进行中1-已完成2-已取消',
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_upload_id` (`upload_id`),
KEY `idx_user_id` (`user_id`),
KEY `idx_expires_at` (`expires_at`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分片上传会话表';