This commit is contained in:
2026-06-19 12:53:33 +08:00
parent 69d6377bc6
commit b9819b913b
19 changed files with 1243 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ import (
admin_product "tydata-server/app/main/api/internal/handler/admin_product"
admin_promotion "tydata-server/app/main/api/internal/handler/admin_promotion"
admin_query "tydata-server/app/main/api/internal/handler/admin_query"
admin_query_whitelist "tydata-server/app/main/api/internal/handler/admin_query_whitelist"
admin_role "tydata-server/app/main/api/internal/handler/admin_role"
admin_role_api "tydata-server/app/main/api/internal/handler/admin_role_api"
admin_user "tydata-server/app/main/api/internal/handler/admin_user"
@@ -603,6 +604,30 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
rest.WithPrefix("/api/v1/admin/query"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.AdminAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
Path: "/append",
Handler: admin_query_whitelist.AdminQueryWhitelistAppendHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/create",
Handler: admin_query_whitelist.AdminQueryWhitelistCreateHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/op-log/list",
Handler: admin_query_whitelist.AdminQueryWhitelistOpLogListHandler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/v1/admin/query-whitelist"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.AdminAuthInterceptor},