package router import ( "gas-cylinder-api/app/admin/controller" "github.com/gin-gonic/gin" ) func init() { appletRouterCheck = append(appletRouterCheck, registerAddressRouter) } // 需认证的路由代码 func registerAddressRouter(v1 *gin.RouterGroup, authMiddleware gin.HandlerFunc) { cont := controller.AddressController{} r := v1.Group("/address").Use(authMiddleware) { r.GET("", cont.GetPage) r.GET("/:id", cont.Get) r.POST("", cont.Insert) r.PUT("", cont.Update) r.DELETE("", cont.Delete) } }