forked from ddrilling/AsbCloudServer
120 lines
3.0 KiB
C#
120 lines
3.0 KiB
C#
using AsbCloudApp.Data;
|
||
using AsbCloudApp.Data.SAUB;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
|
||
namespace AsbCloudApp.Requests;
|
||
|
||
/// <summary>
|
||
/// параметры для запроса списка сообщений
|
||
/// </summary>
|
||
public class MessageRequestBase : RequestBase
|
||
{
|
||
/// <summary>
|
||
/// категория
|
||
/// </summary>
|
||
public IEnumerable<int>? IdsCategories { get; set; }
|
||
|
||
|
||
/// <summary>
|
||
/// начальная дата
|
||
/// </summary>
|
||
public DateTimeOffset? Begin { get; set; }
|
||
|
||
/// <summary>
|
||
/// конечная дата
|
||
/// </summary>
|
||
public DateTimeOffset? End { get; set; }
|
||
|
||
/// <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;
|
||
}
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// параметры для запроса списка сообщений (с ids скважин)
|
||
/// </summary>
|
||
public class MessageRequest : MessageRequestBase
|
||
{
|
||
/// <summary>
|
||
/// ids скважин
|
||
/// </summary>
|
||
public IEnumerable<int> IdsWell { get; set; } = null!;
|
||
|
||
/// <summary>
|
||
/// <inheritdoc/>
|
||
/// </summary>
|
||
public MessageRequest()
|
||
{
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// параметры для запроса списка сообщений (с ids скважин)
|
||
/// </summary>
|
||
/// <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>();
|
||
|
||
/// <inheritdoc/>
|
||
public MessageTelemetryRequest(
|
||
MessageRequestBase request,
|
||
IEnumerable<TelemetryEventDto> events,
|
||
IEnumerable<TelemetryDto> telemetries) : base(request)
|
||
{
|
||
Events = events;
|
||
Telemetries = telemetries;
|
||
}
|
||
|
||
/// <inheritdoc/>
|
||
public MessageTelemetryRequest(MessageRequestBase request)
|
||
: base(request) { }
|
||
}
|
||
|