From 487b38e8b0f2f89ee2ade5624d10174e919230a0 Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Sat, 30 May 2026 15:50:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=A2=8E=E7=89=87?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=92=8C=E4=BC=9A=E8=AF=9D=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84Service=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - StudyReportFragmentsService 接口新增 updateFragments 和 getFragmentsBySession 方法 - ServiceImpl 实现碎片更新(校验存在性后更新)和按会话编号查询碎片列表 --- .../service/StudyReportFragmentsService.java | 7 ++++++ .../impl/StudyReportFragmentsServiceImpl.java | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/main/java/com/guo/learningprogresstracker/service/StudyReportFragmentsService.java b/src/main/java/com/guo/learningprogresstracker/service/StudyReportFragmentsService.java index 6e9b5f8..525385b 100644 --- a/src/main/java/com/guo/learningprogresstracker/service/StudyReportFragmentsService.java +++ b/src/main/java/com/guo/learningprogresstracker/service/StudyReportFragmentsService.java @@ -1,10 +1,13 @@ package com.guo.learningprogresstracker.service; import com.guo.learningprogresstracker.dto.request.CreateFragmentsRequest; +import com.guo.learningprogresstracker.dto.request.UpdateFragmentsRequest; import com.guo.learningprogresstracker.entity.StudyReportFragmentsEntity; import com.baomidou.mybatisplus.extension.service.IService; import com.guo.learningprogresstracker.exception.NotFindEntitiesException; +import java.util.List; + /** * @author guo * @description 针对表【study_report_fragments(记录学习过程中的学习内容报告残片)】的数据库操作Service @@ -13,4 +16,8 @@ import com.guo.learningprogresstracker.exception.NotFindEntitiesException; public interface StudyReportFragmentsService extends IService { void createFragments(CreateFragmentsRequest request) throws NotFindEntitiesException; + + void updateFragments(Integer id, UpdateFragmentsRequest request) throws NotFindEntitiesException; + + List getFragmentsBySession(String sessionNum); } diff --git a/src/main/java/com/guo/learningprogresstracker/service/impl/StudyReportFragmentsServiceImpl.java b/src/main/java/com/guo/learningprogresstracker/service/impl/StudyReportFragmentsServiceImpl.java index fc64354..5e54fc0 100644 --- a/src/main/java/com/guo/learningprogresstracker/service/impl/StudyReportFragmentsServiceImpl.java +++ b/src/main/java/com/guo/learningprogresstracker/service/impl/StudyReportFragmentsServiceImpl.java @@ -3,6 +3,7 @@ package com.guo.learningprogresstracker.service.impl; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.guo.learningprogresstracker.dto.request.CreateFragmentsRequest; +import com.guo.learningprogresstracker.dto.request.UpdateFragmentsRequest; import com.guo.learningprogresstracker.entity.StudyReportFragmentsEntity; import com.guo.learningprogresstracker.entity.StudySessionsEntity; import com.guo.learningprogresstracker.exception.NotFindEntitiesException; @@ -13,6 +14,8 @@ import com.guo.learningprogresstracker.mapper.StudyReportFragmentsMapper; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.List; + /** * 针对表【study_report_fragments(记录学习过程中的学习内容报告残片)】的数据库操作Service实现 */ @@ -34,4 +37,23 @@ public class StudyReportFragmentsServiceImpl extends ServiceImpl getFragmentsBySession(String sessionNum) { + return this.list( + Wrappers.lambdaQuery(StudyReportFragmentsEntity.class) + .eq(StudyReportFragmentsEntity::getSessionNum, sessionNum) + .orderByAsc(StudyReportFragmentsEntity::getCreatedTime)); + } }