feat(template): 添加模板缩放裁剪功能

- 在 TemplateEntity 中添加 zoomCut 字段,用于控制模板的缩放裁剪
- 更新 TemplateMapper.xml,增加 zoom_cut 列的插入和更新逻辑
This commit is contained in:
2025-09-08 10:54:21 +08:00
parent 29637bc5e5
commit c1ca4e8631
2 changed files with 4 additions and 2 deletions

View File

@@ -76,6 +76,7 @@ public class TemplateEntity {
private Integer sort; private Integer sort;
private Integer cropEnable; private Integer cropEnable;
private Integer zoomCut;
private String onlyIf; private String onlyIf;
private String resolution; private String resolution;
private List<TemplateEntity> children; private List<TemplateEntity> children;

View File

@@ -2,8 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ycwl.basic.mapper.TemplateMapper"> <mapper namespace="com.ycwl.basic.mapper.TemplateMapper">
<insert id="add"> <insert id="add">
insert into template(id, scenic_id, `name`, pid, is_placeholder, source_url, effects, luts, overlays, audios, cover_url, frame_rate, speed, price, slash_price, sort, crop_enable, only_if, resolution, create_time) insert into template(id, scenic_id, `name`, pid, is_placeholder, source_url, effects, luts, overlays, audios, cover_url, frame_rate, speed, price, slash_price, sort, crop_enable, zoom_cut, only_if, resolution, create_time)
values (#{id}, #{scenicId}, #{name}, #{pid}, #{isPlaceholder}, #{sourceUrl}, #{effects}, #{luts}, #{overlays}, #{audios}, #{coverUrl}, #{frameRate}, #{speed}, #{price}, #{slashPrice}, #{sort}, #{cropEnable}, #{onlyIf}, #{resolution}, now()) values (#{id}, #{scenicId}, #{name}, #{pid}, #{isPlaceholder}, #{sourceUrl}, #{effects}, #{luts}, #{overlays}, #{audios}, #{coverUrl}, #{frameRate}, #{speed}, #{price}, #{slashPrice}, #{sort}, #{cropEnable}, #{zoomCut}, #{onlyIf}, #{resolution}, now())
</insert> </insert>
<insert id="addConfig"> <insert id="addConfig">
insert into template_config(id, template_id, create_time) insert into template_config(id, template_id, create_time)
@@ -29,6 +29,7 @@
<if test="speed!= null">speed = #{speed}, </if> <if test="speed!= null">speed = #{speed}, </if>
<if test="sort!= null">sort = #{sort}, </if> <if test="sort!= null">sort = #{sort}, </if>
<if test="cropEnable!= null">crop_enable = #{cropEnable}, </if> <if test="cropEnable!= null">crop_enable = #{cropEnable}, </if>
<if test="zoomCut!= null">zoom_cut = #{zoomCut}, </if>
<if test="onlyIf!= null">only_if = #{onlyIf}, </if> <if test="onlyIf!= null">only_if = #{onlyIf}, </if>
<if test="resolution!= null">resolution = #{resolution}, </if> <if test="resolution!= null">resolution = #{resolution}, </if>
</set> </set>