BotSharp/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/AgentTaskDocument.cs

46 lines
1.3 KiB
C#
Raw Normal View History

2025-01-30 21:58:57 +00:00
using BotSharp.Abstraction.Tasks.Models;
2024-02-04 05:42:13 +00:00
namespace BotSharp.Plugin.MongoStorage.Collections;
public class AgentTaskDocument : MongoBase
{
public string Name { get; set; }
public string? Description { get; set; }
public string Content { get; set; }
public bool Enabled { get; set; }
public string AgentId { get; set; }
2025-01-30 21:58:57 +00:00
public string Status { get; set; }
2024-02-04 05:42:13 +00:00
public DateTime CreatedTime { get; set; }
public DateTime UpdatedTime { get; set; }
2025-01-30 21:58:57 +00:00
public static AgentTask ToDomainModel(AgentTaskDocument model)
{
return new AgentTask
{
Id = model.Id,
Description = model.Description,
Content = model.Content,
Enabled = model.Enabled,
AgentId = model.AgentId,
Status = model.Status,
CreatedDateTime = model.CreatedTime,
UpdatedDateTime = model.UpdatedTime
};
}
public static AgentTaskDocument ToMongoModel(AgentTask model)
{
return new AgentTaskDocument
{
Id = model.Id,
Description = model.Description,
Content = model.Content,
Enabled = model.Enabled,
AgentId = model.AgentId,
Status = model.Status,
CreatedTime = model.CreatedDateTime,
UpdatedTime = model.UpdatedDateTime
};
}
2024-02-04 05:42:13 +00:00
}