niki/productapp/delivery/http/server.go

35 lines
659 B
Go

package http
import (
httpserver "git.gocasts.ir/ebhomengo/niki/delivery/http_server"
"git.gocasts.ir/ebhomengo/niki/productapp/service/product"
)
type Server struct {
HTTPServer *httpserver.Server
Handler *Handler
}
func NewServer(httpserver *httpserver.Server, productSvc product.Service) *Server {
return &Server{
HTTPServer: httpserver,
Handler: NewHandler(productSvc),
}
}
func (s *Server) Serve() {
}
func (s *Server) Stop() {}
func (s *Server) RegisterRoutes() {
r := s.HTTPServer.Router
r.GET("health-check", s.Handler.HealthCheck)
productGroup := r.Group("/v1/products")
productGroup.GET("", s.Handler.getProductList)
}