47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
/*
|
|
*接口编写处...
|
|
*如果接口需要做Action的权限验证,请在Action上使用属性
|
|
*如: [ApiActionPermission("warehouse_realtimealert",Enums.ActionPermissionOptions.Search)]
|
|
*/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using VolPro.Entity.DomainModels;
|
|
using Warehouse.IServices;
|
|
|
|
namespace Warehouse.Controllers
|
|
{
|
|
public partial class warehouse_realtimealertController
|
|
{
|
|
private readonly Iwarehouse_realtimealertService _service;//访问业务代码
|
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
|
|
|
[ActivatorUtilitiesConstructor]
|
|
public warehouse_realtimealertController(
|
|
Iwarehouse_realtimealertService service,
|
|
IHttpContextAccessor httpContextAccessor
|
|
)
|
|
: base(service)
|
|
{
|
|
_service = service;
|
|
_httpContextAccessor = httpContextAccessor;
|
|
}
|
|
[Route("AlertNotify"), HttpPost]
|
|
[AllowAnonymous]
|
|
public async Task<IActionResult> AlertNotify(AlertModel alert)
|
|
{
|
|
return Json(_service.AlertNotifyAsync(alert));
|
|
}
|
|
[Route("GetAlertMessage"), HttpPost]
|
|
[AllowAnonymous]
|
|
public async Task<IActionResult> GetAlertMessage()
|
|
{
|
|
return Json(_service.GetAlertMessage());
|
|
}
|
|
}
|
|
}
|