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)); + } }