|
|
|
@ -2,12 +2,17 @@ package com.zh.project0512.controller.wxApp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.zh.project0512.annotation.AdminTokenValid;
|
|
|
|
|
import com.zh.project0512.annotation.TokenValid;
|
|
|
|
|
import com.zh.project0512.controller.manage.TeachingRefeController;
|
|
|
|
|
import com.zh.project0512.model.TeachingRefe;
|
|
|
|
|
import com.zh.project0512.model.UserTask;
|
|
|
|
|
import com.zh.project0512.service.ITaskService;
|
|
|
|
|
import com.zh.project0512.service.ITeachingRefeService;
|
|
|
|
|
import com.zh.project0512.service.IUserService;
|
|
|
|
|
import com.zh.project0512.service.IUserTaskService;
|
|
|
|
|
import com.zh.project0512.utils.JwtUtil;
|
|
|
|
|
import com.zh.project0512.utils.MybatisPlusUtil;
|
|
|
|
|
import com.zh.project0512.utils.result.HttpStatusEnum;
|
|
|
|
|
import com.zh.project0512.utils.result.Result;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
@ -40,7 +45,8 @@ public class UserTaskUController {
|
|
|
|
|
private ITaskService taskService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IUserService userService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ITeachingRefeService teachingRefeService;
|
|
|
|
|
@Data
|
|
|
|
|
static class AddUTParam {
|
|
|
|
|
@Schema(title = "任务id")
|
|
|
|
@ -68,4 +74,22 @@ public class UserTaskUController {
|
|
|
|
|
userTaskService.save(new UserTask().setUserId(userId).setTaskId(taskId));
|
|
|
|
|
return Result.success("添加完成");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
static class listTCRParam {
|
|
|
|
|
private Integer pageNum;
|
|
|
|
|
private Integer pageSize;
|
|
|
|
|
@Schema(title = "教程名称")
|
|
|
|
|
private String title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "列表")
|
|
|
|
|
@PostMapping("/list")
|
|
|
|
|
@AdminTokenValid
|
|
|
|
|
public Result list(@Validated @RequestBody listTCRParam param) {
|
|
|
|
|
QueryWrapper<TeachingRefe> qw = new QueryWrapper<>();
|
|
|
|
|
qw.eq("isDeleted",0).orderByDesc("updateAt", "creatAt").like(param.getTitle() != null, "title", param.getTitle());
|
|
|
|
|
return Result.success(teachingRefeService.pageMaps(MybatisPlusUtil.SetNumPage(param.getPageNum(), param.getPageSize()), qw));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|