You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
849 B

  1. package router
  2. import (
  3. "gin-vue-admin/api/v1"
  4. "gin-vue-admin/middleware"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func Init{{.StructName}}Router(Router *gin.RouterGroup) {
  8. {{.StructName}}Router := Router.Group("{{.Abbreviation}}").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
  9. {
  10. {{.StructName}}Router.POST("create{{.StructName}}", v1.Create{{.StructName}}) // 新建{{.StructName}}
  11. {{.StructName}}Router.DELETE("delete{{.StructName}}", v1.Delete{{.StructName}}) //删除{{.StructName}}
  12. {{.StructName}}Router.PUT("update{{.StructName}}", v1.Update{{.StructName}}) //更新{{.StructName}}
  13. {{.StructName}}Router.GET("find{{.StructName}}", v1.Find{{.StructName}}) // 根据ID获取{{.StructName}}
  14. {{.StructName}}Router.GET("get{{.StructName}}List", v1.Get{{.StructName}}List) //获取{{.StructName}}列表
  15. }
  16. }