63 lines
1.7 KiB
C#
63 lines
1.7 KiB
C#
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using MongoRepository;
|
|
using MongoRepository.Attributes;
|
|
|
|
namespace CommonDomain
|
|
{
|
|
[BsonCollection("faq_category", "data_0524")]
|
|
[BsonIgnoreExtraElements]
|
|
public class FaqCategory : MongoBaseEntity
|
|
{
|
|
[BsonElement("parentid")]
|
|
public string? ParentId { get; set; }
|
|
|
|
[BsonElement("name")]
|
|
public string? Name { get; set; }
|
|
|
|
[BsonElement("icon")]
|
|
public string? Icon { get; set; }
|
|
|
|
[BsonElement("sort")]
|
|
public int Sort { get; set; } = 0;
|
|
|
|
[BsonElement("isenable")]
|
|
public bool IsEnable { get; set; } = true;
|
|
}
|
|
|
|
[BsonCollection("faq_question", "data_0524")]
|
|
[BsonIgnoreExtraElements]
|
|
public class FaqQuestion : MongoBaseEntity
|
|
{
|
|
[BsonElement("categoryid")]
|
|
public string? CategoryId { get; set; }
|
|
|
|
[BsonElement("title")]
|
|
public string? Title { get; set; }
|
|
|
|
[BsonElement("content")]
|
|
public string? Content { get; set; }
|
|
|
|
[BsonElement("sort")]
|
|
public int Sort { get; set; } = 0;
|
|
|
|
[BsonElement("isenable")]
|
|
public bool IsEnable { get; set; } = true;
|
|
|
|
[BsonElement("createtime")]
|
|
[BsonDateTimeOptions(Kind = DateTimeKind.Local, DateOnly = false)]
|
|
public DateTime CreateTime { get; set; } = DateTime.Now;
|
|
}
|
|
|
|
public class FaqCategoryTreeNode
|
|
{
|
|
public string? Id { get; set; }
|
|
public string? Name { get; set; }
|
|
public string? Icon { get; set; }
|
|
public int Sort { get; set; }
|
|
public bool IsEnable { get; set; }
|
|
public List<FaqCategoryTreeNode> Children { get; set; } = new();
|
|
public int QuestionCount { get; set; }
|
|
}
|
|
}
|