Merge branch 'develop' into feature/ISSUE-224-product-app

This commit is contained in:
hossein 2026-03-25 06:59:03 +00:00
commit 302539360d
30 changed files with 147 additions and 0 deletions

1
patientapp/app.go Normal file
View File

@ -0,0 +1 @@
package patientapp

View File

View File

1
paymentapp/app.go Normal file
View File

@ -0,0 +1 @@
package paymentapp

1
paymentapp/config.go Normal file
View File

@ -0,0 +1 @@
package paymentapp

View File

@ -0,0 +1,15 @@
package http
type Handler struct {
}
func NewHandler(userService UserService) *Handler {
return &Handler{
}
}
func (h *Handler) HealthCheck(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("OK"))
}

View File

@ -0,0 +1,5 @@
package http
func (s *Server) registerRoutes() {
s.httpServer.GET("/health", s.handler.HealthCheck)
}

View File

@ -0,0 +1,22 @@
package http
type Server struct {
httpServer *httpserver.Server
handler *Handler
}
func NewServer(httpServer *httpserver.Server, handler *Handler) *Server {
return &Server{
httpServer: httpServer,
handler: handler,
}
}
func (s *Server) Serve() error {
s.registerRoutes()
return s.httpServer.Start()
}
func (s *Server) Stop() error {
return s.httpServer.Stop()
}

View File

@ -0,0 +1 @@
package service

View File

@ -0,0 +1 @@
package service

View File

@ -0,0 +1 @@
package service

View File

@ -0,0 +1 @@
package service

1
purchaseapp/app.go Normal file
View File

@ -0,0 +1 @@
package purchaseapp

4
purchaseapp/config.go Normal file
View File

@ -0,0 +1,4 @@
package purchaseapp
type Config struct {
}

View File

@ -0,0 +1,10 @@
package http
import (
"github.com/labstack/echo/v4"
"net/http"
)
func (s Server) healthCheck(c echo.Context) error {
return c.JSON(http.StatusOK, "everything is good!")
}

View File

@ -0,0 +1,8 @@
package invoice
type Handler struct {
}
func New() *Handler {
return &Handler{}
}

View File

@ -0,0 +1,7 @@
package invoice
import "github.com/labstack/echo/v4"
func (h Handler) SetRoutes(e *echo.Echo) {
}

View File

@ -0,0 +1,7 @@
package order
type Handler struct{}
func New() *Handler {
return &Handler{}
}

View File

@ -0,0 +1,7 @@
package order
import "github.com/labstack/echo/v4"
func (h Handler) SetRoutes(e *echo.Echo) {
}

View File

@ -0,0 +1,33 @@
package http
import (
httpserver "git.gocasts.ir/ebhomengo/niki/delivery/http_server"
"git.gocasts.ir/ebhomengo/niki/purchaseapp/delivery/http/invoice"
"git.gocasts.ir/ebhomengo/niki/purchaseapp/delivery/http/order"
)
type Server struct {
HTTPServer *httpserver.Server
OrderHandler *order.Handler
InvoiceHandler *invoice.Handler
}
func New(httpserver *httpserver.Server) *Server {
return &Server{
HTTPServer: httpserver,
OrderHandler: order.New(),
InvoiceHandler: invoice.New(),
}
}
func (s *Server) Serve() {
s.RegisterRoutes()
}
func (s *Server) Stop() {}
func (s *Server) RegisterRoutes() {
s.HTTPServer.Router.GET("/purchase/health-check", s.healthCheck)
s.OrderHandler.SetRoutes(s.HTTPServer.Router)
s.InvoiceHandler.SetRoutes(s.HTTPServer.Router)
}

View File

@ -0,0 +1,4 @@
package entity
type Invoice struct {
}

View File

@ -0,0 +1,4 @@
package entity
type Order struct {
}

View File

@ -0,0 +1 @@
package mysql

View File

@ -0,0 +1 @@
package invoice

View File

@ -0,0 +1,4 @@
package invoice
type Service struct {
}

View File

@ -0,0 +1 @@
package invoice

View File

@ -0,0 +1 @@
package order

View File

@ -0,0 +1,4 @@
package order
type Service struct {
}

View File

@ -0,0 +1 @@
package order