feat(*): go 后端项目脚手架
This commit is contained in:
25
internal/api/api.go
Normal file
25
internal/api/api.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
swaggerfiles "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
docs "github.com/zhilv666/navsite/docs"
|
||||
"github.com/zhilv666/navsite/internal/api/handler"
|
||||
"github.com/zhilv666/navsite/internal/model"
|
||||
)
|
||||
|
||||
func RegisterRouter(r *gin.Engine) {
|
||||
model.Init()
|
||||
docs.SwaggerInfo.BasePath = "/"
|
||||
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
|
||||
|
||||
v1 := r.Group("/api/v1")
|
||||
{
|
||||
handler.RegisterRouterAuth(v1.Group("/auth"))
|
||||
handler.RegisterRouterUser(v1.Group("/user"))
|
||||
handler.RegisterRouterCateage(v1.Group("/cateage"))
|
||||
v1.GET("/proxy", handler.Proxy)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user