package com.yonge.cooleshow.teacher.controller;


import com.alibaba.fastjson.JSONObject;
import com.yonge.cooleshow.biz.dal.entity.RecordNotify;
import com.yonge.cooleshow.biz.dal.service.LiveRoomVideoService;
import com.yonge.cooleshow.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 直播视频记录(LiveRoomVideo)表控制层
 *
 * @author hgw
 * @since 2022-03-18 15:41:17
 */
@Api(tags = "直播视频记录")
@RestController
@RequestMapping("/liveRoomVideo")
public class LiveRoomVideoController extends BaseController {

    private final static Logger log = LoggerFactory.getLogger(LiveRoomVideoController.class);

    /**
     * 服务对象
     */
    @Resource
    private LiveRoomVideoService liveRoomVideoService;

    @ApiOperation("录制结果回调")
    @RequestMapping(value = "/recordSync")
    public void recordSync(@RequestBody String body) {
        log.info("recordSync body：{}", body);
        RecordNotify recordNotify = JSONObject.parseObject(body, RecordNotify.class);
        liveRoomVideoService.recordSync(recordNotify);
    }

}

