package routers import ( "net/http" android "application/api/android" pc "application/api/pc" "github.com/gin-gonic/gin" ) // InitRouter 初始化路由信息 func InitRouter() *gin.Engine { r := gin.Default() api := r.Group("/api") { api.GET("/android/hello", android.Hello) api.POST("/android/hello", android.Hello) api.GET("/pc/hello", pc.Hello) api.POST("/pc/hello", pc.Hello) } // 静态文件路由 r.StaticFS("/web", http.Dir("./dist/")) return r }