package com.usky.sas.controller.web;

import com.usky.common.core.bean.ApiResult;
import com.usky.sas.service.SasVideoStreamService;
import com.usky.sas.service.vo.LiveStreamResponse;
import com.usky.sas.service.vo.PlaybackStreamResponse;
import com.usky.sas.service.vo.VideoStreamRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 视频流接口
 *
 * 对应 API 文档：
 * /prod-api/service-sas/video/...
 */
@RestController
@RequestMapping("/video")
public class SasVideoStreamController {

    @Autowired
    private SasVideoStreamService sasVideoStreamService;

    /**
     * 实时直播流
     */
    @GetMapping("/liveStream")
    public ApiResult<LiveStreamResponse> liveStream(VideoStreamRequest request) {
        return ApiResult.success(sasVideoStreamService.liveStream(request));
    }

    /**
     * 回放流
     */
    @GetMapping("/playbackStream")
    public ApiResult<PlaybackStreamResponse> playbackStream(VideoStreamRequest request) {
        return ApiResult.success(sasVideoStreamService.playbackStream(request));
    }
}

