as is
This commit is contained in:
35
StopShopping.AdminApi/Routes/Root.cs
Normal file
35
StopShopping.AdminApi/Routes/Root.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
using Scalar.AspNetCore;
|
||||
using StopShopping.Services.Models;
|
||||
|
||||
namespace StopShopping.AdminApi.Routes;
|
||||
|
||||
/// <summary>
|
||||
/// 其他路由从RouteGroupBuilder扩展并添加到MapGroup之后
|
||||
/// </summary>
|
||||
public static class Root
|
||||
{
|
||||
public static void MapRoutes(WebApplication app)
|
||||
{
|
||||
app.MapGroup("")
|
||||
.MapCommon()
|
||||
.MapCategory()
|
||||
.MapProduct()
|
||||
.MapDistrict()
|
||||
.WithDescription("登录用户调用")
|
||||
.RequireAuthorization(policy => policy.RequireRole(SystemRoles.Admin.ToString()));
|
||||
app.MapGroup("")
|
||||
.MapAdmin()
|
||||
.WithDescription("公共调用")
|
||||
.AllowAnonymous();
|
||||
}
|
||||
}
|
||||
|
||||
public enum OpenApiTags
|
||||
{
|
||||
分类,
|
||||
商品,
|
||||
管理员,
|
||||
通用,
|
||||
地址,
|
||||
}
|
||||
Reference in New Issue
Block a user