[xingyu.guo] feat: 1. 替换所有响应值中的id为num,不将非业务字段展示给外部 2. 调整[实际使用时间]等字段类型为double,方便计算\保存与读取 3. 【获取所有任务列表】api,完善功能,并增加分页功能 4.将int类型修改为使用Integer,更加安全
This commit is contained in:
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
@@ -64,8 +65,9 @@ public class TaskController {
|
||||
|
||||
@GetMapping("/tasks")
|
||||
@Operation(summary = "获取所有任务列表")
|
||||
public CommonResult tasksList() {
|
||||
return CommonResult.success(tasksService.taskList());
|
||||
public CommonResult tasksList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
return CommonResult.success(tasksService.taskList(pageNum, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +75,7 @@ public class TaskController {
|
||||
*
|
||||
*/
|
||||
@GetMapping("/{taskNum}/studay-sessions/start-or-continue")
|
||||
public CommonResult startOrContinueStudySession(@NotEmpty(message = "taskId不可为空")
|
||||
public CommonResult startOrContinueStudySession(@NotEmpty(message = "taskNum不可为空")
|
||||
@PathVariable String taskNum) throws NotFindEntitiesException {
|
||||
StudySessionResponce responce = studySessionsServiceImpl.startOrContinueStudySession(taskNum);
|
||||
return CommonResult.success(responce);
|
||||
|
||||
Reference in New Issue
Block a user