Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"anchorUpdate.go",
"dao.go",
],
importpath = "go-common/app/service/live/xuser/dao/xanchor",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/live/dao-anchor/api/grpc/v1:go_default_library",
"//app/service/live/xuser/conf:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,15 @@
package xanchor
import (
"context"
XanchorV1 "go-common/app/service/live/dao-anchor/api/grpc/v1"
)
// UpdateAnchorInfo 更新主播经验db
func (d *Dao) UpdateAnchorInfo(ctx context.Context, params *XanchorV1.AnchorIncreReq) (err error) {
_, err = d.xuserGRPC.AnchorIncre(ctx, params)
if err != nil {
return
}
return
}

View File

@@ -0,0 +1,39 @@
package xanchor
import (
"context"
xanchor "go-common/app/service/live/dao-anchor/api/grpc/v1"
"go-common/app/service/live/xuser/conf"
)
// Dao dao
type Dao struct {
c *conf.Config
xuserGRPC *xanchor.Client
}
var _rsCli *xanchor.Client
// New init mysql db
func New(c *conf.Config) (dao *Dao) {
var err error
if _rsCli, err = xanchor.NewClient(c.XanchorClient); err != nil {
panic(err)
}
dao = &Dao{
c: c,
xuserGRPC: _rsCli,
}
return
}
// Close close the resource.
func (d *Dao) Close() {
}
// Ping dao ping
func (d *Dao) Ping(c context.Context) error {
// TODO: if you need use mc,redis, please add
// check
return nil
}