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,39 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"dao.go",
"get.go",
],
importpath = "go-common/app/interface/live/app-interface/dao/user_ext",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/interface/live/app-interface/conf:go_default_library",
"//app/interface/live/app-interface/dao:go_default_library",
"//app/service/live/userext/api/liverpc/v1:go_default_library",
"//library/ecode:go_default_library",
"//library/log:go_default_library",
"//vendor/github.com/pkg/errors: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,31 @@
package user_ext
import (
"context"
"go-common/app/interface/live/app-interface/conf"
)
// Dao dao
type Dao struct {
c *conf.Config
}
// New init mysql db
func New(c *conf.Config) (dao *Dao) {
dao = &Dao{
c: c,
}
return
}
// Close close the resource.
func (d *Dao) Close() {
return
}
// Ping dao ping
func (d *Dao) Ping(c context.Context) error {
// check
return nil
}

View File

@@ -0,0 +1,26 @@
package user_ext
import (
"context"
"github.com/pkg/errors"
"go-common/app/interface/live/app-interface/dao"
userExV1 "go-common/app/service/live/userext/api/liverpc/v1"
"go-common/library/ecode"
"go-common/library/log"
)
// GetGrayRule 获取灰度配置
func (d *Dao) GetGrayRule(ctx context.Context, req *userExV1.GrayRuleGetByMarkReq) (extResult *userExV1.GrayRuleGetByMarkResp, err error) {
extResult = &userExV1.GrayRuleGetByMarkResp{}
if req == nil {
return nil, nil
}
ret, err := dao.UserExtApi.V1GrayRule.GetByMark(ctx, req)
if err != nil {
log.Error("call_userExt_grayRule error,err:%v", err)
err = errors.WithMessage(ecode.GetGrayRuleError, "GET SEA PATROL FAIL")
return
}
extResult = ret
return
}