1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- package init_serve
- import (
- "github.com/gin-gonic/gin"
- "github.com/swaggo/files"
- "github.com/swaggo/gin-swagger"
- _ "hongze/hongze_yb/docs"
- "hongze/hongze_yb/global"
- "hongze/hongze_yb/middleware"
- "hongze/hongze_yb/routers"
- "net/http"
- )
- func InitRouter() (r *gin.Engine) {
-
- gin.SetMode(global.CONFIG.Serve.RunMode)
-
- r = gin.Default()
- r.Use(middleware.Cors())
-
- r.Use(middleware.Recover())
-
- r.Use(middleware.Common())
-
- r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
-
-
- r.GET("/ping", func(c *gin.Context) {
- c.JSON(200, gin.H{
- "message": "pong",
- })
- })
- routers.InitTest(r)
-
- routers.InitWechat(r)
-
- routers.InitActivity(r)
-
- routers.InitUser(r)
-
- routers.InitPublic(r)
-
- routers.InitResearchReport(r)
-
- routers.InitChart(r)
-
- routers.InitCompany(r)
-
- routers.InitPurchase(r)
-
- routers.InitReport(r)
-
- routers.InitCommunity(r)
-
- r.StaticFS("/static", http.Dir("./static"))
-
- routers.InitLike(r)
-
- routers.InitComment(r)
-
- routers.InitMessage(r)
-
- routers.InitPc(r)
-
- routers.InitPriceDriven(r)
-
- routers.InitSandbox(r)
-
- routers.InitVoiceBroadcast(r)
-
- routers.InitRoad(r)
-
- routers.InitCollection(r)
-
- routers.InitBulletChat(r)
-
- routers.InitMyChart(r)
-
- routers.InitTradeAnalysis(r)
-
- routers.InitFeCalendar(r)
-
- routers.InitEdbInfo(r)
- return
- }
|