package com.yutou.bilibili.Controllers;

import com.alibaba.fastjson2.JSONObject;
import com.yutou.bilibili.datas.ResultData;
import com.yutou.bilibili.services.LiveDanmuService;
import com.yutou.bilibili.services.LiveService;
import com.yutou.bilibili.services.LiveVideoDownloadService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LiveController {
    @Resource
    LiveVideoDownloadService videoService;
    @Resource
    LiveDanmuService danmuService;
    @Resource
    LiveService liveService;


    @RequestMapping("/live/list")
    @ResponseBody
    public JSONObject getLiveList(int page,int limit) {
        return ResultData.success(liveService.getLiveList(page,limit), liveService.getConfigCount());
    }

    @RequestMapping("/live/gift/info")
    @ResponseBody
    public JSONObject download(String roomId, String videoId) {
        return ResultData.success(liveService.getGiftInfo(roomId,videoId));
    }
}
