diff --git a/.gitignore b/.gitignore index 79c45ca..3c7a20c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ bin bat apigame.exe apigame.exe~ -*.bat \ No newline at end of file +*.bat +logs \ No newline at end of file diff --git a/conf/local.conf b/conf/local.conf index ed00f5f..b86bf0f 100644 --- a/conf/local.conf +++ b/conf/local.conf @@ -20,11 +20,14 @@ sdkdb = 8 sdkprefix = wxapi:: [log] -path = /var/logs/apigame/ +path = ./logs/ maxlines = 1000000 maxdays = 1000 rotate = true dellogger = false level = 1 +[conf] +path = ./conf/bytes + include "/conf/local.conf" \ No newline at end of file diff --git a/conf/pre.conf b/conf/pre.conf index 51418a3..074b2f9 100644 --- a/conf/pre.conf +++ b/conf/pre.conf @@ -27,5 +27,7 @@ rotate = true dellogger = false level = 8 +[conf] +path = /home/etc/apigame/bytes include "conf/pre.conf" \ No newline at end of file diff --git a/conf/prod.conf b/conf/prod.conf index 0d74735..9100b07 100644 --- a/conf/prod.conf +++ b/conf/prod.conf @@ -28,5 +28,7 @@ rotate = true dellogger = false level = 5 +[conf] +path = /goexec/exec/apigame/bytes include "conf/prod.conf" \ No newline at end of file diff --git a/configs/external.go b/configs/external.go index fc85cc8..1cac80a 100644 --- a/configs/external.go +++ b/configs/external.go @@ -2,12 +2,14 @@ package configs import ( "fmt" + "github.com/astaxie/beego" "reflect" ) func Init() bool { fmt.Println("configs Init") - Initial("./conf/bytes", "ID") + conf, _ := beego.AppConfig.GetSection("conf") + Initial(conf["path"], "ID") //InitExt() return true diff --git a/controllers/demo.go b/controllers/demo.go index f9c068f..64bd927 100644 --- a/controllers/demo.go +++ b/controllers/demo.go @@ -4,7 +4,6 @@ import ( "apigame/configs" "apigame/models" "apigame/service/code-msg" - "apigame/util/zjson" "encoding/json" "fmt" ) @@ -49,7 +48,8 @@ func (c *DemoController) Demo() { // conf := dt.(*configs.AbTestCfg) // fmt.Println(conf) //} - fmt.Println("cs", zjson.Str(cs)) + //fmt.Println("cs", zjson.Str(cs)) + rsp.Data = cs } c.RetRspCodeData(code_msg.RECODE_OK, rsp) diff --git a/models/demo.go b/models/demo.go index f167a2b..ff5eb08 100644 --- a/models/demo.go +++ b/models/demo.go @@ -8,6 +8,7 @@ type ReqDemo struct { // RspDemo 返回 type RspDemo struct { + Data any `form:"data" json:"data"` } // ReqDump 请求 -- libgit2 0.21.0