using Dlhis.ScheduledTask.TaskAssignment.Request; using Dlhis.ScheduledTask.TaskAssignment.Response; using Dlhis.ScheduledTask.TaskAssignment.Services; using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop; using Kurisu.AspNetCore.UnifyResultAndValidation.Aop; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace Dlhis.ScheduledTask.TaskAssignment.Controllers; /// /// 任务分配 /// [Authorize] [Route("api/[controller]")] [ApiController] public class AssignmentsController : ControllerBase { private readonly IAssignmentService _assignmentService; public AssignmentsController(IAssignmentService assignmentService) { _assignmentService = assignmentService; } /// /// 获取设备任务(按设备) /// /// [DisableApiLog] [IgnoreTenant] [HttpGet("deviceTasks")] public async Task> DeviceGetTasksGetAsync([FromQuery] DeviceTaskGetRequest request) { return await _assignmentService.DeviceGetTasksAsync(request); } /// /// 获取设备任务(按设备) /// /// [DisableApiLog] [HttpPost("deviceTasks")] [IgnoreTenant] public async Task> DeviceGetTasksPostAsync(DeviceTaskGetRequest request) { return await _assignmentService.DeviceGetTasksAsync(request); } /// /// 更新任务状态 /// /// /// [DisableApiLog] [HttpPost("taskStatus")] [IgnoreTenant] public async Task UpdateDeviceTaskStatusAsync(List requests) { await _assignmentService.UpdateDeviceTaskStatusAsync(requests); } }