This commit is contained in:
aozhiwei 2023-09-04 19:05:23 +08:00
parent 2d5363a39c
commit 351798662a
10 changed files with 70 additions and 1 deletions

View File

@ -0,0 +1,7 @@
[
{
"instance_id": 1,
"listen_port": 8890,
"http_listen_port": 9991
}
]

View File

@ -0,0 +1,3 @@
{
"gameapi_url": "https://game2006api-test.kingsome.cn"
}

View File

@ -0,0 +1,7 @@
{
"host": "login-test.kingsome.cn",
"port": 3306,
"user": "root",
"passwd": "keji178",
"database": "frienddb_dev_1"
}

View File

@ -0,0 +1,7 @@
{
"host": "login-test.kingsome.cn",
"port": 3306,
"user": "root",
"passwd": "keji178",
"database": "gamedb2006_dev_1"
}

View File

@ -15,9 +15,11 @@ func (this *App) GetPkgName() string {
func (this *App) Init() {
f5.LoadMetaTable(mt.Table)
this.registerDataSources()
ginMgr.init()
}
func (this *App) UnInit() {
ginMgr.unInit()
}
func (this *App) Update() {

View File

@ -1,3 +1,4 @@
package main
var app = new(App)
var ginMgr = new(GinMgr)

View File

@ -0,0 +1,39 @@
package main
import (
"time"
"net/http"
"github.com/gin-gonic/gin"
"golang.org/x/sync/errgroup"
)
type GinMgr struct {
group errgroup.Group
}
func (this *GinMgr) init() {
server01 := &http.Server{
Addr: ":8080",
Handler: this.router(),
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
}
this.group.Go(func() error {
return server01.ListenAndServe()
})
}
func (this *GinMgr) unInit() {
}
func (this *GinMgr) router() http.Handler {
r := gin.New()
r.Use(gin.Recovery())
r.GET("/webapp/index.php", func(c *gin.Context) {
c.JSON(200, gin.H{
"errcode": 0,
"errmsg": "",
})
})
return r
}

View File

@ -37,6 +37,7 @@ require (
golang.org/x/arch v0.5.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect

View File

@ -88,6 +88,8 @@ golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=

View File

@ -13,7 +13,7 @@ type table struct {
var Table = f5.New(func (this* table) {
this.AdminCluster = f5.New(func (this *AdminClusterTable) {
this.FileName = "../config/imserver.cluster.json"
this.FileName = "../config/adminserver.cluster.json"
this.PrimKey = "instance_id"
});