2025-03-15 16:07:45 +08:00
|
|
|
package web
|
|
|
|
|
|
2025-03-18 10:13:57 +08:00
|
|
|
import (
|
2025-03-18 17:57:07 +08:00
|
|
|
"platform/web/handlers"
|
|
|
|
|
|
2025-03-18 10:13:57 +08:00
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
|
)
|
2025-03-15 16:07:45 +08:00
|
|
|
|
2025-03-18 17:57:07 +08:00
|
|
|
func ApplyRouters(app *fiber.App) {
|
|
|
|
|
api := app.Group("/api")
|
|
|
|
|
|
2025-03-26 14:57:44 +08:00
|
|
|
// 认证
|
2025-03-18 17:57:07 +08:00
|
|
|
auth := api.Group("/auth")
|
|
|
|
|
auth.Post("/token", handlers.Token)
|
2025-04-24 10:52:13 +08:00
|
|
|
auth.Post("/revoke", handlers.Revoke)
|
2025-04-26 17:59:34 +08:00
|
|
|
auth.Post("/introspect", handlers.Introspect)
|
2025-04-24 10:52:13 +08:00
|
|
|
auth.Post("/verify/sms", handlers.SmsCode)
|
2025-03-15 16:07:45 +08:00
|
|
|
|
2025-04-26 17:59:34 +08:00
|
|
|
// 用户
|
|
|
|
|
user := api.Group("/user")
|
2025-04-29 18:48:14 +08:00
|
|
|
user.Post("/update", handlers.UpdateUser)
|
|
|
|
|
user.Post("/update/account", handlers.UpdateAccount)
|
|
|
|
|
user.Post("/update/password", handlers.UpdatePassword)
|
2025-04-26 17:59:34 +08:00
|
|
|
user.Post("/identify", handlers.Identify)
|
|
|
|
|
user.Post("/identify/callback", handlers.IdentifyCallback)
|
|
|
|
|
user.Post("/recharge/prepare/alipay", handlers.RechargePrepareAlipay)
|
|
|
|
|
user.Post("/recharge/confirm/alipay", handlers.RechargeConfirmAlipay)
|
|
|
|
|
user.Post("/recharge/prepare/wechat", handlers.RechargePrepareWechat)
|
|
|
|
|
user.Post("/recharge/confirm/wechat", handlers.RechargeConfirmWechat)
|
|
|
|
|
|
2025-03-26 14:57:44 +08:00
|
|
|
// 通道
|
2025-03-28 18:15:03 +08:00
|
|
|
channel := api.Group("/channel")
|
2025-04-28 11:44:54 +08:00
|
|
|
channel.Post("/list", handlers.ListChannels)
|
2025-04-15 14:30:24 +08:00
|
|
|
channel.Post("/create", handlers.CreateChannel)
|
2025-04-28 10:05:44 +08:00
|
|
|
channel.Post("/remove", handlers.RemoveChannels)
|
2025-04-08 09:35:19 +08:00
|
|
|
|
|
|
|
|
// 白名单
|
|
|
|
|
whitelist := api.Group("/whitelist")
|
|
|
|
|
whitelist.Post("/list", handlers.ListWhitelist)
|
|
|
|
|
whitelist.Post("/create", handlers.CreateWhitelist)
|
|
|
|
|
whitelist.Post("/update", handlers.UpdateWhitelist)
|
|
|
|
|
whitelist.Post("/remove", handlers.RemoveWhitelist)
|
2025-04-01 10:51:32 +08:00
|
|
|
|
2025-04-12 18:03:44 +08:00
|
|
|
// 套餐
|
2025-04-09 16:34:41 +08:00
|
|
|
resource := api.Group("/resource")
|
2025-04-10 17:49:11 +08:00
|
|
|
resource.Post("/list/pss", handlers.ListResourcePss)
|
2025-04-12 18:03:44 +08:00
|
|
|
resource.Post("/all", handlers.AllResource)
|
2025-04-09 16:34:41 +08:00
|
|
|
resource.Post("/create/balance", handlers.CreateResourceByBalance)
|
2025-04-16 18:50:55 +08:00
|
|
|
resource.Post("/prepare/alipay", handlers.PrepareResourceByAlipay)
|
|
|
|
|
resource.Post("/create/alipay", handlers.CreateResourceByAlipay)
|
|
|
|
|
resource.Post("/prepare/wechat", handlers.PrepareResourceByWechat)
|
|
|
|
|
resource.Post("/create/wechat", handlers.CreateResourceByWechat)
|
2025-04-09 16:34:41 +08:00
|
|
|
|
2025-04-11 17:36:34 +08:00
|
|
|
// 账单
|
|
|
|
|
bill := api.Group("/bill")
|
|
|
|
|
bill.Post("/list", handlers.ListBill)
|
|
|
|
|
|
2025-04-17 18:29:44 +08:00
|
|
|
// 交易
|
|
|
|
|
trade := api.Group("/trade")
|
|
|
|
|
trade.Post("/callback/alipay", handlers.AlipayCallback)
|
2025-03-15 16:07:45 +08:00
|
|
|
}
|