Files
workspace/code/app/app-go/internal/router/router.go
T
2026-06-22 21:44:33 +08:00

35 lines
967 B
Go

package router
import (
"allapp-go/internal/config"
"allapp-go/internal/handle"
"allapp-go/internal/middleware"
"github.com/gofiber/fiber/v3"
)
func SetupRouter(app *fiber.App, cfg *config.Config) {
api := app.Group(cfg.App.BaseUrl)
// ==================== data ====================
data := api.Group("/data", middleware.Auth())
data.Post("/loadData", handle.LoadData)
data.Post("/loadDataBySql", handle.LoadDataBySql)
data.Post("/saveData", handle.SaveData)
data.Post("/getUniqueId", handle.GetUniqueId)
s3 := api.Group("/s3", middleware.Auth())
s3.Post("/upload", handle.S3UploadFile)
s3.Post("/delete", handle.S3DeleteFile)
// ==================== auth ====================
api.Post("/auth/login/qq", handle.LoginQq)
api.Post("/auth/login/wechat", handle.LoginWechat)
api.Post("/auth/login/test", handle.LoginTest)
bind := api.Group("/bind", middleware.Auth())
bind.Post("/qq", handle.BindQq)
bind.Post("/wechat", handle.BindWechat)
}