package activity import ( "zhiyuan/controllers/activity/one" "zhiyuan/controllers/aftersale/customer" "zhiyuan/middlewares" "github.com/gin-gonic/gin" ) func InitOneRouters(r *gin.Engine, router *gin.RouterGroup) { staticPath := "public/activity/one/" r.Static("/activity/one/static", staticPath+"static") r.StaticFile("/activity/one", staticPath+"index.html") r.StaticFile("/activity/one/favicon.ico", staticPath+"favicon.ico") staticPathTwo := "public/activity/two/" r.Static("/activity/two/static", staticPathTwo+"static") r.StaticFile("/activity/two", staticPathTwo+"index.html") r.StaticFile("/activity/two/favicon.ico", staticPathTwo+"favicon.ico") staticPathThree := "public/activity/three/" r.Static("/activity/three/static", staticPathThree+"static") r.StaticFile("/activity/three", staticPathThree+"index.html") r.StaticFile("/activity/three/favicon.ico", staticPathThree+"favicon.ico") staticPathYear := "public/activity/year2022/" r.Static("/activity/year2022/static", staticPathYear+"static") r.StaticFile("/activity/year2022", staticPathYear+"index.html") r.StaticFile("/activity/year2022/favicon.ico", staticPathYear+"favicon.ico") staticPathFour := "public/activity/four/" r.Static("/activity/four/static", staticPathFour+"static") r.StaticFile("/activity/four", staticPathFour+"index.html") r.StaticFile("/activity/four/favicon.ico", staticPathFour+"favicon.ico") r.Static("/activity/raffle", "public/activity/raffle/") router = router.Group("/one") router.POST("/login", one.Login) router.POST("/send_verify_code", customer.SendVerifyCode) router.GET("/refs/:ref_id", one.RefInfo) router.Use(middlewares.ActivityAuth("one")) { router.POST("/bms", one.BmAdd) router.GET("/info", one.Info) router.PUT("/info", customer.InfoEdit) router.POST("/logout", customer.Logout) } }