package com.ycwl.basic.controller.pc;

import com.ycwl.basic.annotation.IgnoreToken;
import com.ycwl.basic.model.jwt.JwtInfo;
import com.ycwl.basic.model.pc.source.entity.SourceEntity;
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
import com.ycwl.basic.service.pc.SourceService;
import com.ycwl.basic.utils.ApiResponse;
import com.ycwl.basic.utils.JwtTokenUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：longbinbin
 * @Date：2024/12/3 15:45
 */
@RestController
@RequestMapping("/api/source/v1")
@Api(tags = "视频源管理")
public class SourceController {

    @Autowired
    private SourceService sourceService;

    @Deprecated
    @ApiOperation("分页查询视频源")
    @PostMapping("/page")
    public ApiResponse pageQuery(@RequestBody SourceReqQuery sourceReqQuery) {
        return sourceService.pageQuery(sourceReqQuery);
    }
    @Deprecated
    @ApiOperation("查询视频源列表")
    @PostMapping("/list")
    public ApiResponse list(@RequestBody SourceReqQuery sourceReqQuery) {
        return sourceService.list(sourceReqQuery);
    }
    @PostMapping("/{id}/cutVideo")
    @IgnoreToken
    public ApiResponse cutVideo(@PathVariable("id") Long id) {
        return sourceService.cutVideo(id);
    }
    @Deprecated
    @ApiOperation("删除视频源")
    @DeleteMapping("/delete/{id}")
    public ApiResponse deleteById(@PathVariable Long id) {
        return sourceService.deleteById(id);
    }


}
