router.go 554 B

123456789101112131415161718
  1. package router
  2. import (
  3. "file_upload/backend/app/controller"
  4. middleware "file_upload/backend/app/middlewares"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func FileInitRouter(engine *gin.Engine) {
  8. group := engine.Group("/api")
  9. group.Use(middleware.Cors())
  10. group.DELETE("/template", controller.DeleteTemplate)
  11. group.POST("/saveTemplate", controller.SaveTemplate)
  12. group.POST("/template", controller.TemplateItem)
  13. group.GET("/template", controller.GetTemplate)
  14. group.GET("/templates", controller.GetTemplates)
  15. group.GET("/search", controller.SearchTemplate)
  16. }