Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
kaopu-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
988f9ff2
authored
Nov 21, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改错误
parent
193fb2d7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
29 deletions
cmd/static/main.go
configs/mysql.toml
internal/dao/com_credits.go → internal/dao/com_sql.go
logs/info.log
logs/warning.log
cmd/static/main.go
View file @
988f9ff2
...
...
@@ -2,7 +2,8 @@ package main
import
(
"context"
"fmt"
"flag"
"github.com/bilibili/kratos/pkg/conf/paladin"
"github.com/bilibili/kratos/pkg/log"
"kaopu-server/internal/service"
)
...
...
@@ -13,7 +14,11 @@ const CTYPE = 1
func
main
()
{
//获取输入参数
flag
.
Parse
()
if
err
:=
paladin
.
Init
();
err
!=
nil
{
panic
(
err
)
}
//初始化日志目录
log
.
Init
(
&
log
.
Config
{
Dir
:
"logs"
})
defer
log
.
Close
()
...
...
@@ -21,10 +26,7 @@ func main() {
//声明service层
svc
:=
service
.
New
()
fmt
.
Print
(
1
)
return
ctx
:=
context
.
Background
()
//调用会员服务
svc
.
GetCompanyCresitsList
(
ctx
)
}
...
...
configs/mysql.toml
View file @
988f9ff2
[liexin_credit_back]
[liexin_credit]
addr
=
"192.168.2.232:3306"
dsn
=
"liexin_credit:liexin_credit#zsyM@tcp(192.168.2.232:3306)/liexin_credit?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8"
readDSN
=
["liexin_credit:liexin_credit#zsyM@tcp(192.168.2.232:3306)/liexin_credit?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8"]
...
...
@@ -9,25 +8,6 @@
queryTimeout
=
"200ms"
execTimeout
=
"300ms"
tranTimeout
=
"400ms"
[demo]
addr
=
"localhost:3306"
dsn
=
"root:root@tcp(localhost:3306)/cndzys?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8"
readDSN
=
["root:root@tcp(127.0.0.2:3306)/cndzys?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8","root:root@tcp(127.0.0.3:3306)/cndzys?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8,utf8mb4"]
active
=
20
idle
=
10
idleTimeout
=
"4h"
queryTimeout
=
"200ms"
execTimeout
=
"300ms"
tranTimeout
=
"400ms"
[liexin_credit]
addr
=
"localhost:3306"
dsn
=
"root:root@tcp(localhost:3306)/cndzys?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8"
readDSN
=
["root:root@tcp(127.0.0.2:3306)/cndzys?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8","root:root@tcp(127.0.0.3:3306)/cndzys?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8,utf8mb4"]
active
=
20
idle
=
10
idleTimeout
=
"4h"
queryTimeout
=
"200ms"
execTimeout
=
"300ms"
tranTimeout
=
"400ms"
internal/dao/com_
credits
.go
→
internal/dao/com_
sql
.go
View file @
988f9ff2
...
...
@@ -2,9 +2,9 @@ package dao
import
(
"context"
"kaopu-server/internal/model"
"github.com/bilibili/kratos/pkg/database/sql"
"github.com/pkg/errors"
"kaopu-server/internal/model"
)
//列表方式获取会员信息
...
...
@@ -13,7 +13,6 @@ func (d *dao) GetCompanyCresitsList(ctx context.Context) (res []*model.ComCredit
rows
*
sql
.
Rows
)
if
rows
,
err
=
d
.
db
.
Query
(
ctx
,
"SELECT * FROM lie_com_credits "
);
err
!=
nil
{
err
=
errors
.
WithStack
(
err
)
return
...
...
logs/info.log
View file @
988f9ff2
...
...
@@ -35,3 +35,18 @@
[2019/11/21 17:15:01.908] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:20] caipu-server start
[2019/11/21 17:15:22.437] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:20] caipu-server start
[2019/11/21 17:16:55.769] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:20] caipu-server start
[2019/11/21 17:21:52.590] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:27] caipu-server start
[2019/11/21 17:22:24.083] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:27] caipu-server start
[2019/11/21 17:23:28.447] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:24:17.148] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:27:09.764] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:27:17.857] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:29:23.004] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:30:25.382] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:31:53.080] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:32:38.387] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:33:21.783] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:26] caipu-server start
[2019/11/21 17:33:34.616] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:26] caipu-server start
[2019/11/21 17:35:20.751] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:37:29.678] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
[2019/11/21 17:59:02.082] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:25] caipu-server start
logs/warning.log
View file @
988f9ff2
[2019/11/21 17:21:53.592] [WARN] [/Users/gongyang/go/pkg/mod/github.com/bilibili/kratos@v0.3.1/pkg/database/sql/sql.go:679] sql_client slow log statement: Query query(SELECT user_id, user_name FROM ys_users ) args([]) time: 1.001553417s
[2019/11/21 17:22:25.088] [WARN] [/Users/gongyang/go/pkg/mod/github.com/bilibili/kratos@v0.3.1/pkg/database/sql/sql.go:679] sql_client slow log statement: Query query(SELECT * FROM lie_com_credits ) args([]) time: 1.004363403s
[2019/11/21 17:23:29.451] [WARN] [/Users/gongyang/go/pkg/mod/github.com/bilibili/kratos@v0.3.1/pkg/database/sql/sql.go:679] sql_client slow log statement: Query query(SELECT * FROM lie_com_credits ) args([]) time: 1.003427317s
[2019/11/21 17:24:18.153] [WARN] [/Users/gongyang/go/pkg/mod/github.com/bilibili/kratos@v0.3.1/pkg/database/sql/sql.go:679] sql_client slow log statement: Query query(SELECT * FROM lie_com_credits ) args([]) time: 1.004311142s
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