DD.WellWorkover.Cloud/AsbCloudApp/Requests/MessageRequest.cs

120 lines
3.0 KiB
C#
Raw Normal View History

using AsbCloudApp.Data;
using AsbCloudApp.Data.SAUB;
using System;
using System.Collections.Generic;
using System.Linq;
2024-08-19 10:01:07 +05:00
namespace AsbCloudApp.Requests;
/// <summary>
/// параметры для запроса списка сообщений
/// </summary>
public class MessageRequestBase : RequestBase
{
/// <summary>
2024-08-19 10:01:07 +05:00
/// категория
/// </summary>
public IEnumerable<int>? IdsCategories { get; set; }
2024-08-19 10:01:07 +05:00
/// <summary>
/// начальная дата
/// </summary>
public DateTimeOffset? Begin { get; set; }
2024-08-19 10:01:07 +05:00
/// <summary>
/// конечная дата
/// </summary>
public DateTimeOffset? End { get; set; }
2024-08-19 10:01:07 +05:00
/// <summary>
/// строка поиска
/// </summary>
public string? SearchString { get; set; }
/// <summary>
///
/// </summary>
public MessageRequestBase()
{
}
/// <summary>
/// копирующий конструктор
/// </summary>
/// <param name="request"></param>
public MessageRequestBase(MessageRequestBase request)
{
this.IdsCategories = request.IdsCategories;
this.Begin = request.Begin;
this.End = request.End;
this.SearchString = request.SearchString;
this.Skip = request.Skip;
this.Take = request.Take;
this.SortFields = request.SortFields;
}
2024-08-19 10:01:07 +05:00
}
/// <summary>
/// параметры для запроса списка сообщений (с ids скважин)
2024-08-19 10:01:07 +05:00
/// </summary>
public class MessageRequest : MessageRequestBase
{
/// <summary>
/// ids скважин
2024-08-19 10:01:07 +05:00
/// </summary>
public IEnumerable<int> IdsWell { get; set; } = null!;
/// <summary>
/// <inheritdoc/>
/// </summary>
public MessageRequest()
{
}
/// <summary>
/// параметры для запроса списка сообщений (с ids скважин)
/// </summary>
2024-08-19 10:01:07 +05:00
/// <param name="request"></param>
/// <param name="idsWell"></param>
public MessageRequest(MessageRequestBase request, IEnumerable<int> idsWell) : base(request)
{
this.IdsWell = idsWell;
}
}
/// <summary>
/// параметры запроса для получения списка сообщений телеметрии
/// </summary>
public class MessageTelemetryRequest : MessageRequestBase
{
/// <summary>
/// события
/// </summary>
public IEnumerable<TelemetryEventDto> Events { get; set; }= Enumerable.Empty<TelemetryEventDto>();
/// <summary>
/// телеметрии
/// </summary>
public IEnumerable<TelemetryDto> Telemetries { get; set; } = Enumerable.Empty<TelemetryDto>();
2024-08-19 10:01:07 +05:00
/// <inheritdoc/>
public MessageTelemetryRequest(
MessageRequestBase request,
IEnumerable<TelemetryEventDto> events,
IEnumerable<TelemetryDto> telemetries) : base(request)
{
Events = events;
Telemetries = telemetries;
}
/// <inheritdoc/>
public MessageTelemetryRequest(MessageRequestBase request)
: base(request) { }
}