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,16 @@
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//app/service/live/activity/api/liverpc:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,3 @@
### v1.0.1
1. 友爱社接口

View File

@@ -0,0 +1,7 @@
# Owner
longsifan
# Author
longsifan
# Reviewer
zhaohailin

View File

@@ -0,0 +1,13 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- longsifan
labels:
- live
- service
- service/live/activity
options:
no_parent_owners: true
reviewers:
- longsifan
- zhaohailin

View File

@@ -0,0 +1,13 @@
# xuser-service
## 项目简介
1.直播活动服务,目前包含
## 编译环境
## 依赖包
## 编译执行

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 = ["client.go"],
importpath = "go-common/app/service/live/activity/api/liverpc",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/live/activity/api/liverpc/v1:go_default_library",
"//library/net/rpc/liverpc:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//app/service/live/activity/api/liverpc/v1:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,42 @@
// Code generated by liverpcgen, DO NOT EDIT.
// source: *.proto files under this directory
// If you want to change this file, Please see README in go-common/app/tool/liverpc/protoc-gen-liverpc/
package liverpc
import (
"go-common/app/service/live/activity/api/liverpc/v1"
"go-common/library/net/rpc/liverpc"
)
// Client that represents a liverpc activity service api
type Client struct {
cli *liverpc.Client
// V1UnionFans presents the controller in liverpc
V1UnionFans v1.UnionFans
}
// DiscoveryAppId the discovery id is not the tree name
var DiscoveryAppId = "live.activity"
// New a Client that represents a liverpc live.activity service api
// conf can be empty, and it will use discovery to find service by default
// conf.AppID will be overwrite by a fixed value DiscoveryAppId
// therefore is no need to set
func New(conf *liverpc.ClientConfig) *Client {
if conf == nil {
conf = &liverpc.ClientConfig{}
}
conf.AppID = DiscoveryAppId
var realCli = liverpc.NewClient(conf)
cli := &Client{cli: realCli}
cli.clientInit(realCli)
return cli
}
func (cli *Client) GetRawCli() *liverpc.Client {
return cli.cli
}
func (cli *Client) clientInit(realCli *liverpc.Client) {
cli.V1UnionFans = v1.NewUnionFansRpcClient(realCli)
}

View File

@@ -0,0 +1,56 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
proto_library(
name = "v1_proto",
srcs = ["UnionFans.proto"],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "v1_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
importpath = "go-common/app/service/live/activity/api/liverpc/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = ["UnionFans.liverpc.go"],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/live/activity/api/liverpc/v1",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/rpc/liverpc:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@com_github_golang_protobuf//proto: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,76 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/UnionFans.proto
/*
Package v1 is a generated liverpc stub package.
This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.
It is generated from these files:
v1/UnionFans.proto
*/
package v1
import context "context"
import proto "github.com/golang/protobuf/proto"
import "go-common/library/net/rpc/liverpc"
var _ proto.Message // generate to suppress unused imports
// Imports only used by utility functions:
// ===================
// UnionFans Interface
// ===================
type UnionFans interface {
// * 获取友爱社礼包提示
//
GetSendGift(context.Context, *UnionFansGetSendGiftReq) (*UnionFansGetSendGiftResp, error)
// * 查询用户特殊勋章样式
//
GetSpecialMedal(context.Context, *UnionFansGetSpecialMedalReq) (*UnionFansGetSpecialMedalResp, error)
}
// =========================
// UnionFans Live Rpc Client
// =========================
type unionFansRpcClient struct {
client *liverpc.Client
}
// NewUnionFansRpcClient creates a Rpc client that implements the UnionFans interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewUnionFansRpcClient(client *liverpc.Client) UnionFans {
return &unionFansRpcClient{
client: client,
}
}
func (c *unionFansRpcClient) GetSendGift(ctx context.Context, in *UnionFansGetSendGiftReq) (*UnionFansGetSendGiftResp, error) {
out := new(UnionFansGetSendGiftResp)
err := doRpcRequest(ctx, c.client, 1, "UnionFans.getSendGift", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *unionFansRpcClient) GetSpecialMedal(ctx context.Context, in *UnionFansGetSpecialMedalReq) (*UnionFansGetSpecialMedalResp, error) {
out := new(UnionFansGetSpecialMedalResp)
err := doRpcRequest(ctx, c.client, 1, "UnionFans.getSpecialMedal", in, out)
if err != nil {
return nil, err
}
return out, nil
}
// =====
// Utils
// =====
func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
err = client.Call(ctx, version, method, in, out)
return
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,75 @@
syntax = "proto3";
package activity.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service UnionFans {
/** 获取友爱社礼包提示
*
*/
rpc getSendGift (UnionFansGetSendGiftReq) returns (UnionFansGetSendGiftResp);
/** 查询用户特殊勋章样式
*
*/
rpc getSpecialMedal (UnionFansGetSpecialMedalReq) returns (UnionFansGetSpecialMedalResp);
}
message UnionFansGetSendGiftReq {
//
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
}
message UnionFansGetSendGiftResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
repeated Data data = 3 [(gogoproto.jsontag) = "data"];
message GiftList {
//
string gift_id = 1 [(gogoproto.jsontag) = "gift_id"];
//
int64 gift_num = 2 [(gogoproto.jsontag) = "gift_num"];
}
message Data {
// 类型
int64 type = 1 [(gogoproto.jsontag) = "type"];
// 名称
string giftTypeName = 2 [(gogoproto.jsontag) = "giftTypeName"];
//
repeated GiftList gift_list = 3 [(gogoproto.jsontag) = "gift_list"];
}
}
message UnionFansGetSpecialMedalReq {
// 用户uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 主播uid
int64 ruid = 2 [(gogoproto.jsontag) = "ruid"];
}
message UnionFansGetSpecialMedalResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// 特殊序章样式 为空或者为union
string special_medal = 1 [(gogoproto.jsontag) = "special_medal"];
}
}