2018-03-28 22:08:49 +00:00
|
|
|
|
using BotSharp.Core.Entities;
|
|
|
|
|
|
using BotSharp.Core.Intents;
|
2017-12-18 05:30:20 +00:00
|
|
|
|
using EntityFrameworkCore.BootKit;
|
2017-12-30 20:26:35 +00:00
|
|
|
|
using Newtonsoft.Json;
|
2017-12-18 05:30:20 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2017-12-18 13:31:15 +00:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2017-12-18 05:30:20 +00:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
2018-03-28 22:08:49 +00:00
|
|
|
|
namespace BotSharp.Core.Agents
|
2017-12-18 05:30:20 +00:00
|
|
|
|
{
|
2017-12-30 20:26:35 +00:00
|
|
|
|
[Table("Bot_Agent")]
|
|
|
|
|
|
public class Agent : DbRecord, IDbRecord
|
2017-12-18 05:30:20 +00:00
|
|
|
|
{
|
2018-05-07 00:48:10 +00:00
|
|
|
|
public Agent()
|
|
|
|
|
|
{
|
|
|
|
|
|
CreatedDate = DateTime.UtcNow;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-05-23 05:11:15 +00:00
|
|
|
|
[Required]
|
2017-12-18 05:30:20 +00:00
|
|
|
|
[MaxLength(64)]
|
|
|
|
|
|
public String Name { get; set; }
|
2017-12-18 13:31:15 +00:00
|
|
|
|
|
2018-04-30 03:09:32 +00:00
|
|
|
|
[MaxLength(256)]
|
2018-03-21 21:07:43 +00:00
|
|
|
|
public String Description { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public Boolean Published { get; set; }
|
|
|
|
|
|
|
2018-05-23 05:11:15 +00:00
|
|
|
|
[Required]
|
2018-05-21 13:28:19 +00:00
|
|
|
|
[MaxLength(5)]
|
2018-03-21 21:07:43 +00:00
|
|
|
|
public String Language { get; set; }
|
|
|
|
|
|
|
2018-03-28 22:08:49 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Only access text/ audio rquest
|
|
|
|
|
|
/// </summary>
|
2018-04-30 03:09:32 +00:00
|
|
|
|
[StringLength(32)]
|
2018-03-28 22:08:49 +00:00
|
|
|
|
public String ClientAccessToken { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Developer can access more APIs
|
|
|
|
|
|
/// </summary>
|
2018-04-30 03:09:32 +00:00
|
|
|
|
[StringLength(32)]
|
2018-03-28 22:08:49 +00:00
|
|
|
|
public String DeveloperAccessToken { get; set; }
|
|
|
|
|
|
|
2018-05-06 17:41:36 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Who created this bot
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
[StringLength(36)]
|
|
|
|
|
|
public String UserId { get; set; }
|
|
|
|
|
|
|
2017-12-18 13:31:15 +00:00
|
|
|
|
[ForeignKey("AgentId")]
|
2017-12-30 20:26:35 +00:00
|
|
|
|
public List<Intent> Intents { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[ForeignKey("AgentId")]
|
|
|
|
|
|
[JsonProperty("entity_types")]
|
2018-05-22 00:39:33 +00:00
|
|
|
|
public List<EntityType> Entities { get; set; }
|
2018-05-07 00:48:10 +00:00
|
|
|
|
|
|
|
|
|
|
public String Birthday
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return CreatedDate.ToShortDateString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
public DateTime CreatedDate { get; set; }
|
2018-07-12 15:07:05 +00:00
|
|
|
|
|
|
|
|
|
|
public Boolean IsSkillSet { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[ForeignKey("AgentId")]
|
|
|
|
|
|
public AgentMlConfig MlConfig { get; set; }
|
2017-12-18 05:30:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|