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.
42 lines
811 B
42 lines
811 B
package router
|
|
|
|
import (
|
|
"base/app/lib/bean"
|
|
"base/app/router/app"
|
|
"base/app/router/middleware"
|
|
"base/app/router/web"
|
|
"base/app/router/wxapp"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// SetRouter @Title 配置路由
|
|
func SetRouter(router *gin.Engine) {
|
|
// 跨域
|
|
router.Use(middleware.Cors)
|
|
// 404
|
|
router.NoRoute(func(c *gin.Context) {
|
|
bean.Response.ResultFail(c, 20000, "接口不存在")
|
|
})
|
|
// app
|
|
appRouter := router.Group("app")
|
|
{
|
|
// 经纪人
|
|
app.BrokerRouter(appRouter.Group("broker"))
|
|
}
|
|
// web
|
|
webRouter := router.Group("web")
|
|
{
|
|
// 后端接口
|
|
web.ManageRouter(webRouter.Group("manage"))
|
|
}
|
|
// 微信小程序
|
|
wxappRouter := router.Group("wxapp")
|
|
{
|
|
// 用户端
|
|
wxapp.CustomerRouter(wxappRouter.Group("customer"))
|
|
}
|
|
// 回调接口
|
|
callbackRouter(router.Group("callback"))
|
|
|
|
}
|