1. 配置数据库日志输出 2. 任务更新API与测试类 3. 任务删除API与测试类

This commit is contained in:
guo
2024-07-16 21:34:00 +08:00
parent ab252d547f
commit 9e7128a7be
5 changed files with 40 additions and 11 deletions
@@ -13,8 +13,11 @@ import com.guo.learningprogresstracker.mapper.TasksMapper;
import com.guo.learningprogresstracker.utils.CalculatedPriorityTool;
import com.guo.learningprogresstracker.utils.GenerateNumTool;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.rmi.ServerException;
/**
* @author guo
* @description 针对表【tasks(存储学习任务的基本信息,包括优先级的多维度计算)】的数据库操作Service实现
@@ -22,6 +25,7 @@ import org.springframework.stereotype.Service;
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class TasksServiceImpl extends ServiceImpl<TasksMapper, TaskEntity>
implements TasksService{
@@ -58,6 +62,14 @@ public class TasksServiceImpl extends ServiceImpl<TasksMapper, TaskEntity>
this.updateById(taskEntity);
}
@Override
public void deleteTask(String taskId) throws ServerException {
boolean b = this.removeById(taskId);
if(!b){
throw new ServerException("未能正常删除任务");
}
}
}