You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.0 KiB
Go

package route
import (
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"gold-shop/api"
"gold-shop/middleware"
"gold-shop/utils"
)
func h5RouteInit(r *gin.Engine) {
r.Use(cors.Default())
h5Group := r.Group("/h5")
h5Group.Use(cors.Default())
h5Group.POST("/login", utils.JsonHandler(api.Login))
h5Group.POST("/register", utils.JsonHandler(api.Register))
h5Group.GET("/get-product-info", utils.JsonHandler(api.GetProductInfo))
authGroup := h5Group.Group("")
authGroup.Use(middleware.JwtMiddleware())
{
authGroup.GET("/ping", utils.JsonHandler(api.Index))
authGroup.GET("/error", utils.JsonHandler(api.Error))
authGroup.GET("/get-user-info", utils.JsonHandler(api.GetUserInfo))
authGroup.GET("/order", utils.JsonHandler(api.Order))
authGroup.GET("/modify-password", utils.JsonHandler(api.ModifyPassword))
authGroup.GET("/payment", utils.JsonHandler(api.Payment))
authGroup.GET("/get-wx-open-id", utils.JsonHandler(api.GetWxOpenId))
authGroup.GET("/get-wx-auth-url", utils.JsonHandler(api.GetWxAuthUrl))
}
}