xy_sh-20260724115439/xy_sh/internal/router/router.go

25 lines
498 B
Go

package router
import (
"github.com/gofiber/fiber/v2"
"xy_sh/internal/config"
"xy_sh/internal/middleware"
"xy_sh/internal/service"
)
// SetupRouter 设置路由
func SetupRouter(cfg *config.Config) *fiber.App {
app := fiber.New()
svc := service.NewService(cfg)
api := app.Group("/api", middleware.VerifySign(cfg))
{
api.Post("/order", svc.Order)
api.Post("/query", svc.Query)
api.Post("/wechat/recharge", svc.WechatRecharge)
api.Post("/callback", svc.Callback)
}
return app
}