baizonghao
2023-06-16 e3fc8c41f194818e9881f25944180a492500ee3a
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
package com.mindskip.xzs.controller.admin;
 
import com.mindskip.xzs.base.RestResponse;
import com.mindskip.xzs.domain.vo.VideoStudentDto;
import com.mindskip.xzs.domain.vo.VideoStudentVO;
import com.mindskip.xzs.service.IVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.xml.ws.Response;
 
@RestController("VideoController")
@RequestMapping(value = "/api/admin/video")
public class VideoController {
 
    @Autowired
    private IVideoService videoService;
 
    @GetMapping("/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);
    }
}