This commit is contained in:
lu.bai
2022-11-24 22:47:24 +08:00
parent f6a161d52f
commit 71d0135d6f
3213 changed files with 583576 additions and 216 deletions

View File

@@ -1,12 +0,0 @@
http_port = 9001
[logger]
level = "DEBUG"
method = "CONSOLE"
track_line = true
[database]
url = "mongodb://mongo:27017"
[mq]
nats_url = "nats://nats1:4222,nats://nats2:4222,nats://nats3:4222"

View File

@@ -1,37 +0,0 @@
package main
import (
"hk4e/common/config"
"hk4e/gm/controller"
"hk4e/logger"
"os"
"os/signal"
"syscall"
"time"
)
func main() {
filePath := "./application.toml"
config.InitConfig(filePath)
logger.InitLogger("gm")
logger.LOG.Info("gm start")
_ = controller.NewController()
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
for {
s := <-c
logger.LOG.Info("get a signal %s", s.String())
switch s {
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
logger.LOG.Info("gm exit")
time.Sleep(time.Second)
return
case syscall.SIGHUP:
default:
return
}
}
}

View File

@@ -1,11 +1,13 @@
package controller
import (
"github.com/gin-gonic/gin"
"hk4e/common/config"
"hk4e/logger"
"net/http"
"strconv"
"hk4e/common/config"
"hk4e/pkg/logger"
"github.com/gin-gonic/gin"
)
type Controller struct {

View File

@@ -1,8 +1,9 @@
package controller
import (
"hk4e/pkg/logger"
"github.com/gin-gonic/gin"
"hk4e/logger"
)
type GmCmdReq struct {