diff --git a/Marechai.App/Services/Client/ApiClient.cs b/Marechai.App/Services/Client/ApiClient.cs index d19bf5e7..c03efe3c 100644 --- a/Marechai.App/Services/Client/ApiClient.cs +++ b/Marechai.App/Services/Client/ApiClient.cs @@ -279,7 +279,7 @@ namespace Marechai.App ApiClientBuilder.RegisterDefaultDeserializer(); if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) { - RequestAdapter.BaseUrl = "https://localhost:7163"; + RequestAdapter.BaseUrl = "http://localhost:5023"; } PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl); } diff --git a/Marechai.App/Services/Client/ResolutionsByGpu/Gpus/Item/Resolutions/ResolutionsRequestBuilder.cs b/Marechai.App/Services/Client/ResolutionsByGpu/Gpus/Item/Resolutions/ResolutionsRequestBuilder.cs index dc8b2dbb..e3dfe82e 100644 --- a/Marechai.App/Services/Client/ResolutionsByGpu/Gpus/Item/Resolutions/ResolutionsRequestBuilder.cs +++ b/Marechai.App/Services/Client/ResolutionsByGpu/Gpus/Item/Resolutions/ResolutionsRequestBuilder.cs @@ -12,7 +12,7 @@ using System; namespace Marechai.App.ResolutionsByGpu.Gpus.Item.Resolutions { /// - /// Builds and executes requests for operations under \resolutions-by-gpu\gpus\{resolutionId}\resolutions + /// Builds and executes requests for operations under \resolutions-by-gpu\gpus\{gpuId}\resolutions /// [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] public partial class ResolutionsRequestBuilder : BaseRequestBuilder @@ -22,7 +22,7 @@ namespace Marechai.App.ResolutionsByGpu.Gpus.Item.Resolutions /// /// Path parameters for the request /// The request adapter to use to execute the requests. - public ResolutionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/resolutions-by-gpu/gpus/{resolutionId}/resolutions", pathParameters) + public ResolutionsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/resolutions-by-gpu/gpus/{gpuId}/resolutions", pathParameters) { } /// @@ -30,7 +30,7 @@ namespace Marechai.App.ResolutionsByGpu.Gpus.Item.Resolutions /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. - public ResolutionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/resolutions-by-gpu/gpus/{resolutionId}/resolutions", rawUrl) + public ResolutionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/resolutions-by-gpu/gpus/{gpuId}/resolutions", rawUrl) { } /// A List<global::Marechai.App.Models.ResolutionByGpuDto> diff --git a/Marechai.App/Services/Client/kiota-lock.json b/Marechai.App/Services/Client/kiota-lock.json index 747c445a..12ae6fc4 100644 --- a/Marechai.App/Services/Client/kiota-lock.json +++ b/Marechai.App/Services/Client/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "ABDC74AB94257D5ED6BFBA4E57134BD2B3A4A2C3EC8EC2A514A70334900294CA4391DB5F7404A6055B8B63D0392BB28073F071E07F310F4E650779D5805ACBFF", + "descriptionHash": "DFB5AA54CD7E25D4B216D1E48D3E6F12FDC6C02AC848D74CEC21E4377589A73692313690598744726310A7AD334B7C8F9FA68E6E9A475D6B0B368CE907204194", "descriptionLocation": "http://localhost:5023/openapi/v1.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.29.0", diff --git a/Marechai.Server/Controllers/ResolutionsByGpuController.cs b/Marechai.Server/Controllers/ResolutionsByGpuController.cs index 9787b4a6..a0bae90c 100644 --- a/Marechai.Server/Controllers/ResolutionsByGpuController.cs +++ b/Marechai.Server/Controllers/ResolutionsByGpuController.cs @@ -40,39 +40,36 @@ namespace Marechai.Server.Controllers; [ApiController] public class ResolutionsByGpuController(MarechaiContext context) : ControllerBase { - [HttpGet("gpus/{resolutionId:int}/resolutions")] + [HttpGet("gpus/{gpuId:int}/resolutions")] [AllowAnonymous] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] - public async Task> GetByGpu(int resolutionId) => (await context.ResolutionsByGpu - .Where(r => r.ResolutionId == - resolutionId) - .Select(r => new ResolutionByGpuDto - { - Id = r.Id, - GpuId = r.GpuId, - Resolution = new ResolutionDto - { - Id = r.Resolution.Id, - Width = r.Resolution.Width, - Height = r.Resolution.Height, - Colors = r.Resolution.Colors, - Palette = r.Resolution - .Palette, - Chars = r.Resolution.Chars, - Grayscale = r.Resolution - .Grayscale - }, - ResolutionId = r.ResolutionId - }) - .ToListAsync()) - .OrderBy(r => r.Resolution.Width) - .ThenBy(r => r.Resolution.Height) - .ThenBy(r => r.Resolution.Chars) - .ThenBy(r => r.Resolution.Grayscale) - .ThenBy(r => r.Resolution.Colors) - .ThenBy(r => r.Resolution.Palette) - .ToList(); + public async Task> GetByGpu(int gpuId) => (await context.ResolutionsByGpu + .Where(r => r.GpuId == gpuId) + .Select(r => new ResolutionByGpuDto + { + Id = r.Id, + GpuId = r.GpuId, + Resolution = new ResolutionDto + { + Id = r.Resolution.Id, + Width = r.Resolution.Width, + Height = r.Resolution.Height, + Colors = r.Resolution.Colors, + Palette = r.Resolution.Palette, + Chars = r.Resolution.Chars, + Grayscale = r.Resolution.Grayscale + }, + ResolutionId = r.ResolutionId + }) + .ToListAsync()) + .OrderBy(r => r.Resolution.Width) + .ThenBy(r => r.Resolution.Height) + .ThenBy(r => r.Resolution.Chars) + .ThenBy(r => r.Resolution.Grayscale) + .ThenBy(r => r.Resolution.Colors) + .ThenBy(r => r.Resolution.Palette) + .ToList(); [HttpDelete("{id:long}")] [Authorize(Roles = "Admin,UberAdmin")]