xiangpei
2024-07-09 53dea0ef5fc8b035397b73b10f7a819ebf381b1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.mindskip.xzs.controller.admin;
 
import com.mindskip.xzs.base.RestResponse;
import com.mindskip.xzs.domain.vo.StudyTypeVO;
import com.mindskip.xzs.service.StudyTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author:xp
 * @date:2024/5/13 10:25
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/api/admin/study/type")
public class StudyTypeController {
 
    private final StudyTypeService studyTypeService;
 
    @GetMapping("/page")
    public RestResponse page(StudyTypeVO query) {
        return studyTypeService.page(query);
    }
 
    @PostMapping
    public RestResponse add(@Validated @RequestBody StudyTypeVO query) {
        return studyTypeService.add(query);
    }
 
    @PostMapping("/edit")
    public RestResponse update(@Validated @RequestBody StudyTypeVO query) {
        return studyTypeService.update(query);
    }
 
    @PostMapping("/remove/{id}")
    public RestResponse remove(@PathVariable("id") Integer id) {
        return studyTypeService.remove(id);
    }
 
    @PostMapping("/list")
    public RestResponse list() {
        return studyTypeService.list();
    }
 
}