Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
ichunt_golang_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
66b07f8e
authored
Mar 04, 2021
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
c764e462
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
app/dao/dao.go
config/dev/config.toml
config/dev/proxy.toml
app/dao/dao.go
View file @
66b07f8e
...
...
@@ -3,6 +3,7 @@ package dao
import
(
_
"github.com/lib/pq"
"github.com/xormplus/xorm"
"github.com/ichunt2019/cfg/lib"
)
type
Dao
struct
{
...
...
@@ -11,11 +12,7 @@ type Dao struct {
func
New
()
(
Dao
){
conns
:=
[]
string
{
"mysql://mysql:root@localhost:5432/test?sslmode=disable;"
,
"mysql://mysql:root@localhost:5432/test1?sslmode=disable;"
,
"mysql://mysql:root@localhost:5432/test2?sslmode=disable"
,
}
conns
:=
lib
.
Instance
(
"config.mysql.liexin"
)
lieXinDb
,
err
:=
xorm
.
NewEngineGroup
(
"mysql"
,
conns
)
if
err
!=
nil
{
panic
(
err
)
...
...
config/dev/config.toml
View file @
66b07f8e
...
...
@@ -26,7 +26,11 @@ dob = 1979-05-27T07:32:00Z # 日期时间是一等公民。为什么不呢?
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"
]
...
...
config/dev/proxy.toml
View file @
66b07f8e
...
...
@@ -16,6 +16,8 @@ micro_service_name = "golang_common_demo"
weight
=
10
[base]
debug_mode
=
"debug"
time_location
=
"Asia/Chongqing"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment