Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
bom_server
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
893cdefc
authored
Jun 10, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调试
parent
9c8dada8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
1 deletions
go.mod
go.sum
internal/model/model.go
go.mod
View file @
893cdefc
...
@@ -7,6 +7,7 @@ require (
...
@@ -7,6 +7,7 @@ require (
github.com/gin-gonic/gin v1.6.3
github.com/gin-gonic/gin v1.6.3
github.com/go-ini/ini v1.56.0
github.com/go-ini/ini v1.56.0
github.com/go-kratos/kratos v0.5.0
github.com/go-kratos/kratos v0.5.0
github.com/go-sql-driver/mysql v1.5.0
github.com/ichunt2019/go-rabbitmq v1.0.1
github.com/ichunt2019/go-rabbitmq v1.0.1
github.com/imroc/req v0.3.0
github.com/imroc/req v0.3.0
github.com/jinzhu/gorm v1.9.12
github.com/jinzhu/gorm v1.9.12
...
...
go.sum
View file @
893cdefc
...
@@ -96,7 +96,6 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+
...
@@ -96,7 +96,6 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
...
...
internal/model/model.go
View file @
893cdefc
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"fmt"
"fmt"
"github.com/jinzhu/gorm"
"github.com/jinzhu/gorm"
_
"github.com/jinzhu/gorm/dialects/mysql"
_
"github.com/jinzhu/gorm/dialects/mysql"
"time"
)
)
var
Db
*
gorm
.
DB
var
Db
*
gorm
.
DB
...
@@ -30,4 +31,5 @@ func Setup() {
...
@@ -30,4 +31,5 @@ func Setup() {
//Db.LogMode(true)
//Db.LogMode(true)
Db
.
DB
()
.
SetMaxIdleConns
(
10
)
Db
.
DB
()
.
SetMaxIdleConns
(
10
)
Db
.
DB
()
.
SetMaxOpenConns
(
100
)
Db
.
DB
()
.
SetMaxOpenConns
(
100
)
Db
.
DB
()
.
SetConnMaxLifetime
(
10
*
time
.
Second
)
}
}
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