46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using Dlhis.ScheduledTask.TaskAssignment.Request;
|
|
using Dlhis.ScheduledTask.TaskAssignment.Response;
|
|
using Dlhis.ScheduledTask.TaskAssignment.Services;
|
|
using Kurisu.Core.DataAccess.Dto;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Dlhis.ScheduledTask.TaskAssignment.Controllers;
|
|
|
|
/// <summary>
|
|
/// 设备任务下发
|
|
/// </summary>
|
|
[Authorize]
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class DeviceTaskAssignmentsController : ControllerBase
|
|
{
|
|
private readonly IDeviceTaskAssignmentService _deviceTaskAssignmentService;
|
|
|
|
public DeviceTaskAssignmentsController(IDeviceTaskAssignmentService deviceTaskAssignmentService)
|
|
{
|
|
_deviceTaskAssignmentService = deviceTaskAssignmentService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设备任务下发分页
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("page")]
|
|
public async Task<Pagination<DeviceTaskAssignmentResponse>> GetPageAsync([FromQuery] DeviceTaskAssignmentRequest request)
|
|
{
|
|
return await _deviceTaskAssignmentService.GetPageAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取设备任务(按设备)
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet("device-tasks")]
|
|
public async Task<List<DeviceTaskToDeviceByDeviceResponse>> DeviceGetTasksAsync([FromQuery] DeviceTaskGetRequest request)
|
|
{
|
|
return await _deviceTaskAssignmentService.DeviceGetTasksAsync(request);
|
|
}
|
|
}
|