add new apis for test in arvan

release
Amir Hossein Khademi 2024-03-10 09:27:13 +03:30
parent f18c415979
commit 7aa057cd8c
5 changed files with 28 additions and 13 deletions

View File

@ -1 +1 @@
0.17.20.30
0.17.20.32

View File

@ -17,8 +17,8 @@
"TaxesFee": 9
},
"SiteSettings": {
"BaseUrl": "https://api.vesmook.com",
"AdminPanelBaseUrl": "https://admin.vesmook.com",
"BaseUrl": "https://api.vesmeh.com",
"AdminPanelBaseUrl": "https://admin.vesmeh.com",
"KaveNegarApiKey": "3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B",
"UserSetting": {
"Username": "09214802813",

View File

@ -9,17 +9,32 @@ public class SeedController : ICarterModule
var group = app.NewVersionedApi("Seed")
.MapGroup("api/seed");
group.MapPost("categories", SeedCategoriesAsync)
group.MapGet("test1", () =>
{
return TypedResults.BadRequest(new ApiResult(false, ApiResultStatusCode.ServerError,
"Server Error 1 ( BAD REQUEST )"));
})
.WithDisplayName("SeedCategoriesAsync")
.HasApiVersion(1.0);
group.MapPost("brands", SeedBrandsAsync)
.WithDisplayName("SeedBrandsAsync")
.HasApiVersion(1.0);
group.MapGet("test2", () =>
{
throw new Exception("Server Error 2 ( EXCEPTION THROWN )");
})
.WithDisplayName("SeedCategoriesAsync")
.HasApiVersion(1.0);
group.MapPost("products",SeedProductsAsync)
.WithDisplayName("SeedProductsAsync")
.HasApiVersion(1.0);
//group.MapPost("categories", SeedCategoriesAsync)
// .WithDisplayName("SeedCategoriesAsync")
// .HasApiVersion(1.0);
//group.MapPost("brands", SeedBrandsAsync)
// .WithDisplayName("SeedBrandsAsync")
// .HasApiVersion(1.0);
//group.MapPost("products",SeedProductsAsync)
// .WithDisplayName("SeedProductsAsync")
// .HasApiVersion(1.0);
}

View File

@ -6,8 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssemblyVersion>0.17.20.30</AssemblyVersion>
<FileVersion>0.17.20.30</FileVersion>
<AssemblyVersion>0.17.20.32</AssemblyVersion>
<FileVersion>0.17.20.32</FileVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -145,7 +145,7 @@ public class ExceptionHandlerMiddleware
Formatting = Formatting.Indented
});
context.Response.StatusCode = (int)httpStatusCode;
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
context.Response.ContentType = "application/json";
await context.Response.WriteAsJsonAsync(result);
}