Commit 5e0bd87f by Joneq

增加服务

parent c4200f92
package main
import (
"context"
"fmt"
"github.com/bilibili/kratos/pkg/log"
"kaopu-server/internal/service"
)
//当前静态算法内的pid和typeID
......@@ -10,7 +13,20 @@ const CTYPE = 1
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)
}
......
......@@ -18,6 +18,7 @@ type Dao interface {
Ping(ctx context.Context) (err error)
GetUserInfoByUserId(ctx context.Context,user_id int64) (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.
......
......@@ -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.Users, err error) {
func (s *Service) GetCompanyCresitsList(ctx context.Context) (res []*model.ComCredits, err error) {
//调用DB方法,获取会员数据
res, _ = s.dao.GetCompanyCresitsList(ctx)
......
......@@ -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: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 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
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