Commit 66b07f8e by 孙龙

up

parent c764e462
...@@ -3,6 +3,7 @@ package dao ...@@ -3,6 +3,7 @@ package dao
import ( import (
_ "github.com/lib/pq" _ "github.com/lib/pq"
"github.com/xormplus/xorm" "github.com/xormplus/xorm"
"github.com/ichunt2019/cfg/lib"
) )
type Dao struct { type Dao struct {
...@@ -11,11 +12,7 @@ type Dao struct { ...@@ -11,11 +12,7 @@ type Dao struct {
func New() (Dao){ func New() (Dao){
conns := []string{ conns := lib.Instance("config.mysql.liexin")
"mysql://mysql:root@localhost:5432/test?sslmode=disable;",
"mysql://mysql:root@localhost:5432/test1?sslmode=disable;",
"mysql://mysql:root@localhost:5432/test2?sslmode=disable",
}
lieXinDb, err := xorm.NewEngineGroup("mysql",conns) lieXinDb, err := xorm.NewEngineGroup("mysql",conns)
if err != nil { if err != nil {
panic(err) panic(err)
......
...@@ -26,7 +26,11 @@ dob = 1979-05-27T07:32:00Z # 日期时间是一等公民。为什么不呢? ...@@ -26,7 +26,11 @@ dob = 1979-05-27T07:32:00Z # 日期时间是一等公民。为什么不呢?
data = [["gamma", "delta"],[1, 2]] data = [["gamma", "delta"],[1, 2]]
[mysql]
liexin = ["mysql://mysql:root@localhost:5432/test?sslmode=disable;",
"mysql://mysql:root@localhost:5432/test1?sslmode=disable;",
"mysql://mysql:root@localhost:5432/test2?sslmode=disable"
]
......
...@@ -16,6 +16,8 @@ micro_service_name = "golang_common_demo" ...@@ -16,6 +16,8 @@ micro_service_name = "golang_common_demo"
weight = 10 weight = 10
[base] [base]
debug_mode="debug" debug_mode="debug"
time_location="Asia/Chongqing" time_location="Asia/Chongqing"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment