mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Fix endpoint that gets resolutions by GPUs.
This commit is contained in:
@@ -279,7 +279,7 @@ namespace Marechai.App
|
||||
ApiClientBuilder.RegisterDefaultDeserializer<FormParseNodeFactory>();
|
||||
if (string.IsNullOrEmpty(RequestAdapter.BaseUrl))
|
||||
{
|
||||
RequestAdapter.BaseUrl = "https://localhost:7163";
|
||||
RequestAdapter.BaseUrl = "http://localhost:5023";
|
||||
}
|
||||
PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ using System;
|
||||
namespace Marechai.App.ResolutionsByGpu.Gpus.Item.Resolutions
|
||||
{
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </summary>
|
||||
[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
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public ResolutionsRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/resolutions-by-gpu/gpus/{resolutionId}/resolutions", pathParameters)
|
||||
public ResolutionsRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/resolutions-by-gpu/gpus/{gpuId}/resolutions", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
@@ -30,7 +30,7 @@ namespace Marechai.App.ResolutionsByGpu.Gpus.Item.Resolutions
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
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)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::Marechai.App.Models.ResolutionByGpuDto></returns>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"descriptionHash": "ABDC74AB94257D5ED6BFBA4E57134BD2B3A4A2C3EC8EC2A514A70334900294CA4391DB5F7404A6055B8B63D0392BB28073F071E07F310F4E650779D5805ACBFF",
|
||||
"descriptionHash": "DFB5AA54CD7E25D4B216D1E48D3E6F12FDC6C02AC848D74CEC21E4377589A73692313690598744726310A7AD334B7C8F9FA68E6E9A475D6B0B368CE907204194",
|
||||
"descriptionLocation": "http://localhost:5023/openapi/v1.json",
|
||||
"lockFileVersion": "1.0.0",
|
||||
"kiotaVersion": "1.29.0",
|
||||
|
||||
@@ -40,13 +40,12 @@ 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<List<ResolutionByGpuDto>> GetByGpu(int resolutionId) => (await context.ResolutionsByGpu
|
||||
.Where(r => r.ResolutionId ==
|
||||
resolutionId)
|
||||
public async Task<List<ResolutionByGpuDto>> GetByGpu(int gpuId) => (await context.ResolutionsByGpu
|
||||
.Where(r => r.GpuId == gpuId)
|
||||
.Select(r => new ResolutionByGpuDto
|
||||
{
|
||||
Id = r.Id,
|
||||
@@ -57,11 +56,9 @@ public class ResolutionsByGpuController(MarechaiContext context) : ControllerBas
|
||||
Width = r.Resolution.Width,
|
||||
Height = r.Resolution.Height,
|
||||
Colors = r.Resolution.Colors,
|
||||
Palette = r.Resolution
|
||||
.Palette,
|
||||
Palette = r.Resolution.Palette,
|
||||
Chars = r.Resolution.Chars,
|
||||
Grayscale = r.Resolution
|
||||
.Grayscale
|
||||
Grayscale = r.Resolution.Grayscale
|
||||
},
|
||||
ResolutionId = r.ResolutionId
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user