diff --git a/xy_sh/internal/router/router.go b/xy_sh/internal/router/router.go new file mode 100644 index 0000000..bc7d068 --- /dev/null +++ b/xy_sh/internal/router/router.go @@ -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 +} \ No newline at end of file