13-实现视频投稿、分页带条件查询视频列表、在线观看视频(分片下载)

1、视频投稿接口

1.1、VideoController

@RestController
@Api(tags = "视频类")
@RequestMapping("/api/video")
public class VideoController {

    @Autowired
    private VideoService videoService;

    @Autowired
    private UserSupport userSupport;

    /**
     * 视频投稿
     */
    @ApiOperation("添加视频")
    @PostMapping("/add-Videoes")
    public Result addVideo(@RequestBody Video video){
        Long userId = userSupport.getCurrentUserId();
        video.setUserId(userId);
        videoService.addVideo(video);
        return Result.ok();
    }
}

1.2、VideoService

public interface VideoService extends IService

1.3、VideoServiceImpl

@Service
public class VideoServiceImpl extends ServiceImpl

你可能感兴趣的:(06-模仿B战开发,音视频,java,servlet)