// Copyright 2019 github.com. All rights reserved. // Use of this source code is governed by github.com. package route import ( "net/http" "property-callback-gateway/controller/v1" "github.com/gin-gonic/gin" _ "property-callback-gateway/docs" ) func SetupRoute(engine *gin.Engine) { // 404页面 engine.NoRoute(func(c *gin.Context) { c.String(http.StatusNotFound, "Not Found") }) c := v1.NewController() // 服务健康检查 engine.GET("/ping", func(c *gin.Context) { // TODO 心跳检查 c.String(http.StatusOK, "pong") }) //engine.Use(middleware.Session("smart-site-supplier")) // version 1 apiv1 := engine.Group("/api/v1") { wx := apiv1.Group("wx") { applet := wx.Group("/applet") { applet.POST("/pay_callback", c.WxMiniPayCallback) applet.POST("/pay_callbackv3", c.WxMiniPayCallbackv3) } public := wx.Group("/public") { public.GET("", c.WxPublicIn) public.POST("", c.WxPublicCallback) } } } apisv1 := engine.Group("/apis/v1") { wx := apisv1.Group("wx") { applet := wx.Group("/applet") { applet.POST("/pay_callbackv3", c.WxMiniPayCallbackv3) } } } }