heyuntao
2023-05-05 cc09b6fe6ffac34a4eeeb26d313b187713cae0de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 
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"
                });
            }
        }
    }
}