|
| 1 | +using AzureOpenAIProxy.ApiApp.Models; |
| 2 | + |
| 3 | +namespace AzureOpenAIProxy.ApiApp.Repositories; |
| 4 | + |
| 5 | +/// <summary> |
| 6 | +/// This provides interfaces to the <see cref="AdminEventRepository"/> class. |
| 7 | +/// </summary> |
| 8 | +public interface IAdminEventRepository |
| 9 | +{ |
| 10 | + /// <summary> |
| 11 | + /// Creates a new record of event details. |
| 12 | + /// </summary> |
| 13 | + /// <param name="eventDetails">Event details instance.</param> |
| 14 | + /// <returns>Returns the event details instance created.</returns> |
| 15 | + Task<AdminEventDetails> CreateEvent(AdminEventDetails eventDetails); |
| 16 | + |
| 17 | + /// <summary> |
| 18 | + /// Gets the list of events. |
| 19 | + /// </summary> |
| 20 | + /// <returns>Returns the list of events.</returns> |
| 21 | + Task<List<AdminEventDetails>> GetEvents(); |
| 22 | + |
| 23 | + /// <summary> |
| 24 | + /// Gets the event details. |
| 25 | + /// </summary> |
| 26 | + /// <param name="eventId">Event ID.</param> |
| 27 | + /// <returns>Returns the event details record.</returns> |
| 28 | + Task<AdminEventDetails> GetEvent(Guid eventId); |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// Updates the event details. |
| 32 | + /// </summary> |
| 33 | + /// <param name="eventId">Event ID.</param> |
| 34 | + /// <param name="eventDetails">Event details instance.</param> |
| 35 | + /// <returns>Returns the updated record of the event details.</returns> |
| 36 | + Task<AdminEventDetails> UpdateEvent(Guid eventId, AdminEventDetails eventDetails); |
| 37 | +} |
| 38 | + |
| 39 | +/// <summary> |
| 40 | +/// This represents the repository entity for the admin event. |
| 41 | +/// </summary> |
| 42 | +public class AdminEventRepository : IAdminEventRepository |
| 43 | +{ |
| 44 | + /// <inheritdoc /> |
| 45 | + public async Task<AdminEventDetails> CreateEvent(AdminEventDetails eventDetails) |
| 46 | + { |
| 47 | + throw new NotImplementedException(); |
| 48 | + } |
| 49 | + |
| 50 | + /// <inheritdoc /> |
| 51 | + public async Task<List<AdminEventDetails>> GetEvents() |
| 52 | + { |
| 53 | + throw new NotImplementedException(); |
| 54 | + } |
| 55 | + |
| 56 | + /// <inheritdoc /> |
| 57 | + public async Task<AdminEventDetails> GetEvent(Guid eventId) |
| 58 | + { |
| 59 | + throw new NotImplementedException(); |
| 60 | + } |
| 61 | + |
| 62 | + /// <inheritdoc /> |
| 63 | + public async Task<AdminEventDetails> UpdateEvent(Guid eventId, AdminEventDetails eventDetails) |
| 64 | + { |
| 65 | + throw new NotImplementedException(); |
| 66 | + } |
| 67 | +} |
| 68 | + |
| 69 | +/// <summary> |
| 70 | +/// This represents the extension class for <see cref="IServiceCollection"/> |
| 71 | +/// </summary> |
| 72 | +public static class AdminEventRepositoryExtensions |
| 73 | +{ |
| 74 | + /// <summary> |
| 75 | + /// Adds the <see cref="AdminEventRepository"/> instance to the service collection. |
| 76 | + /// </summary> |
| 77 | + /// <param name="services"><see cref="IServiceCollection"/> instance.</param> |
| 78 | + /// <returns>Returns <see cref="IServiceCollection"/> instance.</returns> |
| 79 | + public static IServiceCollection AddAdminEventRepository(this IServiceCollection services) |
| 80 | + { |
| 81 | + services.AddScoped<IAdminEventRepository, AdminEventRepository>(); |
| 82 | + |
| 83 | + return services; |
| 84 | + } |
| 85 | +} |
0 commit comments