router.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package router
  2. import (
  3. tingyun_gin "github.com/TingYunAPM/go/framework/gin"
  4. "github.com/gin-gonic/gin"
  5. ginSwagger "github.com/swaggo/gin-swagger"
  6. "github.com/swaggo/gin-swagger/swaggerFiles"
  7. "gopkg"
  8. "lzyd-user-api/common"
  9. "lzyd-user-api/controllers"
  10. _ "lzyd-user-api/docs" // docs is generated by Swag CLI, you have to import it.
  11. "lzyd-user-api/utils"
  12. )
  13. func InitRouter() *tingyun_gin.WrapEngine {
  14. router := tingyun_gin.Default()
  15. router.Use(gin.Recovery())
  16. router.Use(gopkg.CORSMiddleware())
  17. router.Use(utils.ValidSign(common.SystemInfo.Valid))
  18. router.Use(utils.ValidHeaderParams())
  19. // use ginSwagger middleware to
  20. router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
  21. /// App
  22. //router.GET("/app/launch", controllers.GetAppLaunch)
  23. /// Passport
  24. //router.POST("passport/register", controllers.Register)
  25. //router.POST("passport/login", controllers.LoginWithMobileAndPass)
  26. //router.POST("passport/wechatLogin", controllers.WechatLogin)
  27. router.POST("passport/quickLogin", controllers.QuickLogin)
  28. /// Customer
  29. router.GET("customer/getInfo", controllers.GetCustomerInfo)
  30. router.POST("customer/getBlacklist", controllers.GetBlacklist)
  31. router.POST("customer/updateProfile", controllers.UpdateProfile)
  32. router.GET("customer/order", controllers.GetCompetitionOrder)
  33. router.GET("customer/qualifying", controllers.GetQualifying)
  34. router.POST("customer/uploadBase64", controllers.UploadBase64)
  35. //router.POST("customer/editCard", controllers.EditCard)
  36. //router.POST("customer/updatePwd", controllers.UpdatePwd)
  37. /// Sms
  38. router.GET("sms/get", controllers.GetSms)
  39. router.POST("sms/remind", controllers.SendRemindSms)
  40. /// Area
  41. router.GET("/area/getArea", controllers.GetArea)
  42. /// mine
  43. router.GET("/cert/list", controllers.GetCertList)
  44. router.GET("/cert/userList", controllers.GetUserCertList)
  45. router.GET("/medal/list", controllers.GetMedalList)
  46. router.GET("/medal/userList", controllers.GetUserMedalList)
  47. return router
  48. }