-
Notifications
You must be signed in to change notification settings - Fork 18
[OpenAPI] Add endpoint for view event details #207 #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
justinyoo
merged 18 commits into
aliencube:main
from
juhangil:feature/207-endpoint-admin-event-details
Aug 20, 2024
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
68f8357
Add Get event details endpoint by admin
juhangil 7d79152
Update GetAdminEventDetails OpenAPI description
juhangil 88974a8
Update Admin event endpoint files
juhangil a22f7c8
Update admin event endpoint
juhangil fac97df
Add some test sample
justinyoo 4a5ea72
Update name of namespace/class
justinyoo ea63552
Merge pull request #1 from justinyoo/feature/207-endpoint-admin-event…
juhangil 2e09556
Merge branch 'feature/207-endpoint-admin-event-details' of https://gi…
juhangil b4dc2a0
Add aspire host fixture in AppHost xunit test
juhangil ec7de28
Update fixtures namespace
juhangil 3864299
Rename to AdminGetEventDetailsOpenApiTest
juhangil fc6ca77
Add Reponse model and test method
juhangil a67de9d
Update component test method for property check
juhangil 845aa33
Rename to AdminGetEventDetailsOpenApiTests
juhangil fb48e25
Update AdminEventDetails comment
juhangil 9a8d082
Update Admin event detail component unit test
juhangil 00073a1
Update admin event test code style
juhangil 46f2f28
Update admin event test package import style
juhangil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace AzureOpenAIProxy.ApiApp.Endpoints; | ||
|
||
public static class AdminEndpointUrls | ||
{ | ||
/// <summary> | ||
/// Declares the admin event details endpoint. | ||
/// </summary> | ||
public const string AdminEventDetails = "/admin/events/{eventId}"; | ||
} |
43 changes: 43 additions & 0 deletions
43
src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using AzureOpenAIProxy.ApiApp.Models; | ||
|
||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace AzureOpenAIProxy.ApiApp.Endpoints; | ||
|
||
/// <summary> | ||
/// This represents the endpoint entity for get event details by admin | ||
/// </summary> | ||
public static class AdminEventEndpoints | ||
{ | ||
/// <summary> | ||
/// Adds the get event details by admin endpoint | ||
/// </summary> | ||
/// <param name="app"><see cref="WebApplication"/> instance.</param> | ||
/// <returns>Returns <see cref="RouteHandlerBuilder"/> instance.</returns> | ||
public static RouteHandlerBuilder AddAdminEvents(this WebApplication app) | ||
{ | ||
// Todo: Issue #19 https://github.com/aliencube/azure-openai-sdk-proxy/issues/19 | ||
// Need authorization by admin | ||
var builder = app.MapGet(AdminEndpointUrls.AdminEventDetails, ( | ||
[FromRoute] string eventId) => | ||
{ | ||
// Todo: Issue #208 https://github.com/aliencube/azure-openai-sdk-proxy/issues/208 | ||
return Results.Ok(); | ||
// Todo: Issue #208 | ||
}) | ||
.Produces<AdminEventDetails>(statusCode: StatusCodes.Status200OK, contentType: "application/json") | ||
.Produces(statusCode: StatusCodes.Status401Unauthorized) | ||
.Produces<string>(statusCode: StatusCodes.Status500InternalServerError, contentType: "text/plain") | ||
.WithTags("admin") | ||
.WithName("GetAdminEventDetails") | ||
.WithOpenApi(operation => | ||
{ | ||
operation.Summary = "Gets event details from the given event ID"; | ||
operation.Description = "This endpoint gets the event details from the given event ID."; | ||
|
||
return operation; | ||
}); | ||
|
||
return builder; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
namespace AzureOpenAIProxy.ApiApp.Models; | ||
|
||
/// <summary> | ||
/// This represent the event detail data for response by admin event endpoint. | ||
/// </summary> | ||
public class AdminEventDetails | ||
{ | ||
/// <summary> | ||
/// Gets or sets the event id. | ||
/// </summary> | ||
public required string? EventId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event title name. | ||
/// </summary> | ||
public required string? Title { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event summary. | ||
/// </summary> | ||
public required string? Summary { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event description. | ||
/// </summary> | ||
public string? Description { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event start date. | ||
/// </summary> | ||
public required DateTimeOffset? DateStart { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event end date. | ||
/// </summary> | ||
public required DateTimeOffset? DateEnd { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event start to end date timezone. | ||
/// </summary> | ||
public required string? TimeZone { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event active status. | ||
/// </summary> | ||
public required bool? IsActive { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event organizer name. | ||
/// </summary> | ||
public required string? OrganizerName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event organizer email. | ||
/// </summary> | ||
public required string? OrganizerEmail { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event coorganizer name. | ||
/// </summary> | ||
public string? CoorganizerName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the event coorganizer email. | ||
/// </summary> | ||
public string? CoorganizerEmail { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Azure OpenAI Service request max token capacity. | ||
/// </summary> | ||
public required int? MaxTokenCap { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Azure OpenAI Service daily request capacity. | ||
/// </summary> | ||
public required int? DailyRequestCap { get; set; } | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.