/*
*接口编写处...
*如果接口需要做Action的权限验证,请在Action上使用属性
*如: [ApiActionPermission("dt_Machineinfo",Enums.ActionPermissionOptions.Search)]
*/
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using WIDESEA_Entity.DomainModels;
using WIDESEA_WCS.IServices;
using Microsoft.AspNetCore.Authorization;
using WIDESEA_Core.Utilities;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json;
namespace WIDESEA_WCS.Controllers
{
public partial class dt_MachineinfoController
{
private readonly Idt_MachineinfoService _service;//访问业务代码
private readonly IHttpContextAccessor _httpContextAccessor;
[ActivatorUtilitiesConstructor]
public dt_MachineinfoController(
Idt_MachineinfoService service,
IHttpContextAccessor httpContextAccessor
)
: base(service)
{
_service = service;
_httpContextAccessor = httpContextAccessor;
}
///
/// 传输文件状态设为允许
///
///
[HttpPost, Route("UpdateEnable"), AllowAnonymous]
public WebResponseContent UpdateEnable([FromBody] object saveModel)
{
return _service.UpdateEnable(JsonConvert.SerializeObject(saveModel));
}
///
/// 传输文件状态设为禁止
///
///
[HttpPost, Route("UpdateDisEnable"), AllowAnonymous]
public WebResponseContent UpdateDisEnable([FromBody] object saveModel)
{
return _service.UpdateDisEnable(JsonConvert.SerializeObject(saveModel));
}
}
}