From 04eb6015ea8cab28d37371aa6dfdadf27f6f565d Mon Sep 17 00:00:00 2001 From: sol Date: Wed, 23 Jul 2025 14:39:59 +0800 Subject: [PATCH] feat(file): Add a video table and optimize the video frame rate field --- .../model/file/video/dto/VideoCreateDto.java | 4 +-- .../model/file/video/dto/VideoUpdateDto.java | 4 +-- .../model/file/video/entity/VideoEntity.java | 4 +-- .../db/file/V1.1__create_file_image.sql | 25 +++++++++++++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/dto/VideoCreateDto.java b/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/dto/VideoCreateDto.java index 8f545b0..e5684a8 100644 --- a/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/dto/VideoCreateDto.java +++ b/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/dto/VideoCreateDto.java @@ -33,7 +33,7 @@ public class VideoCreateDto extends BaseCreateDto { private Integer bitrate; @Schema(description = "视频帧率") - private Integer frameRate; + private Integer fps; @Schema(description = "视频编码") private String codec; @@ -50,7 +50,7 @@ public class VideoCreateDto extends BaseCreateDto { .duration(duration) .format(format) .bitrate(bitrate) - .frameRate(frameRate) + .fps(fps) .codec(codec) .fileId(fileId) .build()); diff --git a/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/dto/VideoUpdateDto.java b/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/dto/VideoUpdateDto.java index 9ea0b02..775ee9d 100644 --- a/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/dto/VideoUpdateDto.java +++ b/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/dto/VideoUpdateDto.java @@ -33,7 +33,7 @@ public class VideoUpdateDto extends BaseUpdateDto { private Integer bitrate; @Schema(description = "视频帧率") - private Integer frameRate; + private Integer fps; @Schema(description = "视频编码") private String codec; @@ -50,7 +50,7 @@ public class VideoUpdateDto extends BaseUpdateDto { .duration(duration) .format(format) .bitrate(bitrate) - .frameRate(frameRate) + .fps(fps) .codec(codec) .fileId(fileId) .build()); diff --git a/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/entity/VideoEntity.java b/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/entity/VideoEntity.java index db3c6c0..730e8d1 100644 --- a/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/entity/VideoEntity.java +++ b/cloud/model/model-file/src/main/java/com/bgasol/model/file/video/entity/VideoEntity.java @@ -45,8 +45,8 @@ public class VideoEntity extends BaseEntity { private Integer bitrate; @Schema(description = "视频帧率") - @TableField("frame_rate") - private Integer frameRate; + @TableField("fps") + private Integer fps; @Schema(description = "视频编码") @TableField("codec") diff --git a/cloud/model/model-file/src/main/resources/db/file/V1.1__create_file_image.sql b/cloud/model/model-file/src/main/resources/db/file/V1.1__create_file_image.sql index 04c67e3..04719ff 100644 --- a/cloud/model/model-file/src/main/resources/db/file/V1.1__create_file_image.sql +++ b/cloud/model/model-file/src/main/resources/db/file/V1.1__create_file_image.sql @@ -43,3 +43,28 @@ CREATE TABLE t_image -- 为图片表添加索引 CREATE INDEX idx_image_file_id ON t_image(file_id); CREATE INDEX idx_image_name ON t_image(name); + +CREATE TABLE t_video +( + id VARCHAR(255) NOT NULL PRIMARY KEY, + type VARCHAR(255), + sort INTEGER, + create_time TIMESTAMP(6), + update_time TIMESTAMP(6), + description VARCHAR(255), + deleted INTEGER, + + name VARCHAR(255), -- 视频名称 + width INTEGER, -- 视频宽度 + height INTEGER, -- 视频高度 + duration INTEGER, -- 视频时长(秒) + format VARCHAR(255), -- 视频格式 + bitrate INTEGER, -- 视频码率 + fps INTEGER, -- 视频帧率 + codec VARCHAR(255), -- 视频编码格式 + file_id VARCHAR(255) -- 视频文件id +); + +-- 为视频表添加索引 +CREATE INDEX idx_video_file_id ON t_video(file_id); +CREATE INDEX idx_video_name ON t_video(name);