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,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 = "v0_proto",
srcs = ["Smalltv.proto"],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "v0_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
importpath = "go-common/app/service/live/gift/api/liverpc/v0",
proto = ":v0_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = ["Smalltv.liverpc.go"],
embed = [":v0_go_proto"],
importpath = "go-common/app/service/live/gift/api/liverpc/v0",
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,63 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v0/Smalltv.proto
/*
Package v0 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:
v0/Smalltv.proto
*/
package v0
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:
// =================
// Smalltv Interface
// =================
type Smalltv interface {
// * 开启抽奖的内部接口
// 返回的是广播的内容列表
Start(context.Context, *SmalltvStartReq) (*SmalltvStartResp, error)
}
// =======================
// Smalltv Live Rpc Client
// =======================
type smalltvRpcClient struct {
client *liverpc.Client
}
// NewSmalltvRpcClient creates a Rpc client that implements the Smalltv interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewSmalltvRpcClient(client *liverpc.Client) Smalltv {
return &smalltvRpcClient{
client: client,
}
}
func (c *smalltvRpcClient) Start(ctx context.Context, in *SmalltvStartReq) (*SmalltvStartResp, error) {
out := new(SmalltvStartResp)
err := doRpcRequest(ctx, c.client, 0, "Smalltv.start", 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,68 @@
syntax = "proto3";
package gift.v0;
option go_package = "v0";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Smalltv {
/** 开启抽奖的内部接口
* 返回的是广播的内容列表
*/
rpc start (SmalltvStartReq) returns (SmalltvStartResp);
}
message SmalltvStartReq {
// 用户id
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 房间号
int64 roomid = 2 [(gogoproto.jsontag) = "roomid"];
// 道具id
int64 gift_id = 3 [(gogoproto.jsontag) = "gift_id"];
// 道具个数
int64 num = 4 [(gogoproto.jsontag) = "num"];
// 业务id
int64 tid = 5 [(gogoproto.jsontag) = "tid"];
// 公告样式id
int64 style_id = 6 [(gogoproto.jsontag) = "style_id"];
}
message SmalltvStartResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
repeated MSG data = 3 [(gogoproto.jsontag) = "data"];
message MSG {
//
string cmd = 1 [(gogoproto.jsontag) = "cmd"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
string msg_text = 3 [(gogoproto.jsontag) = "msg_text"];
//
string msg_common = 4 [(gogoproto.jsontag) = "msg_common"];
//
string msg_self = 5 [(gogoproto.jsontag) = "msg_self"];
//
int64 rep = 6 [(gogoproto.jsontag) = "rep"];
//
int64 styleType = 7 [(gogoproto.jsontag) = "styleType"];
//
string url = 8 [(gogoproto.jsontag) = "url"];
//
int64 roomid = 9 [(gogoproto.jsontag) = "roomid"];
//
int64 real_roomid = 10 [(gogoproto.jsontag) = "real_roomid"];
//
int64 rnd = 11 [(gogoproto.jsontag) = "rnd"];
//
int64 broadcast_type = 12 [(gogoproto.jsontag) = "broadcast_type"];
}
}