1
This commit is contained in:
parent
57f39bfd53
commit
b3e10ff433
5
server/marketserver/api/v1/gold_bullion/enter.go
Normal file
5
server/marketserver/api/v1/gold_bullion/enter.go
Normal file
@ -0,0 +1,5 @@
|
||||
package gold_bullon
|
||||
|
||||
type ApiGroup struct {
|
||||
GoldBullionApi
|
||||
}
|
19
server/marketserver/api/v1/gold_bullion/gold_bullion.go
Normal file
19
server/marketserver/api/v1/gold_bullion/gold_bullion.go
Normal file
@ -0,0 +1,19 @@
|
||||
package gold_bullion
|
||||
|
||||
import (
|
||||
"q5"
|
||||
"f5"
|
||||
"main/constant"
|
||||
"main/common"
|
||||
"fmt"
|
||||
"strings"
|
||||
. "main/global"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type GoldBulloinApi struct {
|
||||
|
||||
}
|
||||
|
||||
func (this *GoldBulloinApi) Use(c *gin.Context) {
|
||||
}
|
5
server/marketserver/api/v1/hero/enter.go
Normal file
5
server/marketserver/api/v1/hero/enter.go
Normal file
@ -0,0 +1,5 @@
|
||||
package hero
|
||||
|
||||
type ApiGroup struct {
|
||||
HeroApi
|
||||
}
|
19
server/marketserver/api/v1/hero/hero.go
Normal file
19
server/marketserver/api/v1/hero/hero.go
Normal file
@ -0,0 +1,19 @@
|
||||
package hero
|
||||
|
||||
import (
|
||||
"q5"
|
||||
"f5"
|
||||
"main/constant"
|
||||
"main/common"
|
||||
"fmt"
|
||||
"strings"
|
||||
. "main/global"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type HeroApi struct {
|
||||
|
||||
}
|
||||
|
||||
func (this *HeroApi) Use(c *gin.Context) {
|
||||
}
|
5
server/marketserver/api/v1/shopcart/enter.go
Normal file
5
server/marketserver/api/v1/shopcart/enter.go
Normal file
@ -0,0 +1,5 @@
|
||||
package shopcart
|
||||
|
||||
type ApiGroup struct {
|
||||
ShopCartApi
|
||||
}
|
28
server/marketserver/api/v1/shopcart/shopcart.go
Normal file
28
server/marketserver/api/v1/shopcart/shopcart.go
Normal file
@ -0,0 +1,28 @@
|
||||
package shopcart
|
||||
|
||||
import (
|
||||
"q5"
|
||||
"f5"
|
||||
"main/constant"
|
||||
"main/common"
|
||||
"fmt"
|
||||
"strings"
|
||||
. "main/global"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type ShopCartApi struct {
|
||||
|
||||
}
|
||||
|
||||
func (this *ShopCartApi) ShopCartList(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (this *ShopCartApi) ShopCartAdd(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (this *ShopCartApi) ShopCartDel(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (this *ShopCartApi) ShopCartClear(c *gin.Context) {
|
||||
}
|
24
server/marketserver/middleware/cors.go
Normal file
24
server/marketserver/middleware/cors.go
Normal file
@ -0,0 +1,24 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
// "net/http"
|
||||
)
|
||||
|
||||
func Cors() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
method := c.Request.Method
|
||||
//origin := c.Request.Header.Get("Origin")
|
||||
//if origin != "" {
|
||||
//c.Header("Access-Control-Allow-Origin", "*") // 可将将 * 替换为指定的域名
|
||||
c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE, UPDATE")
|
||||
c.Header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization")
|
||||
c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Cache-Control, Content-Language, Content-Type")
|
||||
c.Header("Access-Control-Allow-Credentials", "true")
|
||||
//}
|
||||
if method == "OPTIONS" {
|
||||
c.AbortWithStatus(200)
|
||||
}
|
||||
c.Next()
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user