refactor: 回忆改用独立存储与请求响应 DTO,服务按域拆包

This commit is contained in:
2026-11-20 09:38:16 +08:00
parent 5ff692b768
commit 4b65eb57b1
280 changed files with 8774 additions and 4364 deletions
@@ -23,10 +23,10 @@ public class StudyExpectationsServiceImpl implements StudyExpectationsService {
private final StudySessionsMapper studySessionsMapper;
@Override
public StudyExpectationsEntity upsertExpectation(String sessionNum, String description) throws ErrorParameterException {
public StudyExpectationsEntity upsertExpectation(String sessionNum, String description)
throws ErrorParameterException {
boolean sessionExists = studySessionsMapper.exists(
Wrappers.<StudySessionsEntity>lambdaQuery()
.eq(StudySessionsEntity::getSessionNum, sessionNum));
Wrappers.<StudySessionsEntity>lambdaQuery().eq(StudySessionsEntity::getSessionNum, sessionNum));
if (!sessionExists) {
log.warn("学习会话[{}]不存在", sessionNum);
throw new ErrorParameterException("这次学习会话不存在或已结束");
@@ -47,16 +47,14 @@ public class StudyExpectationsServiceImpl implements StudyExpectationsService {
@Override
public StudyExpectationsEntity getBySessionNum(String sessionNum) {
return studyExpectationsMapper.selectOne(
Wrappers.<StudyExpectationsEntity>lambdaQuery()
.eq(StudyExpectationsEntity::getSessionNum, sessionNum)
.last("LIMIT 1"));
return studyExpectationsMapper.selectOne(Wrappers.<StudyExpectationsEntity>lambdaQuery()
.eq(StudyExpectationsEntity::getSessionNum, sessionNum)
.last("LIMIT 1"));
}
@Override
public void deleteBySessionNum(String sessionNum) {
studyExpectationsMapper.delete(
Wrappers.<StudyExpectationsEntity>lambdaQuery()
.eq(StudyExpectationsEntity::getSessionNum, sessionNum));
Wrappers.<StudyExpectationsEntity>lambdaQuery().eq(StudyExpectationsEntity::getSessionNum, sessionNum));
}
}