forked from ddrilling/AsbCloudServer
95 lines
3.3 KiB
C#
95 lines
3.3 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace AsbCloudDb.Model
|
|
{
|
|
[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_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; }
|
|
|
|
/// <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; } = Faq.StateOpened;
|
|
|
|
/// <summary>
|
|
/// Счетчик повторений вопроса
|
|
/// </summary>
|
|
[Column("counter_question"), Comment("Счетчик повторений вопроса")]
|
|
public int CounterQuestion { get; set; } = 1;
|
|
|
|
/// <summary>
|
|
/// Ключ заменяющего вопроса
|
|
/// </summary>
|
|
[Column("id_replacement_question"), Comment("Ключ заменяющего вопроса")]
|
|
public int? IdReplacementQuestion { get; set; }
|
|
|
|
/// <summary>
|
|
/// Частый вопрос
|
|
/// </summary>
|
|
[Column("is_frequently"), Comment("Частый вопрос")]
|
|
public bool IsFrequently { get; set; } = false;
|
|
|
|
}
|
|
}
|