using BotSharp.Core.Entities;
using BotSharp.Core.Intents;
using EntityFrameworkCore.BootKit;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace BotSharp.Core.Agents
{
[Table("Bot_Agent")]
public class Agent : DbRecord, IDbRecord
{
public Agent()
{
CreatedDate = DateTime.UtcNow;
}
[Required]
[MaxLength(64)]
public String Name { get; set; }
[MaxLength(256)]
public String Description { get; set; }
public Boolean Published { get; set; }
[Required]
[MaxLength(5)]
public String Language { get; set; }
///
/// Only access text/ audio rquest
///
[StringLength(32)]
public String ClientAccessToken { get; set; }
///
/// Developer can access more APIs
///
[StringLength(32)]
public String DeveloperAccessToken { get; set; }
///
/// Who created this bot
///
[Required]
[StringLength(36)]
public String UserId { get; set; }
[ForeignKey("AgentId")]
public List Intents { get; set; }
[ForeignKey("AgentId")]
[JsonProperty("entity_types")]
public List Entities { get; set; }
public String Birthday
{
get
{
return CreatedDate.ToShortDateString();
}
}
[Required]
public DateTime CreatedDate { get; set; }
}
}