using System.Threading.Tasks; using GxPress.Auth; using GxPress.Common.Page; using GxPress.Request.Analyze; using GxPress.Request.App.Analyze; using GxPress.Result.App.Analyze; using GxPress.Service.Interface.Analyze; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace GxPress.Api.WebControllers { /// /// 点赞 转发 收藏 /// [Route("api/web/analyze")] [ApiController] [Authorize] public class WebAnalyzeController : Controller { private readonly IAnalyzeService _analyzeService; private readonly ILoginContext _loginContext; public WebAnalyzeController(IAnalyzeService analyzeService, ILoginContext loginContext) { _analyzeService = analyzeService; _loginContext = loginContext; } /// /// 设置 点赞 转发 收藏 /// /// /// [HttpPost("set")] public async Task SetAnalyzeAsync(AnalyzeRequest request) { request.UserId = _loginContext.AccountId; return await _analyzeService.SetAnalyzeAsync(request); } /// /// 获取点赞数据 /// /// /// [HttpPost("list")] public async Task> GetPraisePageAsync(PraisePageSearchRequest request) { return await _analyzeService.GetPraisePageAsync(request); } } }