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.

49 lines
3.0 KiB
Go

package route
import (
"github.com/gin-gonic/gin"
"gold-shop/api/h5"
"gold-shop/middleware"
"gold-shop/utils/result"
)
func h5RouteInit(r *gin.Engine) {
h5Group := r.Group("/h5")
h5Group.Use(middleware.CorsMiddleware("h5"))
h5Group.Match([]string{"POST", "OPTIONS"}, "/login", result.Json(h5.Login))
h5Group.Match([]string{"POST", "OPTIONS"}, "/register", result.Json(h5.Register))
h5Group.Match([]string{"GET", "OPTIONS"}, "/get-product-info", result.Json(h5.GetProductInfo))
h5Group.Match([]string{"POST", "OPTIONS"}, "/transfer-pay-notify", h5.TransferPayNotify)
h5Group.Match([]string{"POST", "OPTIONS"}, "/payment-notify", h5.PaymentNotify)
h5Group.Match([]string{"POST", "OPTIONS"}, "/binding-pay-notify", h5.BindingPayNotify)
h5Group.Match([]string{"GET", "OPTIONS"}, "/test-gateway-pay", h5.GatewayPay)
h5Group.Match([]string{"GET", "OPTIONS"}, "/gateway-pay", h5.GatewayPay)
h5Group.Match([]string{"GET", "OPTIONS"}, "/union-pay", h5.UnionPay)
h5Group.Match([]string{"POST", "GET", "OPTIONS"}, "/gateway-pay-ret", h5.GatewayPayRet)
authGroup := h5Group.Group("")
authGroup.Use(middleware.JwtMiddleware("user"))
{
authGroup.Match([]string{"GET", "OPTIONS"}, "/ping", result.Json(h5.Index))
authGroup.Match([]string{"GET", "OPTIONS"}, "/error", result.Json(h5.Error))
authGroup.Match([]string{"GET", "OPTIONS"}, "/get-user-info", result.Json(h5.GetUserInfo))
authGroup.Match([]string{"POST", "OPTIONS"}, "/order", result.Json(h5.Order))
authGroup.Match([]string{"POST", "OPTIONS"}, "/modify-password", result.Json(h5.ModifyPassword))
authGroup.Match([]string{"POST", "OPTIONS"}, "/payment", result.Json(h5.Payment))
authGroup.Match([]string{"GET", "OPTIONS"}, "/get-wx-open-id", result.Json(h5.GetWxOpenId))
authGroup.Match([]string{"GET", "OPTIONS"}, "/get-wx-auth-url", result.Json(h5.GetWxAuthUrl))
authGroup.Match([]string{"GET", "OPTIONS"}, "/get-ali-open-id", result.Json(h5.GetAliOpenId))
authGroup.Match([]string{"GET", "OPTIONS"}, "/get-orders", result.Json(h5.GetOrders))
authGroup.Match([]string{"GET", "OPTIONS"}, "/get-payments", result.Json(h5.GetPayments))
authGroup.Match([]string{"GET", "OPTIONS"}, "/get-user-data", result.Json(h5.GetUserData))
authGroup.Match([]string{"POST", "OPTIONS"}, "/save-alipay-account", result.Json(h5.SaveAlipayAccount))
authGroup.Match([]string{"POST", "OPTIONS"}, "/tl-binding-apply", result.Json(h5.TlBindingApply))
authGroup.Match([]string{"POST", "OPTIONS"}, "/tl-binding-confirm", result.Json(h5.TlBindingConfirm))
authGroup.Match([]string{"GET", "OPTIONS"}, "/get-user-bank-card", result.Json(h5.GetUserBankCard))
authGroup.Match([]string{"POST", "OPTIONS"}, "/binding-pay-confirm", result.Json(h5.BindingPayConfirm))
authGroup.Match([]string{"POST", "OPTIONS"}, "/binding-pay-sms", result.Json(h5.BindingPaySms))
authGroup.Match([]string{"POST", "OPTIONS"}, "/gateway-pay-apply", result.Json(h5.GatewayPayApply))
authGroup.Match([]string{"POST", "OPTIONS"}, "/bank-card-unbind", result.Json(h5.BankCardUnbind))
}
}