1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package router
- import (
- tingyun_gin "github.com/TingYunAPM/go/framework/gin"
- "github.com/gin-gonic/gin"
- ginSwagger "github.com/swaggo/gin-swagger"
- "github.com/swaggo/gin-swagger/swaggerFiles"
- "gopkg"
- "lzyd-user-api/common"
- "lzyd-user-api/controllers"
- _ "lzyd-user-api/docs" // docs is generated by Swag CLI, you have to import it.
- "lzyd-user-api/utils"
- )
- func InitRouter() *tingyun_gin.WrapEngine {
- router := tingyun_gin.Default()
- router.Use(gin.Recovery())
- router.Use(gopkg.CORSMiddleware())
- router.Use(utils.ValidSign(common.SystemInfo.Valid))
- router.Use(utils.ValidHeaderParams())
- // use ginSwagger middleware to
- router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
- /// App
- //router.GET("/app/launch", controllers.GetAppLaunch)
- /// Passport
- //router.POST("passport/register", controllers.Register)
- //router.POST("passport/login", controllers.LoginWithMobileAndPass)
- //router.POST("passport/wechatLogin", controllers.WechatLogin)
- router.POST("passport/quickLogin", controllers.QuickLogin)
- /// Customer
- router.GET("customer/getInfo", controllers.GetCustomerInfo)
- router.POST("customer/getBlacklist", controllers.GetBlacklist)
- router.POST("customer/updateProfile", controllers.UpdateProfile)
- router.GET("customer/order", controllers.GetCompetitionOrder)
- router.GET("customer/qualifying", controllers.GetQualifying)
- router.POST("customer/uploadBase64", controllers.UploadBase64)
- //router.POST("customer/editCard", controllers.EditCard)
- //router.POST("customer/updatePwd", controllers.UpdatePwd)
- /// Sms
- router.GET("sms/get", controllers.GetSms)
- router.POST("sms/remind", controllers.SendRemindSms)
- /// Area
- router.GET("/area/getArea", controllers.GetArea)
- /// mine
- router.GET("/cert/list", controllers.GetCertList)
- router.GET("/cert/userList", controllers.GetUserCertList)
- router.GET("/medal/list", controllers.GetMedalList)
- router.GET("/medal/userList", controllers.GetUserMedalList)
- return router
- }
|