소스 검색

Dev add 实体类

tsurumure 3 달 전
부모
커밋
e750b4cbd0

+ 13 - 12
db/crt_drama_project_storyboard.sql

@@ -11,29 +11,30 @@ CREATE TABLE `crt_drama_project_storyboard` (
     `user_id` BIGINT NOT NULL COMMENT '用户ID',
 
     `crt_drama_project_id` BIGINT COMMENT '项目ID',
-    `episode_num` INT NOT NULL COMMENT '集数',
+    `episode_num` INT NOT NULL COMMENT '集数 (不超过999集)',
     `sort` INT NOT NULL COMMENT '排序',
 
     `story_prompt` VARCHAR(500) COMMENT '分镜设计',
     `story_framing` VARCHAR(500) COMMENT '景别',
-    `story_scene` VARCHAR(500) COMMENT '景',
+    `story_scene` VARCHAR(500) COMMENT '景',
     `story_weather_time` VARCHAR(500) COMMENT '天气/时间',
     `crt_lora_figure_ids` VARCHAR(255) COMMENT '人物LoRA ID (创建时,跟随项目的人物LoRAID)(多个人物ID以逗号分隔)',
 
-    `set_image_count` INT DEFAULT '1' COMMENT '每次生成图片数量 (默认值:1,整数范围:1~4)',
-    `set_prompt_weight` FLOAT DEFAULT '3.5' COMMENT '提示词引导系数 (默认值:3.5,小数点后一位,范围:1~30)',
-    `set_sampling_method` VARCHAR(255) DEFAULT 'Euler' COMMENT '采样方法 (枚举)(Euler: euler, DPM++2M: dpmpp_2m)',
-    `set_step_count` INT DEFAULT '20' COMMENT '步数 (默认值:20,整数范围:1~30)',
-    `set_random_seed` TINYINT DEFAULT '1' COMMENT '随机种子 (默认值:1,范围:(1:随机, 2:自定义))',
-    `set_random_seed_custom` VARCHAR(255) COMMENT '随机种子自定义值 (长度: 0~64位整数)',
-
+    `param_image_count` INT DEFAULT '1' COMMENT '每次生成图片数量 (默认值:1,整数范围:1~4)',
+    `param_prompt_weight` FLOAT DEFAULT '3.5' COMMENT '提示词引导系数 (默认值:3.5,小数点后一位,范围:1~30)',
+    `param_sampling_method` VARCHAR(255) DEFAULT 'Euler' COMMENT '采样方法 (枚举)(Euler: euler, DPM++2M: dpmpp_2m)',
+    `param_step_count` INT DEFAULT '20' COMMENT '步数 (默认值:20,整数范围:1~30)',
+    `param_random_seed` TINYINT DEFAULT '1' COMMENT '随机种子 (默认值:1,范围:(1:随机, 2:自定义))',
+    `param_random_seed_custom` VARCHAR(255) COMMENT '随机种子自定义值 (长度: 0~64位整数)',
     `text_to_image_prompt` VARCHAR(1000) COMMENT '文生图提示词 (生图时必填)',
-    `text_to_image_status` TINYINT DEFAULT '-1' COMMENT '文生图状态 (-1:未生图, 1:生成中, 2:已生图)',
 
-    `set_video_reference_type` TINYINT DEFAULT '1' COMMENT '生视频模式 (1:首尾帧模式, 2:多图参考模式)',
-    `set_video_reference_images` TEXT COMMENT '参考图 (1~4张)(多图以逗号分隔)',
+    `param_video_reference_type` TINYINT DEFAULT '1' COMMENT '生视频模式 (1:首尾帧模式, 2:多图参考模式)',
+    `param_video_reference_images` TEXT COMMENT '参考图 (1~4张)(多图以逗号分隔)',
     `image_to_video_prompt` VARCHAR(1000) COMMENT '图生视频提示词 (生视频时必填)',
 
+    `generate_image_status` TINYINT DEFAULT '-1' COMMENT '生图状态 (-1:未生图, 1:生成中, 2:已生图)',
+    `generate_video_status` TINYINT DEFAULT '-1' COMMENT '生视频状态 (-1:未生视频, 1:生成中, 2:已生视频)',
+
     `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
     `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
     INDEX `idx_user_id` (`user_id`)

+ 3 - 1
db/crt_drama_task.sql

@@ -10,7 +10,7 @@ CREATE TABLE `crt_drama_task` (
     `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID',
     `user_id` BIGINT NOT NULL COMMENT '用户ID',
     `crt_drama_project_id` BIGINT NOT NULL COMMENT '项目ID',
-    `task_id` BIGINT NOT NULL COMMENT '任务ID',
+    `task_id` VARCHAR(255) NOT NULL COMMENT '任务ID',
     `task_type` TINYINT NOT NULL COMMENT '任务类型 (1:图像, 2:视频)',
     `task_status` TINYINT DEFAULT '-1' COMMENT '任务状态 (-1:未开始, 1:进行中, 2:成功, 3:失败)',
     `task_status_msg` VARCHAR(500) COMMENT '任务状态信息,当任务失败时展示失败原因(如触发平台的内容风控等)',
@@ -23,6 +23,8 @@ CREATE TABLE `crt_drama_task` (
 ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='短剧创作-生图任务表';
 
 /*
+    目前打算生图使用ComfyUI,生视频使用可灵。
+
     可灵并发:5
     ComfyUI并发:15
  */

+ 33 - 8
src/main/java/com/backendsys/modules/crt/entity/CrtDramaProjectStoryboard.java

@@ -9,17 +9,42 @@ import lombok.Data;
 @TableName("crt_drama_project_storyboard")
 public class CrtDramaProjectStoryboard {
 
+    public static interface Detail{}
+    public static interface Create{}
+    public static interface Update{}
+    public static interface Delete{}
+
     @TableId(type = IdType.AUTO)
     private Long id;
 
     private Long user_id;
-    private Long crt_drama_project_id;
-    private Integer episode_num;
-    private Integer sort;
-    private String story_prompt;
-    private String story_framing;
-    private String story_scene;
-
-    // ..
+    private Long crt_drama_project_id;              // 项目ID
+    private Integer episode_num;                    // 集数 (不超过999集)
+    private Integer sort;                           // 排序
+
+    private String story_prompt;                    // 分镜设计
+    private String story_framing;                   // 景别
+    private String story_scene;                     // 场景
+    private String story_weather_time;              // 天气/时间
+    private String crt_lora_figure_ids;             // 人物LoRA ID (创建时,跟随项目的人物LoRAID)(多个人物ID以逗号分隔)
+
+    private Integer param_image_count;              // 每次生成图片数量 (默认值:1,整数范围:1~4)
+    private Float param_prompt_weight;              // 提示词引导系数 (默认值:3.5,小数点后一位,范围:1~30)
+    private String param_sampling_method;           // 采样方法 (枚举: SamplingMethodEnums)(Euler: euler, DPM++2M: dpmpp_2m)
+    private Integer param_step_count;               // 步数 (默认值:20,整数范围:1~30)
+    private Integer param_random_seed;              // 随机种子 (默认值:1,范围:(1:随机, 2:自定义))
+    private String param_random_seed_custom;        // 随机种子自定义值 (长度: 0~64位整数)
+    private String text_to_image_prompt;            // 文生图提示词 (生图时必填)
+
+    private Integer param_video_reference_type;     // 生视频模式 (1:首尾帧模式, 2:多图参考模式)
+    private String param_video_reference_images;    // 参考图 (1~4张)(多图以逗号分隔)
+    private String image_to_video_prompt;           // 图生视频提示词 (生视频时必填)
+
+    private Integer generate_image_status;           // 生图状态 (-1:未生图, 1:生成中, 2:已生图)
+    private Integer generate_video_status;           // 生视频状态 (-1:未生视频, 1:生成中, 2:已生视频)
+
+    private String create_time;
+    private String update_time;
+
 
 }

+ 24 - 0
src/main/java/com/backendsys/modules/crt/entity/CrtDramaTask.java

@@ -0,0 +1,24 @@
+package com.backendsys.modules.crt.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("crt_drama_task")
+public class CrtDramaTask {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    private Long user_id;                       // 用户ID
+    private Long crt_drama_project_id;          // 项目ID
+    private String task_id;                     // 任务ID
+    private Integer task_type;                  // 任务类型 (1:图像, 2:视频)
+    private Integer task_status;                // 任务状态 (-1:未开始, 1:进行中, 2:成功, 3:失败)
+    private String task_status_msg;             // 任务状态信息,当任务失败时展示失败原因(如触发平台的内容风控等)
+    private String task_result;                 // 任务生成结果 (JSONString)(成功时,返回生成结果)
+    private String create_time;
+    private String update_time;
+
+}

+ 25 - 0
src/main/java/com/backendsys/modules/crt/enums/AspectRatioEnums.java

@@ -0,0 +1,25 @@
+package com.backendsys.modules.crt.enums;
+
+public enum AspectRatioEnums {
+
+    RATIO_16_9("16:9", "1280*720"),
+    RATIO_9_16("9:16", "720*1280"),
+    RATIO_1_1("1:1", "1024*1024")
+    ;
+
+    private final String key;
+    private final String value;
+
+    AspectRatioEnums(String key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getValue() {
+        return this.value;
+    }
+    public String getKey() {
+        return this.key;
+    }
+
+}

+ 26 - 0
src/main/java/com/backendsys/modules/crt/enums/DramaProjectSettingType.java

@@ -0,0 +1,26 @@
+package com.backendsys.modules.crt.enums;
+
+public enum DramaProjectSettingType {
+
+    GENERATE_IMAGE(1, "生图配置"),
+    GENERATE_VIDEO(2, "生视频配置")
+    ;
+
+    private final Integer key;
+    private final String value;
+
+    DramaProjectSettingType(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getValue() {
+        return this.value;
+    }
+    public Integer getKey() {
+        return this.key;
+    }
+
+
+
+}

+ 28 - 0
src/main/java/com/backendsys/modules/crt/enums/GenerateImageStatusEnums.java

@@ -0,0 +1,28 @@
+package com.backendsys.modules.crt.enums;
+
+/**
+ * 生图状态
+ */
+public enum GenerateImageStatusEnums {
+
+    WAIT(-1, "未生图"),
+    FAILED(1, "生成中"),
+    SUCCESS(2, "已生图")
+    ;
+
+    private final Integer key;
+    private final String value;
+
+    GenerateImageStatusEnums(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getValue() {
+        return this.value;
+    }
+    public Integer getKey() {
+        return this.key;
+    }
+
+}

+ 28 - 0
src/main/java/com/backendsys/modules/crt/enums/GenerateVideoStatusEnums.java

@@ -0,0 +1,28 @@
+package com.backendsys.modules.crt.enums;
+
+/**
+ * 生视频状态
+ */
+public enum GenerateVideoStatusEnums {
+
+    WAIT(-1, "未生视频"),
+    FAILED(1, "生成中"),
+    SUCCESS(2, "已生视频")
+    ;
+
+    private final Integer key;
+    private final String value;
+
+    GenerateVideoStatusEnums(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getValue() {
+        return this.value;
+    }
+    public Integer getKey() {
+        return this.key;
+    }
+
+}

+ 27 - 0
src/main/java/com/backendsys/modules/crt/enums/SamplingMethodEnums.java

@@ -0,0 +1,27 @@
+package com.backendsys.modules.crt.enums;
+
+/**
+ * 采样方法
+ */
+public enum SamplingMethodEnums {
+
+    EULER("Euler", "DPM++2M"),
+    DPM2M("DPM++2M", "dpmpp_2m")
+    ;
+
+    private final String key;
+    private final String value;
+
+    SamplingMethodEnums(String key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getValue() {
+        return this.value;
+    }
+    public String getKey() {
+        return this.key;
+    }
+
+}

+ 28 - 0
src/main/java/com/backendsys/modules/crt/enums/TaskStatusEnums.java

@@ -0,0 +1,28 @@
+package com.backendsys.modules.crt.enums;
+
+/**
+ * 任务状态
+ */
+public enum TaskStatusEnums {
+
+    WAIT(-1, "未开始"),
+    FAILED(1, "进行中"),
+    SUCCESS(2, "成功")
+    ;
+
+    private final Integer key;
+    private final String value;
+
+    TaskStatusEnums(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getValue() {
+        return this.value;
+    }
+    public Integer getKey() {
+        return this.key;
+    }
+
+}

+ 27 - 0
src/main/java/com/backendsys/modules/crt/enums/TaskTypeEnums.java

@@ -0,0 +1,27 @@
+package com.backendsys.modules.crt.enums;
+
+/**
+ * 任务类型
+ */
+public enum TaskTypeEnums {
+
+    IMAGE(1, "图像"),
+    VIDEO(2, "视频")
+    ;
+
+    private final Integer key;
+    private final String value;
+
+    TaskTypeEnums(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getValue() {
+        return this.value;
+    }
+    public Integer getKey() {
+        return this.key;
+    }
+
+}