package service import ( "net/http" "git.ostiwe.com/ostiwe-com/status/modules/jwt" "git.ostiwe.com/ostiwe-com/status/repository" "git.ostiwe.com/ostiwe-com/status/router/controller" "git.ostiwe.com/ostiwe-com/status/router/midlleware" "github.com/gin-gonic/gin" ) type GetServices struct { serviceRepository repository.Service } func (g *GetServices) New() controller.Controller { return &GetServices{ serviceRepository: repository.NewServiceRepository(), } } func (g *GetServices) Handler() gin.HandlerFunc { return func(c *gin.Context) { processGetServicesHandler(c, false, g.serviceRepository) } } func (g *GetServices) Method() string { return http.MethodGet } func (g *GetServices) Path() string { return "/api/v1/services" } func (g *GetServices) Middlewares() []gin.HandlerFunc { return []gin.HandlerFunc{ jwt.AuthMiddleware.MiddlewareFunc(), midlleware.SetUserFromJWT(), } }