using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Text;
using System.Text.RegularExpressions;
using WIDESEA_DTO.Agv;
using WIDESEA_External.Model;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.Agv;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_Tasks;
using WIDESEAWCS_Tasks.DBNames;
using static Dm.net.buffer.ByteArrayBuffer;
namespace WIDESEAWCS_Server.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class WebAPIController : ControllerBase
{
private readonly IStationMangerRepository _stationMangerRepository;
private readonly ITaskService _taskService;
private readonly ITaskRepository _taskRepository;
private readonly IRouterRepository _routerRepository;
public WebAPIController(IStationMangerRepository stationMangerRepository, ITaskService taskService, ITaskRepository taskRepository, IRouterRepository routerRepository)
{
_stationMangerRepository = stationMangerRepository;
_taskService = taskService;
_taskRepository = taskRepository;
_routerRepository = routerRepository;
}
///
/// 回调上传
///
///
[HttpPost, HttpGet, Route("PickOrderCallBack"), AllowAnonymous]
public EPLightContent? PickOrderCallBack([FromBody] List lightBackDTOs)
{
EPLightContent content = new EPLightContent();
try
{
if (lightBackDTOs==null)
{
return content.Error("传入不能为空");
}
content.OK("接收成功");
}
catch (Exception ex)
{
content.Error(ex.Message);
}
return content;
}
///
/// 播种墙下发(二期)
///
///
[HttpPost, HttpGet, Route("PickOrderInfoRequest"), AllowAnonymous]
public EPLightContent PickOrderInfoRequest([FromBody] List lightSendDTOs)
{
EPLightContent content = new EPLightContent();
try
{
if (lightSendDTOs == null)
{
return content.Error("传入不能为空");
}
content = _taskService.PickOrderInfoRequest(lightSendDTOs);
}
catch (Exception ex)
{
content.Error(ex.Message);
}
return content;
}
///
/// 播种墙初始化(二期)
///
///
[HttpPost, HttpGet, Route("INITIALIZATION"), AllowAnonymous]
public EPLightContent INITIALIZATION()
{
EPLightContent content = new EPLightContent();
try
{
content = _taskService.INITIALIZATION();
}
catch (Exception ex)
{
content.Error(ex.Message);
}
return content;
}
///
/// 播种墙结束作业(二期)
///
///
[HttpPost, HttpGet, Route("ENDWORK"), AllowAnonymous]
public EPLightContent ENDWORK()
{
EPLightContent content = new EPLightContent();
try
{
content = _taskService.ENDWORK();
}
catch (Exception ex)
{
content.Error(ex.Message);
}
return content;
}
}
}