BotSharp/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Knowledges/KnowledgeFileViewModel.cs

43 lines
1.1 KiB
C#
Raw Normal View History

2024-09-10 19:33:42 +00:00
using System.Text.Json.Serialization;
namespace BotSharp.OpenAPI.ViewModels.Knowledges;
public class KnowledgeFileViewModel
{
[JsonPropertyName("file_id")]
2024-09-17 17:50:39 +00:00
public Guid FileId { get; set; }
2024-09-10 19:33:42 +00:00
[JsonPropertyName("file_name")]
public string FileName { get; set; }
2024-09-19 16:43:49 +00:00
[JsonPropertyName("file_source")]
public string FileSource { get; set; }
2024-09-10 19:33:42 +00:00
[JsonPropertyName("file_extension")]
public string FileExtension { get; set; }
[JsonPropertyName("content_type")]
public string ContentType { get; set; }
[JsonPropertyName("file_url")]
public string FileUrl { get; set; }
2024-09-18 15:35:28 +00:00
[JsonPropertyName("ref_data")]
public DocMetaRefData? RefData { get; set; }
2024-09-10 19:33:42 +00:00
public static KnowledgeFileViewModel From(KnowledgeFileModel model)
{
return new KnowledgeFileViewModel
{
FileId = model.FileId,
FileName = model.FileName,
2024-09-19 16:43:49 +00:00
FileSource = model.FileSource,
2024-09-10 19:33:42 +00:00
FileExtension = model.FileExtension,
ContentType = model.ContentType,
2024-09-18 15:35:28 +00:00
FileUrl = model.FileUrl,
RefData = model.RefData
2024-09-10 19:33:42 +00:00
};
}
}