[xingyu.guo] feat: 【结束一个【学习会话】】API
This commit is contained in:
@@ -117,4 +117,18 @@ public class StudySessionsEntity extends BaseEntity implements Serializable {
|
||||
this.setSessionState(StudySessionStateEnum.PAUSED.name());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束会话
|
||||
*/
|
||||
public void endedStudySession() {
|
||||
if (this.getSessionState().equals(StudySessionStateEnum.ENDED.name())){
|
||||
log.warn("不应出现的情况:结束了一个状态为【{}】的学习会话",this.getSessionState());
|
||||
}else {
|
||||
if (this.getSessionState().equals(StudySessionStateEnum.ONGOING.name())) {
|
||||
this.pausedStudySession();
|
||||
}
|
||||
this.setSessionState(StudySessionStateEnum.ENDED.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user