forked from ebhomengo/niki
Compare commits
No commits in common. "salesReport-mosayyebnezhad" and "develop" have entirely different histories.
salesRepor
...
develop
|
|
@ -1,8 +0,0 @@
|
|||
package salesreportapp
|
||||
|
||||
import "net/http"
|
||||
|
||||
type Application struct {
|
||||
Config Config
|
||||
HTTPServer *http.Server
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
package salesreportapp
|
||||
|
||||
type Config struct {
|
||||
// add config here ...
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type Handler struct{}
|
||||
|
||||
func NewHandler() *Handler {
|
||||
return &Handler{}
|
||||
}
|
||||
|
||||
func (h Handler) HealthCheck(c echo.Context) error {
|
||||
return c.JSON(http.StatusOK, map[string]string{"status": "ok"})
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func (s *Server) healthCheck(c echo.Context) error {
|
||||
return c.String(http.StatusOK, "OK")
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
package http
|
||||
|
||||
import httpserver "git.gocasts.ir/ebhomengo/niki/delivery/http_server"
|
||||
|
||||
type Server struct {
|
||||
HTTPServer *httpserver.Server
|
||||
Handler *Handler
|
||||
}
|
||||
|
||||
func NewServer(httpserver *httpserver.Server) *Server {
|
||||
return &Server{
|
||||
HTTPServer: httpserver,
|
||||
Handler: NewHandler(),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) Serve() {
|
||||
s.RegisterRoutes()
|
||||
}
|
||||
|
||||
func (s *Server) Stop() {}
|
||||
|
||||
func (s *Server) RegisterRoutes() {
|
||||
s.HTTPServer.Router.GET("", s.healthCheck)
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
package database
|
||||
|
||||
import "git.gocasts.ir/ebhomengo/niki/repository/mysql"
|
||||
|
||||
type DB struct {
|
||||
conn *mysql.DB
|
||||
}
|
||||
|
||||
func New(conn *mysql.DB) *DB {
|
||||
return &DB{
|
||||
conn: conn,
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue