Merge pull request 'Add staffapp' (#244) from feature/staffapp into develop

Reviewed-on: ebhomengo/niki#244
Reviewed-by: hossein <h.nazari1990@gmail.com>
This commit is contained in:
hossein 2026-03-25 07:01:58 +00:00
commit 71f0e342e4
11 changed files with 92 additions and 0 deletions

8
staffapp/app.go Normal file
View File

@ -0,0 +1,8 @@
package staffapp
import "net/http"
type Application struct {
Config Config
HTTPServer *http.Server
}

15
staffapp/cmd/main.go Normal file
View File

@ -0,0 +1,15 @@
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
fmt.Println(" Staffapp Server Starting...")
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Staffapp OK!")
})
log.Fatal(http.ListenAndServe(":8080", nil))
}

11
staffapp/config.go Normal file
View File

@ -0,0 +1,11 @@
package staffapp
type Config struct {
// HTTP server config
// Database config
// Logger config
// Service config
}

View File

@ -0,0 +1,17 @@
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"})
}

View File

@ -0,0 +1 @@
package http

View File

@ -0,0 +1,23 @@
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() {
}
func (s *Server) Stop() {}
func (s *Server) RegisterRoutes() {}

View File

@ -0,0 +1,13 @@
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,
}
}

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