live-forum/server/webapi/LiveForum/LiveForum.WebApi/Controllers/StreamersController.cs
2026-03-24 11:27:37 +08:00

44 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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">日志IDURL参数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);
}
}