diff --git a/BotSharp.RestApi/BotSharp.RestApi.xml b/BotSharp.RestApi/BotSharp.RestApi.xml index dba99f03..64f1d4d7 100644 --- a/BotSharp.RestApi/BotSharp.RestApi.xml +++ b/BotSharp.RestApi/BotSharp.RestApi.xml @@ -29,6 +29,11 @@ + + + The /entities endpoint is used to create, retrieve, update, and delete developer-defined entity objects. + + Dialogflow mode query controller diff --git a/BotSharp.RestApi/Dialogflow/DialogflowAllEntityViewModel.cs b/BotSharp.RestApi/Dialogflow/DialogflowAllEntityViewModel.cs new file mode 100644 index 00000000..bd339e35 --- /dev/null +++ b/BotSharp.RestApi/Dialogflow/DialogflowAllEntityViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.RestApi.Dialogflow +{ + public class DialogflowAllEntityViewModel + { + public int Count { get; set; } + + public string Id { get; set; } + + public string Name { get; set; } + + public string Preview { get; set; } + } +} diff --git a/BotSharp.RestApi/Dialogflow/EntitiesController.cs b/BotSharp.RestApi/Dialogflow/EntitiesController.cs new file mode 100644 index 00000000..3c276fba --- /dev/null +++ b/BotSharp.RestApi/Dialogflow/EntitiesController.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.RestApi.Dialogflow +{ +#if DIALOGFLOW + /// + /// The /entities endpoint is used to create, retrieve, update, and delete developer-defined entity objects. + /// + [Authorize] + [Route("v1/[controller]")] + public class EntitiesController : ControllerBase + { + [HttpGet] + public IEnumerable All() + { + return new List(); + } + } +#endif +} diff --git a/BotSharp.RestApi/Dialogflow/IntentsController.cs b/BotSharp.RestApi/Dialogflow/IntentsController.cs new file mode 100644 index 00000000..3c053825 --- /dev/null +++ b/BotSharp.RestApi/Dialogflow/IntentsController.cs @@ -0,0 +1,55 @@ +using BotSharp.Core.Adapters.Dialogflow; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.RestApi.Dialogflow +{ +#if DIALOGFLOW + /// + /// The /intents endpoint is used to create, retrieve, update, and delete intent objects. + /// + [Authorize] + [Route("v1/[controller]")] + public class IntentsController : ControllerBase + { + /// + /// Retrieves a list of all intents for the agent. + /// + /// + [HttpGet] + public IEnumerable GetIntents() + { + return new List(); + } + + /// + /// The POST request creates a new intent. When a new intent is created via the API, the agent is trained with the new data. + /// + /// + [HttpPost] + public string PostIntent([FromBody] DialogflowIntent intent) + { + return ""; + } + + /// + /// Retrieves the specified intent. {id} is the ID of the intent to retrieve. + /// + /// + [HttpGet("{id}")] + public DialogflowIntent GetIntent() + { + return new DialogflowIntent(); + } + + [HttpPut("{id}")] + public bool PutIntent([FromBody] DialogflowIntent intent) + { + return true; + } + } +#endif +} diff --git a/docs/static/logos/WechatQRCode.png b/docs/static/logos/WechatQRCode.png new file mode 100644 index 00000000..0aa1bee0 Binary files /dev/null and b/docs/static/logos/WechatQRCode.png differ