feat(routing): GET/POST /v1/me/routing 端点 + openapi
This commit is contained in:
@@ -40,6 +40,7 @@ import (
|
||||
"github.com/wangjia/pangolin/server/internal/provision/providers"
|
||||
"github.com/wangjia/pangolin/server/internal/redisutil"
|
||||
"github.com/wangjia/pangolin/server/internal/reward"
|
||||
"github.com/wangjia/pangolin/server/internal/routing"
|
||||
"github.com/wangjia/pangolin/server/internal/scheduler"
|
||||
"github.com/wangjia/pangolin/server/internal/scheduler/probe"
|
||||
"github.com/wangjia/pangolin/server/internal/sessions"
|
||||
@@ -406,6 +407,9 @@ func mountV1(r chi.Router, sqlDB *sql.DB, rdb *redis.Client, nodeSvc *nodes.Serv
|
||||
// ── Account / Plans / Notices ─────────────────────────────────────────────
|
||||
accountAPI := httpapi.NewAccountAPI(sqlDB)
|
||||
|
||||
// ── Routing profile (可配置分流) ───────────────────────────────────────────
|
||||
routingAPI := httpapi.NewRoutingAPI(routing.NewStore(sqlDB))
|
||||
|
||||
// ── Nodes + Connect ───────────────────────────────────────────────────────
|
||||
var nodeAPI *httpapi.NodeAPI
|
||||
var nodeStore nodes.NodeStore
|
||||
@@ -486,6 +490,8 @@ func mountV1(r chi.Router, sqlDB *sql.DB, rdb *redis.Client, nodeSvc *nodes.Serv
|
||||
me.Post("/redeem", redeemHandler.ServeHTTP)
|
||||
me.Get("/subscription", subAPI.GetSubscription)
|
||||
me.Post("/subscription/reset", subAPI.ResetSubscription)
|
||||
me.Get("/routing", routingAPI.GetProfile)
|
||||
me.Post("/routing", routingAPI.SaveProfile)
|
||||
if totpHandler != nil {
|
||||
me.Post("/totp/setup", totpHandler.Setup)
|
||||
me.Post("/totp/verify", totpHandler.Verify)
|
||||
|
||||
Reference in New Issue
Block a user