forked from ebhomengo/niki
35 lines
661 B
Go
35 lines
661 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/1", s.Handler.HealthCheck)
|
|
|
|
productGroup := r.Group("/v1/products")
|
|
|
|
productGroup.GET("", s.Handler.getProductList)
|
|
|
|
}
|