package com.unis.equipmentOnlineRateAssessment.modular.hk.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.unis.common.pojo.CommonResult;
import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.req.PlaybackReqDTO;
import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.req.PreviewReqDTO;
import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.res.PlaybackResDTO;
import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.res.PreviewResDTO;
import com.unis.equipmentOnlineRateAssessment.modular.hk.service.HkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 视频预览回放
 */
@Api(tags = "视频预览回放")
@ApiSupport(author = "UNIS_TEAM", order = 1)
@RestController
@Validated
public class PreviewPlaybackController {

    @Resource
    private HkService hkService;

    
    /**
     * 摄像头预览
     * @param previewReqDTO
     * @return
     */
    @ApiOperationSupport(order = 1)
    @ApiOperation("*视频预览")
    @GetMapping("/previewPlayback/getPreview")
    public CommonResult<PreviewResDTO> getPreview(PreviewReqDTO previewReqDTO) {
        return CommonResult.data(hkService.previewURLs(previewReqDTO));
    }
    
    
    /**
     * 摄像头回放
     * @param playbackReqDTO
     * @return
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation("*视频回放")
    @GetMapping("/previewPlayback/getPlayback")
    public CommonResult<PlaybackResDTO> getPlayback(PlaybackReqDTO playbackReqDTO) {
        return CommonResult.data(hkService.playbackURLs(playbackReqDTO));
    }

}
