[xingyu.guo] feat: 1. 抽取通用url 2. 完成【通过学习任务num获取该任务的未结束会话】API 3. 优化【通过sessionNum获取一个【学习会话】】API名称
This commit is contained in:
+9
@@ -61,6 +61,15 @@ public class StudySessionsServiceImpl extends ServiceImpl<StudySessionsMapper, S
|
||||
studySessionsEntity.pausedStudySession();
|
||||
this.updateById(studySessionsEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StudySessionResponce getNotEndedStudySessionByTaskNum(String taskNum) throws ErrorParameterException {
|
||||
StudySessionsEntity studySessionsEntity = this.getOneOpt(Wrappers.lambdaQuery(StudySessionsEntity.class)
|
||||
.eq(StudySessionsEntity::getTaskNum, taskNum)
|
||||
.ne(StudySessionsEntity::getSessionState, StudySessionStateEnum.ENDED.name()))
|
||||
.orElseThrow(() -> new ErrorParameterException("任务[" + taskNum + "]不存在进行中或暂停中的会话"));
|
||||
return StudySessionConvert.MAPPER.toStudySessionResponce(studySessionsEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user