using Microsoft.AspNetCore.Mvc;
using WcsMain.ApiServe.ControllerFilter;
using WcsMain.ApiServe.ControllerFilter.ExceptionFilter;
using WcsMain.ApiServe.Controllers.Dto;
using WcsMain.ApiServe.Controllers.Dto.WcsDto.WcsTask;
using WcsMain.ApiServe.Service.WcsService;
using WcsMain.DataBase.TableEntity;
namespace WcsMain.ApiServe.Controllers.WcsController;
[Route("api/wcs/wcsTask")]
[ApiController]
[WcsExceptionFilter]
[WcsAuthorization]
public class WcsTaskController(WcsTaskService wcsTaskService) : ControllerBase
{
///
/// 查询所有的正在运行的WCS任务
///
///
[HttpGet("getWcsTask")]
public WcsApiResponse> GetWcsTask()
{
return wcsTaskService.GetWcsTask();
}
///
/// 根据任务号获取任务信息,包括运行表和备份表
///
///
///
[HttpGet("getWcsTaskWithTaskId")]
public WcsApiResponse> GetWcsTaskWithTaskId([FromQuery(Name = "taskId")] string taskId) => wcsTaskService.GetWcsTaskWithTaskId(taskId);
///
/// 分页查询正在运行的任务
///
///
///
[HttpPost("getWcsTaskWithPage")]
public WcsApiResponse> GetWcsTaskWithPage([FromBody] GetWcsTaskWithPageRequest request) => wcsTaskService.GetWcsTaskWithPage(request);
///
/// 更新任务信息
///
///
///
[HttpPost("updateStatus")]
public WcsApiResponse UpdateWcsTaskStatus([FromBody] UpdateWcsTaskStatusRequest request) => wcsTaskService.UpdateWcsTaskStatus(request);
}