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")
|
2025-03-26 14:57:44 +08:00
|
|
|
auth.Post("/verify/sms", PermitUser(), handlers.SmsCode)
|
|
|
|
|
auth.Post("/login/sms", PermitUser(), handlers.Login)
|
2025-03-18 17:57:07 +08:00
|
|
|
auth.Post("/token", handlers.Token)
|
2025-03-15 16:07:45 +08:00
|
|
|
|
2025-03-26 14:57:44 +08:00
|
|
|
// 客户端
|
2025-03-18 17:57:07 +08:00
|
|
|
client := api.Group("/client")
|
|
|
|
|
client.Get("/test/create", handlers.CreateClient)
|
2025-03-26 14:57:44 +08:00
|
|
|
|
|
|
|
|
// 通道
|
|
|
|
|
channel := api.Group("/channel", PermitUser())
|
|
|
|
|
channel.Post("/create", handlers.CreateChannel)
|
2025-03-15 16:07:45 +08:00
|
|
|
}
|