xiangpei
2024-03-28 0f431b52e0936456bd165d9553761bfd8a5a0517
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
package com.mindskip.xzs.controller.teacher;
 
import com.mindskip.xzs.base.RestResponse;
import com.mindskip.xzs.domain.vo.VideoStudentDto;
import com.mindskip.xzs.domain.vo.VideoStudentListVO;
import com.mindskip.xzs.domain.vo.VideoStudentVO;
import com.mindskip.xzs.service.IMyVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@RestController
@RequestMapping(value = "/api/teacher/video")
public class MyVideoController {
 
    @Autowired
    private IMyVideoService videoService;
 
    @PostMapping("/clear")
    public RestResponse clear(){
        videoService.clear();
        return RestResponse.ok();
    }
 
    @PostMapping("/add")
    public RestResponse add(@RequestBody VideoStudentDto videoStudentDto){
        videoService.save(videoStudentDto);
        return RestResponse.ok();
    }
 
    @GetMapping("/showButton/{id}")
    public RestResponse showButton(@PathVariable Integer id){
        VideoStudentVO videoStudentVO = videoService.showButton(id);
        return RestResponse.ok(videoStudentVO);
    }
 
    @GetMapping("/getList")
    public RestResponse getList(){
        List<VideoStudentListVO> res = videoService.getStudentVideoList();
        return RestResponse.ok(res);
    }
}