using EasyNetQ; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using System.Collections.Generic; using System.Threading.Tasks; using XYY.Authentication.Standard; using XYY.Common.Standard; using XYY.Core.Standard.Mvc; using XYY.Model.Standard.First.dto; using XYY.Model.Standard.First; using XYY.Service.Standard.First.ESB; namespace XYY.Api.First.Controllers { [Route("api/[controller]/[action]")] [ApiController] public class ESBController : ControllerBase { IESBService eSBSendService; public ESBController(IESBService eSBSendService) { this.eSBSendService = eSBSendService; } public class Req { public List dtos { get; set; } } [HttpPost] public async Task Update(Req req) { var u = User.GetUserContent(); await eSBSendService.Update(req.dtos, u.CustomerId); return ApiJsonModel.OK(); } [AllowAnonymous] [HttpPost] public async Task>> QueryPager(QueryModel queueMode) { var pagers = await eSBSendService.GetPageResult(queueMode); return ApiJsonModel>.OK(pagers); } [AllowAnonymous] [HttpPost] public async Task Retry(ESBKeyList list) { await eSBSendService.Retry(list.Keys); return ApiJsonModel.OK(); } [AllowAnonymous] [HttpPost] public async Task> GetTrackPageResult(TrackMonitorQueryParam qm) { var pagers = await eSBSendService.GetTrackPageResult(qm); return pagers; } /// /// 每天10点调用,推送esb轨迹监控文件 /// /// [AllowAnonymous] [HttpGet] public async Task ESBTrackMonitor() { await eSBSendService.PushESBTrackMonitor(); } } }