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

26 lines
396 B

package vend
import (
"github.com/gin-gonic/gin"
"net/http"
"recook/internal/back"
"recook/internal/gateway/vend"
)
func Service() http.Handler {
e := gin.Default()
e.Use(vend.CORS())
e.NoRoute(func(c *gin.Context) {
back.Fail(c, "请求不存在")
})
e.NoMethod(func(c *gin.Context) {
back.Fail(c, "方法不支持")
})
v1 := e.Group("/v1")
vend.SetupRouter(v1)
return e
}