123456789101112131415161718192021222324252627282930313233343536 |
- package router
- import (
- "github.com/gin-gonic/gin"
- "icloudapp.cn/tools/controller"
- "icloudapp.cn/tools/middleware"
- )
- func SetupApiRouters(r *gin.Engine) {
- v1 := r.Group("/api/v1")
- v1.Use(middleware.AuthMiddleware())
-
- r.GET("/index", controller.Index)
- user := r.Group("/api/user")
- user.GET("/info", controller.Info)
- user.GET("/login", controller.Login)
- user.POST("/login", controller.Login)
- user.GET("/register", controller.Register)
- user.POST("/register", controller.Register)
- poster := r.Group("/api/poster")
- poster.GET("/info", controller.PosterInfo)
- poster.GET("/image", controller.Image)
- poster.GET("/cut", controller.Cut)
- poster.POST("/save", controller.SavePoster)
- poster.GET("/preview", controller.Preview)
- poster.GET("/draw", controller.DrawImage)
- }
|