Merge branch 'develop' into feature/notification

This commit is contained in:
hossein 2026-04-08 04:54:28 +00:00
commit d564a924a5
20 changed files with 156 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,7 +1,7 @@
#vscode #vscode
.vscode .vscode
.DS_Store
# Binaries for programs and plugins # Binaries for programs and plugins
niki niki
*.exe *.exe

15
cmd/staffapp/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))
}

8
donateApp/app.go Normal file
View File

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

View File

@ -0,0 +1 @@
package donate

5
donateApp/config.go Normal file
View File

@ -0,0 +1,5 @@
package donateapp
type Config struct{
}

View File

@ -0,0 +1,8 @@
package donate_server
type Handler struct {
}
func NewHandler() Handler {
return Handler{}
}

View File

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

View File

@ -0,0 +1,16 @@
package donate_server
import (
httpserver "git.gocasts.ir/ebhomengo/niki/delivery/http_server"
"github.com/labstack/echo/v4"
)
type Server struct {
Server httpserver.Server
Handler Handler
Router *echo.Echo
}
func (s Server) Start() {
s.Handler.RegisterRoutes(s.Router)
}

View File

@ -0,0 +1,11 @@
-- +migrate Up
CREATE TABLE `donates` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `id`(`id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 84 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_persian_ci ROW_FORMAT = Dynamic;
-- +migrate Down
DROP TABLE IF EXISTS `donates`;

View File

@ -0,0 +1 @@
package mysql

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

8
salesreportapp/app.go Normal file
View File

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

5
salesreportapp/config.go Normal file
View File

@ -0,0 +1,5 @@
package salesreportapp
type Config struct {
// add config here ...
}

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,11 @@
package http
import (
"net/http"
"github.com/labstack/echo/v4"
)
func (s *Server) healthCheck(c echo.Context) error {
return c.String(http.StatusOK, "OK")
}

View File

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

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,
}
}