|
using Api.MessageReceive.Service;
|
using CommonUtil;
|
using CommonUtil.RabbitMQ;
|
using DbAccess;
|
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Mvc;
|
using Operater.DTO.TopMessage;
|
using System;
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Linq;
|
using System.Threading.Tasks;
|
|
namespace Api.MessageReceive.Controllers
|
{
|
[Route(TopConstants.API_ROUTE)]
|
public class YzMessageController : ControllerBase
|
{
|
private readonly IHttpContextAccessor _accessor;
|
public YzMessageController(IHttpContextAccessor httpContextAccessor)
|
{
|
_accessor = httpContextAccessor;
|
}
|
/// <summary>
|
/// 接收有赞消息
|
/// </summary>
|
/// <param name="request"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public async Task<IActionResult> YzMessageGet([FromBody] YouZanMsgModel request)
|
{
|
bool res = await YzMessageService.ServiceExecute(_accessor, request);
|
if (res)
|
{
|
return Ok(new
|
{
|
code = 0,
|
msg = "success"
|
});
|
}
|
else
|
{
|
return Ok(new
|
{
|
code = -1,
|
msg = "fail"
|
});
|
}
|
}
|
}
|
}
|