瀏覽代碼

update

tags/v1.2.9
DengBiao 2 年之前
父節點
當前提交
ef5283c8da
共有 3 個檔案被更改,包括 8 行新增2 行删除
  1. +5
    -1
      pay/init.go
  2. +1
    -1
      pay/pay_test.go
  3. +2
    -0
      pay/tmp/zyos_website.logs

+ 5
- 1
pay/init.go 查看文件

@@ -3,6 +3,7 @@ package pay
import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/db"
"code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/md"
"code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/utils/cache"
)

var cfg = md.DBCfg{
@@ -17,7 +18,7 @@ var cfg = md.DBCfg{
Path: "",
}

func Init(host, name, user, psw string) error {
func Init(host, name, user, psw, redisAddr string) error {
cfg.Host = host
cfg.Name = name
cfg.User = user
@@ -30,5 +31,8 @@ func Init(host, name, user, psw string) error {
if err := db.InitDB(&cfg); err != nil {
return err
}
if redisAddr != "" {
cache.NewRedis(redisAddr)
}
return nil
}

+ 1
- 1
pay/pay_test.go 查看文件

@@ -6,7 +6,7 @@ import (
)

func TestPay(t *testing.T) {
err := Init("119.23.182.117:3306", "zyos_website", "root", "Fnuo123com@")
err := Init("119.23.182.117:3306", "zyos_website", "root", "Fnuo123com@", "123132")
if err != nil {
t.Errorf("Reverse == %s", err)
}


+ 2
- 0
pay/tmp/zyos_website.logs 查看文件

@@ -0,0 +1,2 @@
[xorm] [info] 2022/05/31 21:15:55.975347 [SQL] SELECT `id`, `channel_id`, `identifier`, `master_id`, `master_nickname`, `third_party_id`, `master_app_name`, `app_id` FROM `pay_channel_master` WHERE (app_id = ?) AND (identifier = ?) LIMIT 1 [35618318 mall] - 26.793ms
[xorm] [info] 2022/05/31 21:16:05.918813 [SQL] SELECT `id`, `channel_id`, `identifier`, `master_id`, `master_nickname`, `third_party_id`, `master_app_name`, `app_id` FROM `pay_channel_master` WHERE (app_id = ?) AND (identifier = ?) LIMIT 1 [35618318 mall] - 26.2782ms

Loading…
取消
儲存