Files
workspace/code/allapp/allapp-go/api/router/router.go
T
2026-02-27 22:09:50 +08:00

30 lines
695 B
Go

package router
import (
"allapp/api/handler/auth"
"allapp/api/handler/space"
"allapp/api/router/middleware"
"allapp/config"
"github.com/gofiber/fiber/v3"
)
func SetupRouters(app *fiber.App) {
api := app.Group(config.GetConf().Server.BaseUrl)
// --------------------
// auth
authRouter := api.Group("/auth")
authRouter.Post("/login/qq", auth.LoginQq)
authRouter.Post("/login/wechat", auth.LoginWechat)
// 空间操作
spaceRouter := api.Group("/space").Use(middleware.Auth())
spaceRouter.Post("/create", space.CreateSpace)
spaceRouter.Post("/list", space.ListUserSpaces)
// authGroup.Get("/user/profile", user.GetProfile)
// spaceGroup.Get("/space/info", space.GetInfo)
}