package com.ruixuan.data.controller;

import com.ruixuan.common.core.controller.BaseController;
import com.ruixuan.common.core.domain.ResultResponse;
import com.ruixuan.data.service.VideoTextService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/live/videoText")
public class VideoTextController extends BaseController {

    @Autowired
    private VideoTextService videoTextService;


    @GetMapping(value = "getVideoText")
    @ApiOperation(value = "视频转文本")
    public String getVideoText(@ApiParam("视频URL") @RequestParam(value = "url", required = true) String url) {
        try {
            return videoTextService.getVideoText(url);
        } catch (Exception e) {
            e.printStackTrace();
            return "异常";
        }
    }
}
