package com.fs.app.controller.live;

import com.fs.app.annotation.Login;
import com.fs.app.controller.AppBaseController;
import com.fs.common.core.domain.R;
import com.fs.live.param.LiveFinishUParam;
import com.fs.live.service.ILiveTrafficLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app/live/liveTrafficLog")
public class LiveTrafficLogController extends AppBaseController {
    @Autowired
    private ILiveTrafficLogService liveTrafficLogService;

    @Login
    @ApiOperation("获取缓冲流量 ps:前端定时调")
    @PostMapping("/getInternetTraffic")
    public R getInternetTraffic(@RequestBody LiveFinishUParam param) {
        Long userId = Long.parseLong(getUserId());
        param.setUserId(userId);
        return liveTrafficLogService.getInternetTraffic(param);
    }

    @Login
    @ApiOperation("获取缓冲流量 ps:前端定时调")
    @PostMapping("/getLiveInternetTraffic")
    public R getLiveInternetTraffic(@RequestBody LiveFinishUParam param) {
        Long userId = Long.parseLong(getUserId());
        param.setUserId(userId);
        return liveTrafficLogService.getLiveInternetTraffic(param);
    }

}
