44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
using LiveForum.Code.Base;
|
||
using LiveForum.IService.Streamers;
|
||
using LiveForum.Model.Dto.Streamers;
|
||
|
||
using Microsoft.AspNetCore.Http;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
|
||
namespace LiveForum.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 主播相关接口
|
||
/// </summary>
|
||
[Route("api/[controller]/[action]")]
|
||
[ApiController]
|
||
public class StreamersController : ControllerBase
|
||
{
|
||
private readonly IStreamersService _streamersService;
|
||
|
||
/// <summary>
|
||
/// 构造函数
|
||
/// </summary>
|
||
/// <param name="streamersService">主播服务</param>
|
||
public StreamersController(IStreamersService streamersService)
|
||
{
|
||
_streamersService = streamersService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 上报主播数据(粉丝、收入、直播状态等)
|
||
/// </summary>
|
||
/// <param name="request">上报请求参数</param>
|
||
/// <param name="category">主播分类(URL参数,如:entertainment)</param>
|
||
/// <param name="logId">日志ID(URL参数,如:anchor_income_rank_with_fans_20251130_165823)</param>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
public Task<BaseResponse<StreamerReportRespDto>> ReportStreamerData(
|
||
[FromBody] StreamerReportReq request,
|
||
[FromQuery] string category= "entertainment",
|
||
[FromQuery] string logId="")
|
||
=> _streamersService.ReportStreamerData(request, category, logId);
|
||
}
|
||
}
|
||
|