-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathReferenceDataController.cs
More file actions
45 lines (39 loc) · 2.29 KB
/
Copy pathReferenceDataController.cs
File metadata and controls
45 lines (39 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* This file is automatically generated; any changes will be lost.
*/
using CommonRefDataNamespace = AIChat.AOAI.Common.Entities;
namespace AIChat.AOAI.Api.Controllers;
/// <summary>
/// Provides the <b>ReferenceData</b> Web API functionality.
/// </summary>
[Consumes(System.Net.Mime.MediaTypeNames.Application.Json)]
[Produces(System.Net.Mime.MediaTypeNames.Application.Json)]
public partial class ReferenceDataController : ControllerBase
{
private readonly ReferenceDataContentWebApi _webApi;
private readonly ReferenceDataOrchestrator _orchestrator;
/// <summary>
/// Initializes a new instance of the <see cref="ReferenceDataController"/> class.
/// </summary>
/// <param name="webApi">The <see cref="ReferenceDataContentWebApi"/>.</param>
/// <param name="orchestrator">The <see cref="ReferenceDataOrchestrator"/>.</param>
public ReferenceDataController(ReferenceDataContentWebApi webApi, ReferenceDataOrchestrator orchestrator)
{ _webApi = webApi.ThrowIfNull(); _orchestrator = orchestrator.ThrowIfNull(); }
/// <summary>
/// Gets all of the 'Role' reference data items that match the specified criteria.
/// </summary>
/// <param name="codes">The reference data code list.</param>
/// <param name="text">The reference data text (including wildcards).</param>
/// <returns>The 'Role' array.</returns>
[HttpGet("ref/roles", Name="ReferenceData_RoleGetAll")]
[ProducesResponseType(typeof(IEnumerable<CommonRefDataNamespace.Role>), (int)HttpStatusCode.OK)]
public Task<IActionResult> RoleGetAll([FromQuery] IEnumerable<string>? codes = default, string? text = default)
=> _webApi.GetAsync(Request, p => _orchestrator.GetWithFilterAsync<RefDataNamespace.Role>(codes, text, p.RequestOptions.IncludeInactive));
/// <summary>
/// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3
/// </summary>
/// <returns>The 'ReferenceDataMultiDictionary'.</returns>
[HttpGet("ref", Name="ReferenceData_GetNamed")]
[ProducesResponseType(typeof(CoreEx.RefData.ReferenceDataMultiDictionary), (int)HttpStatusCode.OK)]
public Task<IActionResult> GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions));
}