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,62 @@
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 = [
"PayGoods.proto",
"PayLive.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/av/api/liverpc/v0",
proto = ":v0_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"PayGoods.liverpc.go",
"PayLive.liverpc.go",
],
embed = [":v0_go_proto"],
importpath = "go-common/app/service/live/av/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,116 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v0/PayGoods.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/PayGoods.proto
v0/PayLive.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:
// ==================
// PayGoods Interface
// ==================
type PayGoods interface {
// * 生成一张付费直播票
//
Add(context.Context, *PayGoodsAddReq) (*PayGoodsAddResp, error)
// * 更新一张付费直播票
//
Update(context.Context, *PayGoodsUpdateReq) (*PayGoodsUpdateResp, error)
// * 获取付费直播票列表
//
GetList(context.Context, *PayGoodsGetListReq) (*PayGoodsGetListResp, error)
// * 关闭购票
//
Close(context.Context, *PayGoodsCloseReq) (*PayGoodsCloseResp, error)
// * 开启购票
//
Open(context.Context, *PayGoodsOpenReq) (*PayGoodsOpenResp, error)
}
// ========================
// PayGoods Live Rpc Client
// ========================
type payGoodsRpcClient struct {
client *liverpc.Client
}
// NewPayGoodsRpcClient creates a Rpc client that implements the PayGoods interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewPayGoodsRpcClient(client *liverpc.Client) PayGoods {
return &payGoodsRpcClient{
client: client,
}
}
func (c *payGoodsRpcClient) Add(ctx context.Context, in *PayGoodsAddReq) (*PayGoodsAddResp, error) {
out := new(PayGoodsAddResp)
err := doRpcRequest(ctx, c.client, 0, "PayGoods.add", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payGoodsRpcClient) Update(ctx context.Context, in *PayGoodsUpdateReq) (*PayGoodsUpdateResp, error) {
out := new(PayGoodsUpdateResp)
err := doRpcRequest(ctx, c.client, 0, "PayGoods.update", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payGoodsRpcClient) GetList(ctx context.Context, in *PayGoodsGetListReq) (*PayGoodsGetListResp, error) {
out := new(PayGoodsGetListResp)
err := doRpcRequest(ctx, c.client, 0, "PayGoods.getList", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payGoodsRpcClient) Close(ctx context.Context, in *PayGoodsCloseReq) (*PayGoodsCloseResp, error) {
out := new(PayGoodsCloseResp)
err := doRpcRequest(ctx, c.client, 0, "PayGoods.close", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payGoodsRpcClient) Open(ctx context.Context, in *PayGoodsOpenReq) (*PayGoodsOpenResp, error) {
out := new(PayGoodsOpenResp)
err := doRpcRequest(ctx, c.client, 0, "PayGoods.open", 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,204 @@
syntax = "proto3";
package av.v0;
option go_package = "v0";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service PayGoods {
/** 生成一张付费直播票
*
*/
rpc add (PayGoodsAddReq) returns (PayGoodsAddResp);
/** 更新一张付费直播票
*
*/
rpc update (PayGoodsUpdateReq) returns (PayGoodsUpdateResp);
/** 获取付费直播票列表
*
*/
rpc getList (PayGoodsGetListReq) returns (PayGoodsGetListResp);
/** 关闭购票
*
*/
rpc close (PayGoodsCloseReq) returns (PayGoodsCloseResp);
/** 开启购票
*
*/
rpc open (PayGoodsOpenReq) returns (PayGoodsOpenResp);
}
message PayGoodsAddReq {
// 平台
string platform = 1 [(gogoproto.jsontag) = "platform"];
// 商品名称
string title = 2 [(gogoproto.jsontag) = "title"];
// 商品类型 2 付费直播门票
int64 type = 3 [(gogoproto.jsontag) = "type"];
// 商品价格(分)
int64 price = 4 [(gogoproto.jsontag) = "price"];
// 开始时间
string start_time = 5 [(gogoproto.jsontag) = "start_time"];
// 结束时间
string end_time = 6 [(gogoproto.jsontag) = "end_time"];
// ip限制0不限制1仅限大陆2仅限港澳台3大陆+港澳台
int64 ip_limit = 7 [(gogoproto.jsontag) = "ip_limit"];
}
message PayGoodsAddResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message PayGoodsUpdateReq {
// 购票id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 平台
string platform = 2 [(gogoproto.jsontag) = "platform"];
// 商品名称
string title = 3 [(gogoproto.jsontag) = "title"];
// 商品类型 2 付费直播门票
int64 type = 4 [(gogoproto.jsontag) = "type"];
// 商品价格(分)
int64 price = 5 [(gogoproto.jsontag) = "price"];
// 开始时间
string start_time = 6 [(gogoproto.jsontag) = "start_time"];
// 结束时间
string end_time = 7 [(gogoproto.jsontag) = "end_time"];
// ip限制0不限制1仅限大陆2仅限港澳台3大陆+港澳台
int64 ip_limit = 8 [(gogoproto.jsontag) = "ip_limit"];
}
message PayGoodsUpdateResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message PayGoodsGetListReq {
// 购票id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 平台
string platform = 2 [(gogoproto.jsontag) = "platform"];
// 商品名称
string title = 3 [(gogoproto.jsontag) = "title"];
// 商品类型 2 付费直播门票
int64 type = 4 [(gogoproto.jsontag) = "type"];
// ip限制0不限制1仅限大陆2仅限港澳台3大陆+港澳台
int64 ip_limit = 5 [(gogoproto.jsontag) = "ip_limit"];
// 页号0开始
int64 page_num = 6 [(gogoproto.jsontag) = "page_num"];
// 每页个数
int64 page_size = 7 [(gogoproto.jsontag) = "page_size"];
}
message PayGoodsGetListResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message PageInfo {
// 记录总数
int64 total_count = 1 [(gogoproto.jsontag) = "total_count"];
// 当前页号
int64 page_num = 2 [(gogoproto.jsontag) = "page_num"];
}
message GoodsInfo {
// 购票id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 标题
string title = 2 [(gogoproto.jsontag) = "title"];
// 平台
string platform = 3 [(gogoproto.jsontag) = "platform"];
// 类型2为付费直播
int64 type = 4 [(gogoproto.jsontag) = "type"];
// 价格,分
int64 price = 5 [(gogoproto.jsontag) = "price"];
// 开始购票时间
string start_time = 6 [(gogoproto.jsontag) = "start_time"];
// 结束购票时间
string end_time = 7 [(gogoproto.jsontag) = "end_time"];
// ip限制
int64 ip_limit = 8 [(gogoproto.jsontag) = "ip_limit"];
// 购票状态0关闭1购票中2未开始
int64 status = 9 [(gogoproto.jsontag) = "status"];
}
message Data {
//
PageInfo page_info = 1 [(gogoproto.jsontag) = "page_info"];
//
repeated GoodsInfo goods_info = 2 [(gogoproto.jsontag) = "goods_info"];
}
}
message PayGoodsCloseReq {
// 购票id
int64 id = 1 [(gogoproto.jsontag) = "id"];
}
message PayGoodsCloseResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message PayGoodsOpenReq {
// 购票id
int64 id = 1 [(gogoproto.jsontag) = "id"];
}
message PayGoodsOpenResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}

View File

@@ -0,0 +1,98 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v0/PayLive.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
// =================
// PayLive Interface
// =================
type PayLive interface {
// * 生成付费直播信息
//
Add(context.Context, *PayLiveAddReq) (*PayLiveAddResp, error)
// * 更新付费直播信息
//
Update(context.Context, *PayLiveUpdateReq) (*PayLiveUpdateResp, error)
// * 获取付费直播列表
//
GetList(context.Context, *PayLiveGetListReq) (*PayLiveGetListResp, error)
// * 关闭鉴权
//
Close(context.Context, *PayLiveCloseReq) (*PayLiveCloseResp, error)
// * 开启鉴权
//
Open(context.Context, *PayLiveOpenReq) (*PayLiveOpenResp, error)
}
// =======================
// PayLive Live Rpc Client
// =======================
type payLiveRpcClient struct {
client *liverpc.Client
}
// NewPayLiveRpcClient creates a Rpc client that implements the PayLive interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewPayLiveRpcClient(client *liverpc.Client) PayLive {
return &payLiveRpcClient{
client: client,
}
}
func (c *payLiveRpcClient) Add(ctx context.Context, in *PayLiveAddReq) (*PayLiveAddResp, error) {
out := new(PayLiveAddResp)
err := doRpcRequest(ctx, c.client, 0, "PayLive.add", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payLiveRpcClient) Update(ctx context.Context, in *PayLiveUpdateReq) (*PayLiveUpdateResp, error) {
out := new(PayLiveUpdateResp)
err := doRpcRequest(ctx, c.client, 0, "PayLive.update", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payLiveRpcClient) GetList(ctx context.Context, in *PayLiveGetListReq) (*PayLiveGetListResp, error) {
out := new(PayLiveGetListResp)
err := doRpcRequest(ctx, c.client, 0, "PayLive.getList", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payLiveRpcClient) Close(ctx context.Context, in *PayLiveCloseReq) (*PayLiveCloseResp, error) {
out := new(PayLiveCloseResp)
err := doRpcRequest(ctx, c.client, 0, "PayLive.close", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payLiveRpcClient) Open(ctx context.Context, in *PayLiveOpenReq) (*PayLiveOpenResp, error) {
out := new(PayLiveOpenResp)
err := doRpcRequest(ctx, c.client, 0, "PayLive.open", in, out)
if err != nil {
return nil, err
}
return out, nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,236 @@
syntax = "proto3";
package av.v0;
option go_package = "v0";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service PayLive {
/** 生成付费直播信息
*
*/
rpc add (PayLiveAddReq) returns (PayLiveAddResp);
/** 更新付费直播信息
*
*/
rpc update (PayLiveUpdateReq) returns (PayLiveUpdateResp);
/** 获取付费直播列表
*
*/
rpc getList (PayLiveGetListReq) returns (PayLiveGetListResp);
/** 关闭鉴权
*
*/
rpc close (PayLiveCloseReq) returns (PayLiveCloseResp);
/** 开启鉴权
*
*/
rpc open (PayLiveOpenReq) returns (PayLiveOpenResp);
}
message PayLiveAddReq {
// 平台
string platform = 1 [(gogoproto.jsontag) = "platform"];
// 商品名称
int64 room_id = 2 [(gogoproto.jsontag) = "room_id"];
// 商品名称
string title = 3 [(gogoproto.jsontag) = "title"];
// 鉴权状态1开0关
int64 status = 4 [(gogoproto.jsontag) = "status"];
// 开始时间
string start_time = 5 [(gogoproto.jsontag) = "start_time"];
// 结束时间
string end_time = 6 [(gogoproto.jsontag) = "end_time"];
// 正片结束时间
string live_end_time = 7 [(gogoproto.jsontag) = "live_end_time"];
// 正片保底图
string live_pic = 8 [(gogoproto.jsontag) = "live_pic"];
// 广告图
string ad_pic = 9 [(gogoproto.jsontag) = "ad_pic"];
// 购买链接
string goods_link = 10 [(gogoproto.jsontag) = "goods_link"];
// 门票id逗号分隔
string goods_id = 11 [(gogoproto.jsontag) = "goods_id"];
// 引导购票id
int64 buy_goods_id = 12 [(gogoproto.jsontag) = "buy_goods_id"];
// ip限制0不限制1仅限大陆2仅限港澳台3大陆+港澳台
int64 ip_limit = 13 [(gogoproto.jsontag) = "ip_limit"];
}
message PayLiveAddResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message PayLiveUpdateReq {
// id
int64 live_id = 1 [(gogoproto.jsontag) = "live_id"];
// 平台
string platform = 2 [(gogoproto.jsontag) = "platform"];
// 商品名称
int64 room_id = 3 [(gogoproto.jsontag) = "room_id"];
// 商品名称
string title = 4 [(gogoproto.jsontag) = "title"];
// 鉴权状态1开0关
int64 status = 5 [(gogoproto.jsontag) = "status"];
// 开始时间
string start_time = 6 [(gogoproto.jsontag) = "start_time"];
// 结束时间
string end_time = 7 [(gogoproto.jsontag) = "end_time"];
// 正片结束时间
string live_end_time = 8 [(gogoproto.jsontag) = "live_end_time"];
// 正片保底图
string live_pic = 9 [(gogoproto.jsontag) = "live_pic"];
// 广告图
string ad_pic = 10 [(gogoproto.jsontag) = "ad_pic"];
// 购买链接
string goods_link = 11 [(gogoproto.jsontag) = "goods_link"];
// 门票id逗号分隔
string goods_id = 12 [(gogoproto.jsontag) = "goods_id"];
// 引导购票id
int64 buy_goods_id = 13 [(gogoproto.jsontag) = "buy_goods_id"];
// ip限制0不限制1仅限大陆2仅限港澳台3大陆+港澳台
int64 ip_limit = 14 [(gogoproto.jsontag) = "ip_limit"];
}
message PayLiveUpdateResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message PayLiveGetListReq {
// 房间id
int64 room_id = 1 [(gogoproto.jsontag) = "room_id"];
// 商品名称
string title = 2 [(gogoproto.jsontag) = "title"];
// ip限制
int64 ip_limit = 3 [(gogoproto.jsontag) = "ip_limit"];
// 页号0开始
int64 page_num = 4 [(gogoproto.jsontag) = "page_num"];
// 每页个数
int64 page_size = 5 [(gogoproto.jsontag) = "page_size"];
}
message PayLiveGetListResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message PageInfo {
// 记录总数
int64 total_count = 1 [(gogoproto.jsontag) = "total_count"];
// 当前页号
int64 page_num = 2 [(gogoproto.jsontag) = "page_num"];
}
message GoodsInfo {
// 房间id
int64 room_id = 1 [(gogoproto.jsontag) = "room_id"];
// 付费直播id
int64 live_id = 2 [(gogoproto.jsontag) = "live_id"];
// 标题
string title = 3 [(gogoproto.jsontag) = "title"];
// 平台
string platform = 4 [(gogoproto.jsontag) = "platform"];
// 生效状态1生效0未生效
int64 pay_live_status = 5 [(gogoproto.jsontag) = "pay_live_status"];
// 开始购票时间
string start_time = 6 [(gogoproto.jsontag) = "start_time"];
// 结束购票时间
string end_time = 7 [(gogoproto.jsontag) = "end_time"];
// 正片结束
string live_end_time = 8 [(gogoproto.jsontag) = "live_end_time"];
// 正片保底图
string live_pic = 9 [(gogoproto.jsontag) = "live_pic"];
// 广告图
string ad_pic = 10 [(gogoproto.jsontag) = "ad_pic"];
// 购票链接
string goods_link = 11 [(gogoproto.jsontag) = "goods_link"];
// 购票id
string goods_id = 12 [(gogoproto.jsontag) = "goods_id"];
// 引导购票id
int64 buy_goods_id = 13 [(gogoproto.jsontag) = "buy_goods_id"];
// ip限制
int64 ip_limit = 14 [(gogoproto.jsontag) = "ip_limit"];
// 鉴权状态0关闭1开启
int64 status = 15 [(gogoproto.jsontag) = "status"];
}
message Data {
//
PageInfo page_info = 1 [(gogoproto.jsontag) = "page_info"];
//
repeated GoodsInfo goods_info = 2 [(gogoproto.jsontag) = "goods_info"];
}
}
message PayLiveCloseReq {
// 直播id
int64 live_id = 1 [(gogoproto.jsontag) = "live_id"];
}
message PayLiveCloseResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message PayLiveOpenReq {
// 直播id
int64 live_id = 1 [(gogoproto.jsontag) = "live_id"];
}
message PayLiveOpenResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// 返回data
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}