23 lines
547 B
C#
23 lines
547 B
C#
using StopShopping.Services;
|
|
using StopShopping.Services.Models.Resp;
|
|
|
|
namespace StopShopping.Api.Routes;
|
|
|
|
public static class Category
|
|
{
|
|
public static RouteGroupBuilder MapCategory(this RouteGroupBuilder routes)
|
|
{
|
|
routes.MapGet("/category/list", GetTree)
|
|
.WithTags(OpenApiTags.分类.ToString());
|
|
|
|
return routes;
|
|
}
|
|
|
|
private static ApiResponse<List<Services.Models.Resp.Category>> GetTree(
|
|
ICategoryService categoryService
|
|
)
|
|
{
|
|
return categoryService.GetCategoriesTree();
|
|
}
|
|
}
|