master
parent
80465030d9
commit
8b74664d42
@ -0,0 +1,42 @@
|
||||
package com.zh.project0512.controller.wxApp;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zh.project0512.annotation.AdminTokenValid;
|
||||
import com.zh.project0512.model.TeachingRefe;
|
||||
import com.zh.project0512.service.ITeachingRefeService;
|
||||
import com.zh.project0512.utils.MybatisPlusUtil;
|
||||
import com.zh.project0512.utils.result.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wxApp/teachingRefe")
|
||||
@Tag(name = "通用教程")
|
||||
public class TeachingRefeUController {
|
||||
@Autowired
|
||||
private ITeachingRefeService teachingRefeService;
|
||||
@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));
|
||||
}
|
||||
}
|
Loading…
Reference in new issue