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
5e0bd87f
authored
Nov 21, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加服务
parent
c4200f92
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
cmd/static/main.go
internal/dao/dao.go
internal/service/service.go
logs/info.log
cmd/static/main.go
View file @
5e0bd87f
package
main
package
main
import
(
import
(
"context"
"fmt"
"fmt"
"github.com/bilibili/kratos/pkg/log"
"kaopu-server/internal/service"
)
)
//当前静态算法内的pid和typeID
//当前静态算法内的pid和typeID
...
@@ -10,7 +13,20 @@ const CTYPE = 1
...
@@ -10,7 +13,20 @@ const CTYPE = 1
func
main
()
{
func
main
()
{
fmt
.
Print
(
1
);
//初始化日志目录
log
.
Init
(
&
log
.
Config
{
Dir
:
"logs"
})
defer
log
.
Close
()
log
.
Info
(
"caipu-server start"
)
//声明service层
svc
:=
service
.
New
()
fmt
.
Print
(
1
)
return
ctx
:=
context
.
Background
()
//调用会员服务
svc
.
GetCompanyCresitsList
(
ctx
)
}
}
...
...
internal/dao/dao.go
View file @
5e0bd87f
...
@@ -18,6 +18,7 @@ type Dao interface {
...
@@ -18,6 +18,7 @@ type Dao interface {
Ping
(
ctx
context
.
Context
)
(
err
error
)
Ping
(
ctx
context
.
Context
)
(
err
error
)
GetUserInfoByUserId
(
ctx
context
.
Context
,
user_id
int64
)
(
r
*
model
.
Users
,
err
error
)
GetUserInfoByUserId
(
ctx
context
.
Context
,
user_id
int64
)
(
r
*
model
.
Users
,
err
error
)
GetUserList
(
ctx
context
.
Context
)
(
r
[]
*
model
.
Users
,
err
error
)
GetUserList
(
ctx
context
.
Context
)
(
r
[]
*
model
.
Users
,
err
error
)
GetCompanyCresitsList
(
ctx
context
.
Context
)
(
r
[]
*
model
.
ComCredits
,
err
error
)
}
}
// dao dao.
// dao dao.
...
...
internal/service/service.go
View file @
5e0bd87f
...
@@ -60,7 +60,7 @@ func (s *Service) GetUserList(ctx context.Context) (res []*model.Users, err erro
...
@@ -60,7 +60,7 @@ func (s *Service) GetUserList(ctx context.Context) (res []*model.Users, err erro
//获取用户列表
//获取用户列表
func
(
s
*
Service
)
GetCompanyCresitsList
(
ctx
context
.
Context
)
(
res
[]
*
model
.
User
s
,
err
error
)
{
func
(
s
*
Service
)
GetCompanyCresitsList
(
ctx
context
.
Context
)
(
res
[]
*
model
.
ComCredit
s
,
err
error
)
{
//调用DB方法,获取会员数据
//调用DB方法,获取会员数据
res
,
_
=
s
.
dao
.
GetCompanyCresitsList
(
ctx
)
res
,
_
=
s
.
dao
.
GetCompanyCresitsList
(
ctx
)
...
...
logs/info.log
View file @
5e0bd87f
...
@@ -25,3 +25,7 @@
...
@@ -25,3 +25,7 @@
[2019/11/21 10:15:12.824] [INFO] [D:/gocode/caipu-server/cmd/main.go:24] caipu-server start
[2019/11/21 10:15:12.824] [INFO] [D:/gocode/caipu-server/cmd/main.go:24] caipu-server start
[2019/11/21 10:34:31.591] [INFO] [D:/gocode/caipu-server/cmd/main.go:24] caipu-server start
[2019/11/21 10:34:31.591] [INFO] [D:/gocode/caipu-server/cmd/main.go:24] caipu-server start
[2019/11/21 10:37:59.963] [INFO] [D:/gocode/kaopu-server/cmd/main.go:24] caipu-server start
[2019/11/21 10:37:59.963] [INFO] [D:/gocode/kaopu-server/cmd/main.go:24] caipu-server start
[2019/11/21 17:01:12.084] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:18] caipu-server start
[2019/11/21 17:02:38.829] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:19] caipu-server start
[2019/11/21 17:03:00.403] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:20] caipu-server start
[2019/11/21 17:03:10.790] [INFO] [/usr/local/var/www/ichunt/kaopu-server/cmd/static/main.go:20] caipu-server start
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