添加文件: xy_sh/internal/router/router.go

This commit is contained in:
renzhiyuan 2026-07-24 11:54:44 +08:00
parent 3cfaaa3ef9
commit 2cc5060cac
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
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
}