49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
/*
|
|
*接口编写处...
|
|
*如果接口需要做Action的权限验证,请在Action上使用属性
|
|
*如: [ApiActionPermission("warehouse_keys",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_keysController
|
|
{
|
|
private readonly Iwarehouse_keysService _service;//访问业务代码
|
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
|
|
|
[ActivatorUtilitiesConstructor]
|
|
public warehouse_keysController(
|
|
Iwarehouse_keysService service,
|
|
IHttpContextAccessor httpContextAccessor
|
|
)
|
|
: base(service)
|
|
{
|
|
_service = service;
|
|
_httpContextAccessor = httpContextAccessor;
|
|
}
|
|
|
|
[Route("GetKeyStatus"), HttpGet]
|
|
[AllowAnonymous]
|
|
public async Task<IActionResult> GetKeyStatus(int keyid)
|
|
{
|
|
return Json(_service.GetKeyStatus(keyid));
|
|
}
|
|
|
|
[Route("GetAllStatus"), HttpGet]
|
|
[AllowAnonymous]
|
|
public string GetAllStatus()
|
|
{
|
|
return _service.GetAllStatus();
|
|
}
|
|
}
|
|
}
|