forked from ddrilling/AsbCloudServer
107 lines
3.6 KiB
C#
107 lines
3.6 KiB
C#
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using System;
|
|||
|
using System.ComponentModel.DataAnnotations;
|
|||
|
using System.ComponentModel.DataAnnotations.Schema;
|
|||
|
using System.Text.Json.Serialization;
|
|||
|
|
|||
|
namespace AsbCloudDb.Model
|
|||
|
{
|
|||
|
#nullable enable
|
|||
|
[Table("t_faq"), Comment("вопросы пользователей")]
|
|||
|
public class Faq : IId
|
|||
|
{
|
|||
|
public const int StateOpened = 0;
|
|||
|
public const int StateDeleted = 1;
|
|||
|
|
|||
|
[Key]
|
|||
|
[Column("id"), Comment("Идентификатор")]
|
|||
|
public int Id { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// ключ скважины, к которой пивязан вопрос
|
|||
|
/// </summary>
|
|||
|
[Column("id_well"), Comment("id скважины")]
|
|||
|
public int IdWell { get; set; }
|
|||
|
|
|||
|
[JsonIgnore]
|
|||
|
[ForeignKey(nameof(IdWell))]
|
|||
|
public virtual Well Well { get; set; } = null!;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// автор вопроса
|
|||
|
/// </summary>
|
|||
|
[Column("id_author_question"), Comment("id автора вопроса")]
|
|||
|
public int IdAuthorQuestion { get; set; }
|
|||
|
|
|||
|
[JsonIgnore]
|
|||
|
[ForeignKey(nameof(IdAuthorQuestion))]
|
|||
|
public virtual User AuthorQuestion { get; set; } = null!;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// автор ответа
|
|||
|
/// </summary>
|
|||
|
[Column("id_author_answer"), Comment("id автора ответа")]
|
|||
|
public int? IdAuthorAnswer { get; set; }
|
|||
|
|
|||
|
[JsonIgnore]
|
|||
|
[ForeignKey(nameof(IdAuthorAnswer))]
|
|||
|
public virtual User AuthorAnswer { get; set; } = null!;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// дата создания вопроса
|
|||
|
/// </summary>
|
|||
|
[Column("date_created_question"), Comment("Дата создания вопроса")]
|
|||
|
public DateTimeOffset DateCreatedQuestion { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// дата ответа
|
|||
|
/// </summary>
|
|||
|
[Column("date_answer"), Comment("Дата ответа")]
|
|||
|
public DateTimeOffset? DateAnswer { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// дата последнего редактирования вопроса
|
|||
|
/// </summary>
|
|||
|
[Column("date_last_edited_question"), Comment("Дата последнего редактирования вопроса")]
|
|||
|
public DateTimeOffset DateLastEditedQuestion { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// текст вопроса
|
|||
|
/// </summary>
|
|||
|
[Column("question"), Comment("Текст вопроса")]
|
|||
|
public string Question { get; set; } = null!;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// текст ответа
|
|||
|
/// </summary>
|
|||
|
[Column("answer"), Comment("Текст ответа")]
|
|||
|
public string? Answer { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// статус вопроса
|
|||
|
/// </summary>
|
|||
|
[Column("state"), Comment("Статус вопроса")]
|
|||
|
public int State { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Счетчик повторений вопроса
|
|||
|
/// </summary>
|
|||
|
[Column("counter_question"), Comment("Счетчик повторений вопроса")]
|
|||
|
public int CounterQuestion { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Ключ заменяющего вопроса
|
|||
|
/// </summary>
|
|||
|
[Column("id_replacement_question"), Comment("Ключ заменяющего вопроса")]
|
|||
|
public int? IdReplacementQuestion { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Частый вопрос
|
|||
|
/// </summary>
|
|||
|
[Column("is_frequently"), Comment("Частый вопрос")]
|
|||
|
public bool IsFrequently { get; set; } = false;
|
|||
|
|
|||
|
}
|
|||
|
#nullable disable
|
|||
|
}
|