From 7348994427a5ddf045c7e21d974a04e1fb286146 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 15 Dec 2025 16:50:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(video):=20=E5=B0=86=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E4=B8=AD=E7=9A=84workerId=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=94=B9=E4=B8=BAfaceId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改VideoEntity类中字段workerId为faceId,并更新注释 - 更新TaskTaskServiceImpl中设置视频信息的逻辑,使用faceId替代workerId - 修改VideoMapper.xml中插入视频记录的SQL语句,字段由workerId改为faceId - 调整VideoMapper.xml中更新视频记录的SQL条件,使用faceId进行筛选 - 更新VideoMapper.xml中查询视频列表和单个视频详情的SQL语句,字段名由workerId改为faceId - 优化查询条件中对faceId的处理逻辑,直接关联video表的face_id字段 --- .../model/pc/video/entity/VideoEntity.java | 4 ++-- .../basic/repository/VideoRepository.java | 5 ----- .../task/impl/TaskTaskServiceImpl.java | 2 +- src/main/resources/mapper/VideoMapper.xml | 20 ++++++++----------- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/ycwl/basic/model/pc/video/entity/VideoEntity.java b/src/main/java/com/ycwl/basic/model/pc/video/entity/VideoEntity.java index 6978fc0f..90fb4c5b 100644 --- a/src/main/java/com/ycwl/basic/model/pc/video/entity/VideoEntity.java +++ b/src/main/java/com/ycwl/basic/model/pc/video/entity/VideoEntity.java @@ -34,9 +34,9 @@ public class VideoEntity { */ private Long taskId; /** - * 执行任务的机器ID,render_worker.id + * 人脸ID,对应face.id */ - private Long workerId; + private Long faceId; /** * 视频链接 */ diff --git a/src/main/java/com/ycwl/basic/repository/VideoRepository.java b/src/main/java/com/ycwl/basic/repository/VideoRepository.java index c970cdf1..ec557d57 100644 --- a/src/main/java/com/ycwl/basic/repository/VideoRepository.java +++ b/src/main/java/com/ycwl/basic/repository/VideoRepository.java @@ -27,11 +27,6 @@ public class VideoRepository { public static final String VIDEO_CACHE_KEY = "video:%s"; public static final String VIDEO_BY_TASK_ID_CACHE_KEY = "video:task:%s"; @Autowired - @Lazy - private PriceBiz priceBiz; - @Autowired - private IVoucherService iVoucherService; - @Autowired private MemberRelationRepository memberRelationRepository; public VideoEntity getVideo(Long videoId) { diff --git a/src/main/java/com/ycwl/basic/service/task/impl/TaskTaskServiceImpl.java b/src/main/java/com/ycwl/basic/service/task/impl/TaskTaskServiceImpl.java index 461db2ff..060d558a 100644 --- a/src/main/java/com/ycwl/basic/service/task/impl/TaskTaskServiceImpl.java +++ b/src/main/java/com/ycwl/basic/service/task/impl/TaskTaskServiceImpl.java @@ -492,7 +492,7 @@ public class TaskTaskServiceImpl implements TaskService { video.setScenicId(task.getScenicId()); video.setTemplateId(task.getTemplateId()); video.setTaskId(taskId); - video.setWorkerId(worker.getId()); + video.setFaceId(task.getFaceId()); video.setVideoUrl(task.getVideoUrl()); video.setCreateTime(new Date()); if (req.getVideoInfo() != null) { diff --git a/src/main/resources/mapper/VideoMapper.xml b/src/main/resources/mapper/VideoMapper.xml index 7bacfd97..e912b1b7 100644 --- a/src/main/resources/mapper/VideoMapper.xml +++ b/src/main/resources/mapper/VideoMapper.xml @@ -2,8 +2,8 @@ - insert into video(id, scenic_id, template_id, task_id, worker_id, video_url, height, width, duration) - values (#{id}, #{scenicId}, #{templateId}, #{taskId}, #{workerId}, #{videoUrl}, #{height}, #{width}, #{duration}) + insert into video(id, scenic_id, template_id, task_id, face_id, video_url, height, width, duration) + values (#{id}, #{scenicId}, #{templateId}, #{taskId}, #{faceId}, #{videoUrl}, #{height}, #{width}, #{duration}) INSERT INTO member_video(member_id, scenic_id, face_id, template_id, task_id, video_id, is_buy, order_id) @@ -30,7 +30,7 @@ scenic_id = #{scenicId}, template_id = #{templateId}, task_id = #{taskId}, - worker_id = #{workerId}, + face_id = #{faceId}, video_url = #{videoUrl}, height = #{height}, width = #{width}, @@ -78,7 +78,7 @@ )