Mure 2 долоо хоног өмнө
parent
commit
fe018b6ec4

+ 1 - 0
db/ai_material_category.sql

@@ -11,6 +11,7 @@ CREATE TABLE `ai_material_category` (
     `lora_id` BIGINT COMMENT '素材风格ID',
     `category_name` VARCHAR(255) NOT NULL COMMENT '素材分类名称',
     `is_share` TINYINT DEFAULT '-1' COMMENT '是否共享(-1:不共享, 1:共享)',
+    `is_enable_feedback` TINYINT DEFAULT '1' COMMENT '是否显示在反馈表单',
     `sort` INT DEFAULT '1' COMMENT '排序',
     INDEX `idx_category_name` (`category_name`)
 ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='素材分类表';

+ 1 - 0
db/ai_material_lora.sql

@@ -9,6 +9,7 @@ CREATE TABLE `ai_material_lora` (
     PRIMARY KEY (`id`),
     `id` BIGINT AUTO_INCREMENT COMMENT 'ID',
     `lora_name` VARCHAR(255) NOT NULL COMMENT '素材风格名称',
+    `is_enable_feedback` TINYINT DEFAULT '1' COMMENT '是否显示在反馈表单',
     `sort` INT DEFAULT '1' COMMENT '排序',
     INDEX `idx_lora_name` (`lora_name`)
 ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='素材风格表';

+ 2 - 0
src/main/java/com/backendsys/modules/material/entity/MaterialCategory.java

@@ -35,6 +35,8 @@ public class MaterialCategory {
     @RangeArray(message="是否共享取值有误,范围应是(-1否, 1是)", value = { "-1", "1" }, groups = { Create.class, Update.class })
     private Integer is_share;
 
+    private Integer is_enable_feedback;
+
     @TableField(exist = false)
     private String lora_name;
 

+ 2 - 0
src/main/java/com/backendsys/modules/material/entity/MaterialLora.java

@@ -34,4 +34,6 @@ public class MaterialLora {
     @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间")
     private Integer sort;
 
+    private Integer is_enable_feedback;
+
 }

+ 5 - 0
src/main/resources/mapper/ai/material/MaterialCategoryDao.xml

@@ -9,6 +9,7 @@
         mcl.lora_name,
         mc.category_name,
         mc.is_share,
+        mc.is_enable_feedback,
         mc.sort
     </sql>
     <!-- COALESCE(content_type, '') content_type, -->
@@ -19,6 +20,7 @@
         <result property="lora_name" column="lora_name" />
         <result property="category_name" column="category_name" />
         <result property="is_share" column="is_share" javaType="java.lang.Integer"/>
+        <result property="is_enable_feedback" column="is_enable_feedback" javaType="java.lang.Integer"/>
         <result property="sort" column="sort" javaType="java.lang.Integer" />
     </resultMap>
 
@@ -37,6 +39,9 @@
             <if test="is_share != null and is_share != ''">
                 AND mc.is_share = #{is_share}
             </if>
+            <if test="is_enable_feedback != null and is_enable_feedback != ''">
+                AND mc.is_enable_feedback = #{is_enable_feedback}
+            </if>
         </where>
         ORDER BY mc.sort DESC
     </select>

+ 3 - 1
src/main/resources/mapper/ai/material/MaterialLoraDao.xml

@@ -6,7 +6,8 @@
         id,
         id lora_id,
         lora_name,
-        sort
+        sort,
+        is_enable_feedback
     </sql>
     <!-- COALESCE(content_type, '') content_type, -->
     <resultMap id="resultMapMaterialLora" type="com.backendsys.modules.material.entity.MaterialLora">
@@ -14,6 +15,7 @@
         <result property="lora_id" column="id" javaType="java.lang.Long" />
         <result property="lora_name" column="lora_name" />
         <result property="sort" column="sort" javaType="java.lang.Integer" />
+        <result property="is_enable_feedback" column="is_enable_feedback" javaType="java.lang.Integer" />
     </resultMap>
 
     <select id="selectMaterialLoraList" resultMap="resultMapMaterialLora">