File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed
BotSharp.Platform.Dialogflow/Controllers
BotSharp.Platform.Models/Agents Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 11using BotSharp . Platform . Dialogflow . Models ;
2+ using BotSharp . Platform . Dialogflow . ViewModels ;
3+ using BotSharp . Platform . Models . Agents ;
24using Microsoft . AspNetCore . Http ;
35using Microsoft . AspNetCore . Mvc ;
46using System ;
@@ -32,7 +34,8 @@ public AgentController(DialogflowAi<AgentModel> platform)
3234 /// <param name="file"></param>
3335 /// <returns></returns>
3436 [ HttpPost ( "import" ) ]
35- public async Task < ActionResult > Import ( IFormFile uploadedFile )
37+ [ ProducesResponseType ( typeof ( ImportedAgentViewModel ) , 200 ) ]
38+ public async Task < IActionResult > Import ( IFormFile uploadedFile )
3639 {
3740 if ( uploadedFile == null || uploadedFile . Length == 0 )
3841 {
@@ -61,7 +64,13 @@ public async Task<ActionResult> Import(IFormFile uploadedFile)
6164 var agent = await builder . LoadAgentFromFile < AgentImporterInDialogflow < AgentModel > > ( dest ) ;
6265 await builder . SaveAgent ( agent ) ;
6366
64- return Ok ( agent . Id ) ;
67+ return Ok ( new ImportedAgentViewModel
68+ {
69+ Id = agent . Id ,
70+ Name = agent . Name ,
71+ Description = agent . Description ,
72+ ClientAccessToken = agent . ClientAccessToken
73+ } ) ;
6574 }
6675
6776 /// <summary>
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Text ;
4+
5+ namespace BotSharp . Platform . Models . Agents
6+ {
7+ public class ImportedAgentViewModel
8+ {
9+ public string Id { get ; set ; }
10+
11+ public string Name { get ; set ; }
12+
13+ public string Description { get ; set ; }
14+
15+ public string ClientAccessToken { get ; set ; }
16+ }
17+ }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class SwaggerFileUploadOperation : IOperationFilter
1111 {
1212 public void Apply ( Operation operation , OperationFilterContext context )
1313 {
14- if ( operation . OperationId == "V1AgentImportPost " )
14+ if ( operation . OperationId == "Import " )
1515 {
1616 operation . Parameters . Clear ( ) ;
1717
You can’t perform that action at this time.
0 commit comments