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.AppControllers
{
[Route("api/app/analyze")]
[ApiController]
[Authorize]
public class AnalyzeController : ControllerBase
{
private readonly IAnalyzeService _analyzeService;
private readonly ILoginContext _loginContext;
public AnalyzeController(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);
}
}
}