61 lines
1.8 KiB
C#
61 lines
1.8 KiB
C#
using Dlhis.ScheduledTask.DeviceUploadLog.Request;
|
|
using Dlhis.ScheduledTask.DeviceUploadLog.Response;
|
|
using Dlhis.ScheduledTask.DeviceUploadLog.Services;
|
|
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
|
using Kurisu.Core.DataAccess.Dto;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Dlhis.ScheduledTask.DeviceUploadLog.Controllers;
|
|
|
|
/// <summary>
|
|
/// 设备上传记录
|
|
/// </summary>
|
|
[Authorize]
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class DeviceUploadLogsController : ControllerBase
|
|
{
|
|
private readonly IDeviceUploadLogService _deviceUploadLogService;
|
|
|
|
public DeviceUploadLogsController(IDeviceUploadLogService deviceUploadLogService)
|
|
{
|
|
_deviceUploadLogService = deviceUploadLogService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取上传记录分页
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("page")]
|
|
public async Task<Pagination<DeviceUploadLogResponse>> GetPageAsync([FromQuery] DeviceUploadLogPageRequest request)
|
|
{
|
|
return await _deviceUploadLogService.GetPageAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 批量上传记录
|
|
/// </summary>
|
|
/// <param name="requests"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("records")]
|
|
[IgnoreTenant]
|
|
public async Task UploadLogsAsync(List<DeviceUploadLogUploadRequest> requests)
|
|
{
|
|
await _deviceUploadLogService.UploadLogsAsync(requests);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设置设备获取记录开始时间
|
|
/// </summary>
|
|
/// <param name="requests"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("reset-begintime")]
|
|
[Transactional]
|
|
public async Task SetUploadLogsBeginDateTime(List<SetUploadLogsBeginDateTimeRequest> requests)
|
|
{
|
|
await _deviceUploadLogService.SetUploadLogsBeginDateTimeAsync(requests);
|
|
}
|
|
}
|