api_router.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package router
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "icloudapp.cn/tools/controller"
  5. "icloudapp.cn/tools/middleware"
  6. )
  7. func SetupApiRouters(r *gin.Engine) {
  8. v1 := r.Group("/api/v1")
  9. v1.Use(middleware.AuthMiddleware())
  10. /*
  11. v1.GET("pipeline/:id", controller.GetPipelineDetailHandler)
  12. v1.GET("pipeline", controller.GetPipelineListHandler)
  13. v1.POST("pipeline", controller.CreatePipelineHandler)
  14. v1.PUT("pipeline", controller.UpdatePipelineHandler)
  15. v1.DELETE("pipeline/:id", controller.DeletePipelineHandler)
  16. */
  17. r.GET("/index", controller.Index)
  18. user := r.Group("/api/user")
  19. user.GET("/info", controller.Info)
  20. user.GET("/login", controller.Login)
  21. user.POST("/login", controller.Login)
  22. user.GET("/register", controller.Register)
  23. user.POST("/register", controller.Register)
  24. poster := r.Group("/api/poster")
  25. poster.GET("/info", controller.PosterInfo)
  26. poster.GET("/image", controller.Image)
  27. poster.GET("/cut", controller.Cut)
  28. poster.POST("/save", controller.SavePoster)
  29. poster.GET("/preview", controller.Preview)
  30. poster.GET("/draw", controller.DrawImage)
  31. }