using Dlhis.ScheduledTask.TaskAssignment.Request; using Dlhis.ScheduledTask.TaskAssignment.Response; using Dlhis.ScheduledTask.TaskAssignment.Services; using Kurisu.AspNetCore.DataAccess.SqlSugar.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; } /// /// 获取设备任务(按设备) /// /// [IgnoreTenant] [HttpGet("deviceTasks")] public async Task> DeviceGetTasksGetAsync([FromQuery] DeviceTaskGetRequest request) { return await _assignmentService.DeviceGetTasksAsync(request); } /// /// 获取设备任务(按设备) /// /// [HttpPost("deviceTasks")] [IgnoreTenant] public async Task> DeviceGetTasksPostAsync(DeviceTaskGetRequest request) { return await _assignmentService.DeviceGetTasksAsync(request); } /// /// 更新任务状态 /// /// /// [HttpPost("taskstatus")] [IgnoreTenant] public async Task UpdateDeviceTaskStatusAsync(List requests) { await _assignmentService.UpdateDeviceTaskStatusAsync(requests); } /// /// 获取新人脸照片 /// /// /// [HttpGet("renewfaceurl")] [IgnoreTenant] public async Task RenewFaceUrlAsync(long taskId) { return await _assignmentService.RenewFaceUrlAsync(taskId); } }