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,37 @@
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/userext/api/liverpc",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/live/userext/api/liverpc/v0:go_default_library",
"//app/service/live/userext/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/userext/api/liverpc/v0:all-srcs",
"//app/service/live/userext/api/liverpc/v1:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,61 @@
// 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/userext/api/liverpc/v0"
"go-common/app/service/live/userext/api/liverpc/v1"
"go-common/library/net/rpc/liverpc"
)
// Client that represents a liverpc userext service api
type Client struct {
cli *liverpc.Client
// V0Conf presents the controller in liverpc
V0Conf v0.ConfRPCClient
// V1Bubble presents the controller in liverpc
V1Bubble v1.BubbleRPCClient
// V1Color presents the controller in liverpc
V1Color v1.ColorRPCClient
// V1DanmuConf presents the controller in liverpc
V1DanmuConf v1.DanmuConfRPCClient
// V1GrayRule presents the controller in liverpc
V1GrayRule v1.GrayRuleRPCClient
// V1Remind presents the controller in liverpc
V1Remind v1.RemindRPCClient
// V1Tag presents the controller in liverpc
V1Tag v1.TagRPCClient
}
// DiscoveryAppId the discovery id is not the tree name
var DiscoveryAppId = "live.userext"
// New a Client that represents a liverpc live.userext 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.V0Conf = v0.NewConfRPCClient(realCli)
cli.V1Bubble = v1.NewBubbleRPCClient(realCli)
cli.V1Color = v1.NewColorRPCClient(realCli)
cli.V1DanmuConf = v1.NewDanmuConfRPCClient(realCli)
cli.V1GrayRule = v1.NewGrayRuleRPCClient(realCli)
cli.V1Remind = v1.NewRemindRPCClient(realCli)
cli.V1Tag = v1.NewTagRPCClient(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 = "v0_proto",
srcs = ["Conf.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/userext/api/liverpc/v0",
proto = ":v0_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = ["Conf.liverpc.go"],
embed = [":v0_go_proto"],
importpath = "go-common/app/service/live/userext/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,75 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v0/Conf.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/Conf.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:
// ==============
// Conf Interface
// ==============
type ConfRPCClient interface {
// * 设置配置仓库
//
Set(ctx context.Context, req *ConfSetReq, opts ...liverpc.CallOption) (resp *ConfSetResp, err error)
// * 查看用户配置
//
Get(ctx context.Context, req *ConfGetReq, opts ...liverpc.CallOption) (resp *ConfGetResp, err error)
}
// ====================
// Conf Live Rpc Client
// ====================
type confRPCClient struct {
client *liverpc.Client
}
// NewConfRPCClient creates a client that implements the ConfRPCClient interface.
func NewConfRPCClient(client *liverpc.Client) ConfRPCClient {
return &confRPCClient{
client: client,
}
}
func (c *confRPCClient) Set(ctx context.Context, in *ConfSetReq, opts ...liverpc.CallOption) (*ConfSetResp, error) {
out := new(ConfSetResp)
err := doRPCRequest(ctx, c.client, 0, "Conf.set", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *confRPCClient) Get(ctx context.Context, in *ConfGetReq, opts ...liverpc.CallOption) (*ConfGetResp, error) {
out := new(ConfGetResp)
err := doRPCRequest(ctx, c.client, 0, "Conf.get", in, out, opts)
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, opts []liverpc.CallOption) (err error) {
err = client.Call(ctx, version, method, in, out, opts...)
return
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
syntax = "proto3";
package userext.v0;
option go_package = "v0";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Conf {
/** 设置配置仓库
*
*/
rpc set (ConfSetReq) returns (ConfSetResp);
/** 查看用户配置
*
*/
rpc get (ConfGetReq) returns (ConfGetResp);
}
message ConfSetReq {
// 参数结构
repeated Var var_list = 1 [(gogoproto.jsontag) = "var_list"];
message Var {
// 用户id
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 目标id,主播uid、房间号etc
int64 target_id = 2 [(gogoproto.jsontag) = "target_id"];
// type请在 “配置仓库标识申请” 中自行分配
int64 type = 3 [(gogoproto.jsontag) = "type"];
// 设置内容
string content = 4 [(gogoproto.jsontag) = "content"];
}
}
message ConfSetResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message ConfGetReq {
// 用户id
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 目标id,主播uid、房间号etc
int64 target_id = 2 [(gogoproto.jsontag) = "target_id"];
// type请在 “配置仓库标识申请” 中自行分配
repeated int64 type = 3 [(gogoproto.jsontag) = "type"];
}
message ConfGetResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// type -> content
map<string, string> data = 3 [(gogoproto.jsontag) = "data"];
}

View File

@@ -0,0 +1,70 @@
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",
)
go_library(
name = "go_default_library",
srcs = [
"Bubble.liverpc.go",
"Color.liverpc.go",
"DanmuConf.liverpc.go",
"GrayRule.liverpc.go",
"Remind.liverpc.go",
"Tag.liverpc.go",
],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/live/userext/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"],
)
proto_library(
name = "v1_proto",
srcs = [
"Bubble.proto",
"Color.proto",
"DanmuConf.proto",
"GrayRule.proto",
"Remind.proto",
"Tag.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/userext/api/liverpc/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)

View File

@@ -0,0 +1,106 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Bubble.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/Bubble.proto
v1/Color.proto
v1/DanmuConf.proto
v1/GrayRule.proto
v1/Remind.proto
v1/Tag.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:
// ================
// Bubble Interface
// ================
type BubbleRPCClient interface {
// * 获取用户当前气泡框
// 获取用户当前气泡框
GetCurrent(ctx context.Context, req *BubbleGetCurrentReq, opts ...liverpc.CallOption) (resp *BubbleGetCurrentResp, err error)
// * 获取用户当前房间的气泡框
// 获取用户当前房间的气泡框
GetBubble(ctx context.Context, req *BubbleGetBubbleReq, opts ...liverpc.CallOption) (resp *BubbleGetBubbleResp, err error)
// * 校验用户气泡框
// 校验用户气泡框
CheckAuth(ctx context.Context, req *BubbleCheckAuthReq, opts ...liverpc.CallOption) (resp *BubbleCheckAuthResp, err error)
// * 给用户下发气泡框
// 给用户下发气泡框
MultiAdd(ctx context.Context, req *BubbleMultiAddReq, opts ...liverpc.CallOption) (resp *BubbleMultiAddResp, err error)
}
// ======================
// Bubble Live Rpc Client
// ======================
type bubbleRPCClient struct {
client *liverpc.Client
}
// NewBubbleRPCClient creates a client that implements the BubbleRPCClient interface.
func NewBubbleRPCClient(client *liverpc.Client) BubbleRPCClient {
return &bubbleRPCClient{
client: client,
}
}
func (c *bubbleRPCClient) GetCurrent(ctx context.Context, in *BubbleGetCurrentReq, opts ...liverpc.CallOption) (*BubbleGetCurrentResp, error) {
out := new(BubbleGetCurrentResp)
err := doRPCRequest(ctx, c.client, 1, "Bubble.getCurrent", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bubbleRPCClient) GetBubble(ctx context.Context, in *BubbleGetBubbleReq, opts ...liverpc.CallOption) (*BubbleGetBubbleResp, error) {
out := new(BubbleGetBubbleResp)
err := doRPCRequest(ctx, c.client, 1, "Bubble.getBubble", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bubbleRPCClient) CheckAuth(ctx context.Context, in *BubbleCheckAuthReq, opts ...liverpc.CallOption) (*BubbleCheckAuthResp, error) {
out := new(BubbleCheckAuthResp)
err := doRPCRequest(ctx, c.client, 1, "Bubble.checkAuth", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bubbleRPCClient) MultiAdd(ctx context.Context, in *BubbleMultiAddReq, opts ...liverpc.CallOption) (*BubbleMultiAddResp, error) {
out := new(BubbleMultiAddResp)
err := doRPCRequest(ctx, c.client, 1, "Bubble.multiAdd", in, out, opts)
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, opts []liverpc.CallOption) (err error) {
err = client.Call(ctx, version, method, in, out, opts...)
return
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,159 @@
syntax = "proto3";
package userext.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Bubble {
/** 获取用户当前气泡框
* 获取用户当前气泡框
*/
rpc getCurrent (BubbleGetCurrentReq) returns (BubbleGetCurrentResp);
/** 获取用户当前房间的气泡框
* 获取用户当前房间的气泡框
*/
rpc getBubble (BubbleGetBubbleReq) returns (BubbleGetBubbleResp);
/** 校验用户气泡框
* 校验用户气泡框
*/
rpc checkAuth (BubbleCheckAuthReq) returns (BubbleCheckAuthResp);
/** 给用户下发气泡框
* 给用户下发气泡框
*/
rpc multiAdd (BubbleMultiAddReq) returns (BubbleMultiAddResp);
}
message BubbleGetCurrentReq {
// 用户 uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 房间号
int64 room_id = 2 [(gogoproto.jsontag) = "room_id"];
// 全区ID
int64 category = 3 [(gogoproto.jsontag) = "category"];
// 分区ID
int64 sub_category = 4 [(gogoproto.jsontag) = "sub_category"];
}
message BubbleGetCurrentResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
string message = 3 [(gogoproto.jsontag) = "message"];
//
Data data = 4 [(gogoproto.jsontag) = "data"];
message Data {
// 当前气泡框ID
int64 bubble = 1 [(gogoproto.jsontag) = "bubble"];
}
}
message BubbleGetBubbleReq {
// 用户 uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 房间号
int64 room_id = 2 [(gogoproto.jsontag) = "room_id"];
// 上报上来的气泡框ID
int64 bubble_id = 3 [(gogoproto.jsontag) = "bubble_id"];
// 上报上来的大航海信息
int64 guard_level = 4 [(gogoproto.jsontag) = "guard_level"];
}
message BubbleGetBubbleResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
string message = 3 [(gogoproto.jsontag) = "message"];
//
Data data = 4 [(gogoproto.jsontag) = "data"];
message Data {
// 当前气泡框ID
int64 bubble = 1 [(gogoproto.jsontag) = "bubble"];
}
}
message BubbleCheckAuthReq {
// 用户uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 房间号
int64 room_id = 2 [(gogoproto.jsontag) = "room_id"];
// 气泡ID
int64 bubble_id = 3 [(gogoproto.jsontag) = "bubble_id"];
}
message BubbleCheckAuthResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
string message = 3 [(gogoproto.jsontag) = "message"];
//
Data data = 4 [(gogoproto.jsontag) = "data"];
message Data {
// 逻辑错误码 -1 非法 0 合法
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 错误原因
string message = 2 [(gogoproto.jsontag) = "message"];
}
}
message BubbleMultiAddReq {
// 用户uid逗号拼接
string uid_list = 1 [(gogoproto.jsontag) = "uid_list"];
// 气泡ID
int64 bubble_id = 2 [(gogoproto.jsontag) = "bubble_id"];
// 过期的时间戳
int64 expired_at = 3 [(gogoproto.jsontag) = "expired_at"];
// 业务描述
string desc = 4 [(gogoproto.jsontag) = "desc"];
// 大区ID
int64 category = 5 [(gogoproto.jsontag) = "category"];
// 分区ID
int64 sub_category = 6 [(gogoproto.jsontag) = "sub_category"];
// 房间号
int64 room_id = 7 [(gogoproto.jsontag) = "room_id"];
}
message BubbleMultiAddResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
string message = 3 [(gogoproto.jsontag) = "message"];
//
Data data = 4 [(gogoproto.jsontag) = "data"];
message UidList {
//
repeated int64 uid = 1 [(gogoproto.jsontag) = "uid"];
}
message Data {
//
UidList success = 1 [(gogoproto.jsontag) = "success"];
//
UidList failed = 2 [(gogoproto.jsontag) = "failed"];
}
}

View File

@@ -0,0 +1,45 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Color.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
// ===============
// Color Interface
// ===============
type ColorRPCClient interface {
// * 获取昵称颜色
//
GetUnameColor(ctx context.Context, req *ColorGetUnameColorReq, opts ...liverpc.CallOption) (resp *ColorGetUnameColorResp, err error)
}
// =====================
// Color Live Rpc Client
// =====================
type colorRPCClient struct {
client *liverpc.Client
}
// NewColorRPCClient creates a client that implements the ColorRPCClient interface.
func NewColorRPCClient(client *liverpc.Client) ColorRPCClient {
return &colorRPCClient{
client: client,
}
}
func (c *colorRPCClient) GetUnameColor(ctx context.Context, in *ColorGetUnameColorReq, opts ...liverpc.CallOption) (*ColorGetUnameColorResp, error) {
out := new(ColorGetUnameColorResp)
err := doRPCRequest(ctx, c.client, 1, "Color.getUnameColor", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}

View File

@@ -0,0 +1,780 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/Color.proto
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type ColorGetUnameColorReq struct {
//
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
//
RoomId int64 `protobuf:"varint,2,opt,name=room_id,json=roomId,proto3" json:"room_id"`
}
func (m *ColorGetUnameColorReq) Reset() { *m = ColorGetUnameColorReq{} }
func (m *ColorGetUnameColorReq) String() string { return proto.CompactTextString(m) }
func (*ColorGetUnameColorReq) ProtoMessage() {}
func (*ColorGetUnameColorReq) Descriptor() ([]byte, []int) {
return fileDescriptor_Color_b3641c1455d1b199, []int{0}
}
func (m *ColorGetUnameColorReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ColorGetUnameColorReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ColorGetUnameColorReq.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *ColorGetUnameColorReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_ColorGetUnameColorReq.Merge(dst, src)
}
func (m *ColorGetUnameColorReq) XXX_Size() int {
return m.Size()
}
func (m *ColorGetUnameColorReq) XXX_DiscardUnknown() {
xxx_messageInfo_ColorGetUnameColorReq.DiscardUnknown(m)
}
var xxx_messageInfo_ColorGetUnameColorReq proto.InternalMessageInfo
func (m *ColorGetUnameColorReq) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *ColorGetUnameColorReq) GetRoomId() int64 {
if m != nil {
return m.RoomId
}
return 0
}
type ColorGetUnameColorResp struct {
//
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
//
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Data *ColorGetUnameColorResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *ColorGetUnameColorResp) Reset() { *m = ColorGetUnameColorResp{} }
func (m *ColorGetUnameColorResp) String() string { return proto.CompactTextString(m) }
func (*ColorGetUnameColorResp) ProtoMessage() {}
func (*ColorGetUnameColorResp) Descriptor() ([]byte, []int) {
return fileDescriptor_Color_b3641c1455d1b199, []int{1}
}
func (m *ColorGetUnameColorResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ColorGetUnameColorResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ColorGetUnameColorResp.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *ColorGetUnameColorResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_ColorGetUnameColorResp.Merge(dst, src)
}
func (m *ColorGetUnameColorResp) XXX_Size() int {
return m.Size()
}
func (m *ColorGetUnameColorResp) XXX_DiscardUnknown() {
xxx_messageInfo_ColorGetUnameColorResp.DiscardUnknown(m)
}
var xxx_messageInfo_ColorGetUnameColorResp proto.InternalMessageInfo
func (m *ColorGetUnameColorResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *ColorGetUnameColorResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *ColorGetUnameColorResp) GetData() *ColorGetUnameColorResp_Data {
if m != nil {
return m.Data
}
return nil
}
type ColorGetUnameColorResp_Data struct {
//
UnameColor string `protobuf:"bytes,1,opt,name=uname_color,json=unameColor,proto3" json:"uname_color"`
}
func (m *ColorGetUnameColorResp_Data) Reset() { *m = ColorGetUnameColorResp_Data{} }
func (m *ColorGetUnameColorResp_Data) String() string { return proto.CompactTextString(m) }
func (*ColorGetUnameColorResp_Data) ProtoMessage() {}
func (*ColorGetUnameColorResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_Color_b3641c1455d1b199, []int{1, 0}
}
func (m *ColorGetUnameColorResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ColorGetUnameColorResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ColorGetUnameColorResp_Data.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *ColorGetUnameColorResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_ColorGetUnameColorResp_Data.Merge(dst, src)
}
func (m *ColorGetUnameColorResp_Data) XXX_Size() int {
return m.Size()
}
func (m *ColorGetUnameColorResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_ColorGetUnameColorResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_ColorGetUnameColorResp_Data proto.InternalMessageInfo
func (m *ColorGetUnameColorResp_Data) GetUnameColor() string {
if m != nil {
return m.UnameColor
}
return ""
}
func init() {
proto.RegisterType((*ColorGetUnameColorReq)(nil), "userext.v1.ColorGetUnameColorReq")
proto.RegisterType((*ColorGetUnameColorResp)(nil), "userext.v1.ColorGetUnameColorResp")
proto.RegisterType((*ColorGetUnameColorResp_Data)(nil), "userext.v1.ColorGetUnameColorResp.Data")
}
func (m *ColorGetUnameColorReq) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ColorGetUnameColorReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintColor(dAtA, i, uint64(m.Uid))
}
if m.RoomId != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintColor(dAtA, i, uint64(m.RoomId))
}
return i, nil
}
func (m *ColorGetUnameColorResp) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ColorGetUnameColorResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintColor(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintColor(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintColor(dAtA, i, uint64(m.Data.Size()))
n1, err := m.Data.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
return i, nil
}
func (m *ColorGetUnameColorResp_Data) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ColorGetUnameColorResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.UnameColor) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintColor(dAtA, i, uint64(len(m.UnameColor)))
i += copy(dAtA[i:], m.UnameColor)
}
return i, nil
}
func encodeVarintColor(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *ColorGetUnameColorReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovColor(uint64(m.Uid))
}
if m.RoomId != 0 {
n += 1 + sovColor(uint64(m.RoomId))
}
return n
}
func (m *ColorGetUnameColorResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovColor(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovColor(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovColor(uint64(l))
}
return n
}
func (m *ColorGetUnameColorResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.UnameColor)
if l > 0 {
n += 1 + l + sovColor(uint64(l))
}
return n
}
func sovColor(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozColor(x uint64) (n int) {
return sovColor(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ColorGetUnameColorReq) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ColorGetUnameColorReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ColorGetUnameColorReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType)
}
m.Uid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Uid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field RoomId", wireType)
}
m.RoomId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.RoomId |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipColor(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthColor
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ColorGetUnameColorResp) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ColorGetUnameColorResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ColorGetUnameColorResp: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
}
m.Code = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Code |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthColor
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Msg = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthColor
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &ColorGetUnameColorResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipColor(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthColor
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ColorGetUnameColorResp_Data) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Data: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field UnameColor", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowColor
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthColor
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.UnameColor = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipColor(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthColor
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipColor(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowColor
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowColor
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowColor
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthColor
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowColor
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipColor(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthColor = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowColor = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/Color.proto", fileDescriptor_Color_b3641c1455d1b199) }
var fileDescriptor_Color_b3641c1455d1b199 = []byte{
// 322 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0x33, 0xd4, 0x77,
0xce, 0xcf, 0xc9, 0x2f, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x2a, 0x2d, 0x4e, 0x2d,
0x4a, 0xad, 0x28, 0xd1, 0x2b, 0x33, 0x94, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b,
0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x2b, 0x49, 0x2a, 0x4d, 0x03, 0xf3, 0xc0,
0x1c, 0x30, 0x0b, 0xa2, 0x55, 0x29, 0x82, 0x4b, 0x14, 0x6c, 0x92, 0x7b, 0x6a, 0x49, 0x68, 0x5e,
0x62, 0x6e, 0x2a, 0x98, 0x13, 0x94, 0x5a, 0x28, 0x24, 0xc9, 0xc5, 0x5c, 0x9a, 0x99, 0x22, 0xc1,
0xa8, 0xc0, 0xa8, 0xc1, 0xec, 0xc4, 0xfe, 0xea, 0x9e, 0x3c, 0x88, 0x1b, 0x04, 0x22, 0x84, 0x54,
0xb8, 0xd8, 0x8b, 0xf2, 0xf3, 0x73, 0xe3, 0x33, 0x53, 0x24, 0x98, 0xc0, 0xd2, 0xdc, 0xaf, 0xee,
0xc9, 0xc3, 0x84, 0x82, 0xd8, 0x40, 0x0c, 0xcf, 0x14, 0xa5, 0x4b, 0x8c, 0x5c, 0x62, 0xd8, 0x8c,
0x2e, 0x2e, 0x10, 0x92, 0xe1, 0x62, 0x49, 0xce, 0x4f, 0x49, 0x85, 0x1a, 0xce, 0xf1, 0xea, 0x9e,
0x3c, 0x98, 0x1f, 0x04, 0x26, 0x41, 0x36, 0xe7, 0x16, 0xa7, 0x83, 0x8d, 0xe6, 0x84, 0xd8, 0x9c,
0x5b, 0x9c, 0x1e, 0x04, 0x22, 0x84, 0x5c, 0xb9, 0x58, 0x52, 0x12, 0x4b, 0x12, 0x25, 0x98, 0x15,
0x18, 0x35, 0xb8, 0x8d, 0xd4, 0xf5, 0x10, 0xfe, 0xd6, 0xc3, 0x6e, 0x95, 0x9e, 0x4b, 0x62, 0x49,
0x22, 0xc4, 0x06, 0x90, 0xc6, 0x20, 0x30, 0x29, 0x65, 0xc1, 0xc5, 0x02, 0x12, 0x17, 0x32, 0xe0,
0xe2, 0x2e, 0x05, 0x29, 0x8f, 0x4f, 0x06, 0xa9, 0x07, 0x3b, 0x87, 0xd3, 0x89, 0xff, 0xd5, 0x3d,
0x79, 0x64, 0xe1, 0x20, 0xae, 0x52, 0xb8, 0x91, 0x46, 0xf1, 0x5c, 0xac, 0x60, 0x86, 0x50, 0x18,
0x17, 0x6f, 0x3a, 0xb2, 0x65, 0x42, 0x8a, 0x84, 0x1c, 0x53, 0x28, 0xa5, 0x44, 0xd8, 0xbd, 0x4e,
0x32, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7,
0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xc5, 0x54, 0x66, 0x98, 0xc4,
0x06, 0x8e, 0x34, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3d, 0xc9, 0x97, 0x5e, 0x01, 0x02,
0x00, 0x00,
}

View File

@@ -0,0 +1,38 @@
syntax = "proto3";
package userext.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Color {
/** 获取昵称颜色
*
*/
rpc getUnameColor (ColorGetUnameColorReq) returns (ColorGetUnameColorResp);
}
message ColorGetUnameColorReq {
//
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
//
int64 room_id = 2 [(gogoproto.jsontag) = "room_id"];
}
message ColorGetUnameColorResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
//
string uname_color = 1 [(gogoproto.jsontag) = "uname_color"];
}
}

View File

@@ -0,0 +1,71 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/DanmuConf.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
// ===================
// DanmuConf Interface
// ===================
type DanmuConfRPCClient interface {
// * 获取个人弹幕配置
//
GetAll(ctx context.Context, req *DanmuConfGetAllReq, opts ...liverpc.CallOption) (resp *DanmuConfGetAllResp, err error)
// * 添加用户可佩戴的的弹幕配置特权
//
AddByType(ctx context.Context, req *DanmuConfAddByTypeReq, opts ...liverpc.CallOption) (resp *DanmuConfAddByTypeResp, err error)
// * 获取所有弹幕特权
//
GetAllPrivilege(ctx context.Context, req *DanmuConfGetAllPrivilegeReq, opts ...liverpc.CallOption) (resp *DanmuConfGetAllPrivilegeResp, err error)
}
// =========================
// DanmuConf Live Rpc Client
// =========================
type danmuConfRPCClient struct {
client *liverpc.Client
}
// NewDanmuConfRPCClient creates a client that implements the DanmuConfRPCClient interface.
func NewDanmuConfRPCClient(client *liverpc.Client) DanmuConfRPCClient {
return &danmuConfRPCClient{
client: client,
}
}
func (c *danmuConfRPCClient) GetAll(ctx context.Context, in *DanmuConfGetAllReq, opts ...liverpc.CallOption) (*DanmuConfGetAllResp, error) {
out := new(DanmuConfGetAllResp)
err := doRPCRequest(ctx, c.client, 1, "DanmuConf.getAll", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *danmuConfRPCClient) AddByType(ctx context.Context, in *DanmuConfAddByTypeReq, opts ...liverpc.CallOption) (*DanmuConfAddByTypeResp, error) {
out := new(DanmuConfAddByTypeResp)
err := doRPCRequest(ctx, c.client, 1, "DanmuConf.addByType", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *danmuConfRPCClient) GetAllPrivilege(ctx context.Context, in *DanmuConfGetAllPrivilegeReq, opts ...liverpc.CallOption) (*DanmuConfGetAllPrivilegeResp, error) {
out := new(DanmuConfGetAllPrivilegeResp)
err := doRPCRequest(ctx, c.client, 1, "DanmuConf.getAllPrivilege", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,116 @@
syntax = "proto3";
package userext.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service DanmuConf {
/** 获取个人弹幕配置
*
*/
rpc getAll (DanmuConfGetAllReq) returns (DanmuConfGetAllResp);
/** 添加用户可佩戴的的弹幕配置特权
*
*/
rpc addByType (DanmuConfAddByTypeReq) returns (DanmuConfAddByTypeResp);
/** 获取所有弹幕特权
*
*/
rpc getAllPrivilege (DanmuConfGetAllPrivilegeReq) returns (DanmuConfGetAllPrivilegeResp);
}
message DanmuConfGetAllReq {
// 房间号
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
// 用户id(优先取登录态)
int64 uid = 2 [(gogoproto.jsontag) = "uid"];
}
message DanmuConfGetAllResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// 模式
int64 mode = 1 [(gogoproto.jsontag) = "mode"];
// 颜色
int64 color = 2 [(gogoproto.jsontag) = "color"];
// 长度
int64 length = 3 [(gogoproto.jsontag) = "length"];
// roomid
int64 roomid = 4 [(gogoproto.jsontag) = "roomid"];
}
}
message DanmuConfAddByTypeReq {
// color:颜色, mode:弹幕模式, length:弹幕长度
string type = 1 [(gogoproto.jsontag) = "type"];
// uid
int64 uid = 2 [(gogoproto.jsontag) = "uid"];
// 房间号,传0为全局
int64 roomid = 3 [(gogoproto.jsontag) = "roomid"];
// 不填则为永久
int64 expire = 4 [(gogoproto.jsontag) = "expire"];
// 配置值
int64 value = 5 [(gogoproto.jsontag) = "value"];
}
message DanmuConfAddByTypeResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// true:操作成功 false:操作失败
bool result = 1 [(gogoproto.jsontag) = "result"];
}
}
message DanmuConfGetAllPrivilegeReq {
// 用户id
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
}
message DanmuConfGetAllPrivilegeResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
string message = 3 [(gogoproto.jsontag) = "message"];
//
repeated Data data = 4 [(gogoproto.jsontag) = "data"];
message Data {
// UID
string uid = 1 [(gogoproto.jsontag) = "uid"];
// roomID
string roomid = 2 [(gogoproto.jsontag) = "roomid"];
// 0color1mode2length
string type = 3 [(gogoproto.jsontag) = "type"];
//
string value = 4 [(gogoproto.jsontag) = "value"];
// 初始0佩戴中1
string status = 5 [(gogoproto.jsontag) = "status"];
//
string expired_at = 6 [(gogoproto.jsontag) = "expired_at"];
}
}

View File

@@ -0,0 +1,45 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/GrayRule.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
// ==================
// GrayRule Interface
// ==================
type GrayRuleRPCClient interface {
// * 获取灰度策略配置
//
GetByMark(ctx context.Context, req *GrayRuleGetByMarkReq, opts ...liverpc.CallOption) (resp *GrayRuleGetByMarkResp, err error)
}
// ========================
// GrayRule Live Rpc Client
// ========================
type grayRuleRPCClient struct {
client *liverpc.Client
}
// NewGrayRuleRPCClient creates a client that implements the GrayRuleRPCClient interface.
func NewGrayRuleRPCClient(client *liverpc.Client) GrayRuleRPCClient {
return &grayRuleRPCClient{
client: client,
}
}
func (c *grayRuleRPCClient) GetByMark(ctx context.Context, in *GrayRuleGetByMarkReq, opts ...liverpc.CallOption) (*GrayRuleGetByMarkResp, error) {
out := new(GrayRuleGetByMarkResp)
err := doRPCRequest(ctx, c.client, 1, "GrayRule.getByMark", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}

View File

@@ -0,0 +1,888 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/GrayRule.proto
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type GrayRuleGetByMarkReq struct {
//
Mark string `protobuf:"bytes,1,opt,name=mark,proto3" json:"mark"`
}
func (m *GrayRuleGetByMarkReq) Reset() { *m = GrayRuleGetByMarkReq{} }
func (m *GrayRuleGetByMarkReq) String() string { return proto.CompactTextString(m) }
func (*GrayRuleGetByMarkReq) ProtoMessage() {}
func (*GrayRuleGetByMarkReq) Descriptor() ([]byte, []int) {
return fileDescriptor_GrayRule_7e8c31590802899d, []int{0}
}
func (m *GrayRuleGetByMarkReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GrayRuleGetByMarkReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GrayRuleGetByMarkReq.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *GrayRuleGetByMarkReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_GrayRuleGetByMarkReq.Merge(dst, src)
}
func (m *GrayRuleGetByMarkReq) XXX_Size() int {
return m.Size()
}
func (m *GrayRuleGetByMarkReq) XXX_DiscardUnknown() {
xxx_messageInfo_GrayRuleGetByMarkReq.DiscardUnknown(m)
}
var xxx_messageInfo_GrayRuleGetByMarkReq proto.InternalMessageInfo
func (m *GrayRuleGetByMarkReq) GetMark() string {
if m != nil {
return m.Mark
}
return ""
}
type GrayRuleGetByMarkResp struct {
// 返回code
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
// 返回msg
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Data *GrayRuleGetByMarkResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *GrayRuleGetByMarkResp) Reset() { *m = GrayRuleGetByMarkResp{} }
func (m *GrayRuleGetByMarkResp) String() string { return proto.CompactTextString(m) }
func (*GrayRuleGetByMarkResp) ProtoMessage() {}
func (*GrayRuleGetByMarkResp) Descriptor() ([]byte, []int) {
return fileDescriptor_GrayRule_7e8c31590802899d, []int{1}
}
func (m *GrayRuleGetByMarkResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GrayRuleGetByMarkResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GrayRuleGetByMarkResp.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *GrayRuleGetByMarkResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_GrayRuleGetByMarkResp.Merge(dst, src)
}
func (m *GrayRuleGetByMarkResp) XXX_Size() int {
return m.Size()
}
func (m *GrayRuleGetByMarkResp) XXX_DiscardUnknown() {
xxx_messageInfo_GrayRuleGetByMarkResp.DiscardUnknown(m)
}
var xxx_messageInfo_GrayRuleGetByMarkResp proto.InternalMessageInfo
func (m *GrayRuleGetByMarkResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *GrayRuleGetByMarkResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *GrayRuleGetByMarkResp) GetData() *GrayRuleGetByMarkResp_Data {
if m != nil {
return m.Data
}
return nil
}
type GrayRuleGetByMarkResp_Data struct {
//
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"`
//
Mark string `protobuf:"bytes,2,opt,name=mark,proto3" json:"mark"`
//
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"`
//
Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content"`
}
func (m *GrayRuleGetByMarkResp_Data) Reset() { *m = GrayRuleGetByMarkResp_Data{} }
func (m *GrayRuleGetByMarkResp_Data) String() string { return proto.CompactTextString(m) }
func (*GrayRuleGetByMarkResp_Data) ProtoMessage() {}
func (*GrayRuleGetByMarkResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_GrayRule_7e8c31590802899d, []int{1, 0}
}
func (m *GrayRuleGetByMarkResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GrayRuleGetByMarkResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GrayRuleGetByMarkResp_Data.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *GrayRuleGetByMarkResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_GrayRuleGetByMarkResp_Data.Merge(dst, src)
}
func (m *GrayRuleGetByMarkResp_Data) XXX_Size() int {
return m.Size()
}
func (m *GrayRuleGetByMarkResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_GrayRuleGetByMarkResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_GrayRuleGetByMarkResp_Data proto.InternalMessageInfo
func (m *GrayRuleGetByMarkResp_Data) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *GrayRuleGetByMarkResp_Data) GetMark() string {
if m != nil {
return m.Mark
}
return ""
}
func (m *GrayRuleGetByMarkResp_Data) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *GrayRuleGetByMarkResp_Data) GetContent() string {
if m != nil {
return m.Content
}
return ""
}
func init() {
proto.RegisterType((*GrayRuleGetByMarkReq)(nil), "userext.v1.GrayRuleGetByMarkReq")
proto.RegisterType((*GrayRuleGetByMarkResp)(nil), "userext.v1.GrayRuleGetByMarkResp")
proto.RegisterType((*GrayRuleGetByMarkResp_Data)(nil), "userext.v1.GrayRuleGetByMarkResp.Data")
}
func (m *GrayRuleGetByMarkReq) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GrayRuleGetByMarkReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Mark) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintGrayRule(dAtA, i, uint64(len(m.Mark)))
i += copy(dAtA[i:], m.Mark)
}
return i, nil
}
func (m *GrayRuleGetByMarkResp) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GrayRuleGetByMarkResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintGrayRule(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintGrayRule(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintGrayRule(dAtA, i, uint64(m.Data.Size()))
n1, err := m.Data.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
return i, nil
}
func (m *GrayRuleGetByMarkResp_Data) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GrayRuleGetByMarkResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Id != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintGrayRule(dAtA, i, uint64(m.Id))
}
if len(m.Mark) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintGrayRule(dAtA, i, uint64(len(m.Mark)))
i += copy(dAtA[i:], m.Mark)
}
if len(m.Name) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintGrayRule(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if len(m.Content) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintGrayRule(dAtA, i, uint64(len(m.Content)))
i += copy(dAtA[i:], m.Content)
}
return i, nil
}
func encodeVarintGrayRule(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *GrayRuleGetByMarkReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Mark)
if l > 0 {
n += 1 + l + sovGrayRule(uint64(l))
}
return n
}
func (m *GrayRuleGetByMarkResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovGrayRule(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovGrayRule(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovGrayRule(uint64(l))
}
return n
}
func (m *GrayRuleGetByMarkResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Id != 0 {
n += 1 + sovGrayRule(uint64(m.Id))
}
l = len(m.Mark)
if l > 0 {
n += 1 + l + sovGrayRule(uint64(l))
}
l = len(m.Name)
if l > 0 {
n += 1 + l + sovGrayRule(uint64(l))
}
l = len(m.Content)
if l > 0 {
n += 1 + l + sovGrayRule(uint64(l))
}
return n
}
func sovGrayRule(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozGrayRule(x uint64) (n int) {
return sovGrayRule(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GrayRuleGetByMarkReq) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GrayRuleGetByMarkReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GrayRuleGetByMarkReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Mark", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGrayRule
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Mark = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGrayRule(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGrayRule
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GrayRuleGetByMarkResp) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GrayRuleGetByMarkResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GrayRuleGetByMarkResp: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
}
m.Code = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Code |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGrayRule
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Msg = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGrayRule
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &GrayRuleGetByMarkResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGrayRule(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGrayRule
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GrayRuleGetByMarkResp_Data) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Data: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Mark", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGrayRule
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Mark = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGrayRule
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGrayRule
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGrayRule
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Content = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGrayRule(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGrayRule
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGrayRule(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGrayRule
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGrayRule
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGrayRule
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthGrayRule
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGrayRule
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipGrayRule(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthGrayRule = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGrayRule = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/GrayRule.proto", fileDescriptor_GrayRule_7e8c31590802899d) }
var fileDescriptor_GrayRule_7e8c31590802899d = []byte{
// 333 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x51, 0x4d, 0x4f, 0xc2, 0x40,
0x10, 0x65, 0x97, 0x86, 0x8f, 0xe1, 0xe4, 0x46, 0x4d, 0x25, 0xa4, 0x45, 0x12, 0x0d, 0x17, 0x4b,
0x40, 0x7f, 0x01, 0x21, 0xe1, 0x64, 0x62, 0xf6, 0x68, 0xbc, 0x2c, 0x74, 0xad, 0x0d, 0x96, 0x85,
0xb2, 0x25, 0x72, 0xf4, 0x1f, 0x78, 0xf6, 0x17, 0x79, 0xe4, 0xe8, 0xa9, 0x31, 0x70, 0xeb, 0xaf,
0x30, 0x3b, 0x50, 0xbd, 0x90, 0x70, 0x79, 0x99, 0xb7, 0x33, 0x6f, 0xe6, 0xbd, 0x2c, 0x9c, 0x2c,
0xbb, 0x9d, 0x61, 0x2c, 0x56, 0x3c, 0x79, 0x95, 0xde, 0x2c, 0x56, 0x5a, 0x31, 0x48, 0x16, 0x32,
0x96, 0x6f, 0xda, 0x5b, 0x76, 0xeb, 0x37, 0x41, 0xa8, 0x5f, 0x92, 0x91, 0x37, 0x56, 0x51, 0x27,
0x50, 0x81, 0xea, 0xe0, 0xc8, 0x28, 0x79, 0x46, 0x86, 0x04, 0xab, 0x9d, 0xb4, 0x75, 0x07, 0xa7,
0xf9, 0xb2, 0xa1, 0xd4, 0xfd, 0xd5, 0xbd, 0x88, 0x27, 0x5c, 0xce, 0x59, 0x03, 0xac, 0x48, 0xc4,
0x13, 0x9b, 0x34, 0x49, 0xbb, 0xda, 0xaf, 0x64, 0xa9, 0x8b, 0x9c, 0x23, 0xb6, 0x3e, 0x29, 0x9c,
0x1d, 0x90, 0x2d, 0x66, 0x46, 0x37, 0x56, 0xbe, 0x44, 0x5d, 0x71, 0xa7, 0x33, 0x9c, 0x23, 0xb2,
0x0b, 0x28, 0x46, 0x8b, 0xc0, 0xa6, 0xb8, 0xb4, 0x9c, 0xa5, 0xae, 0xa1, 0xdc, 0x00, 0x1b, 0x80,
0xe5, 0x0b, 0x2d, 0xec, 0x62, 0x93, 0xb4, 0x6b, 0xbd, 0x6b, 0xef, 0x3f, 0x92, 0x77, 0xf0, 0x92,
0x37, 0x10, 0x5a, 0xec, 0x0e, 0x18, 0x1d, 0x47, 0xac, 0xbf, 0x13, 0xb0, 0x4c, 0x83, 0x9d, 0x03,
0x0d, 0xfd, 0xbd, 0x8b, 0x52, 0x96, 0xba, 0x34, 0xf4, 0x39, 0x0d, 0xfd, 0xbf, 0x5c, 0xf4, 0x50,
0x2e, 0xd3, 0x9d, 0x8a, 0x48, 0xa2, 0x89, 0x7d, 0xd7, 0x70, 0x8e, 0xc8, 0xae, 0xa0, 0x3c, 0x56,
0x53, 0x2d, 0xa7, 0xda, 0xb6, 0x70, 0xa0, 0x96, 0xa5, 0x6e, 0xfe, 0xc4, 0xf3, 0xa2, 0xf7, 0x04,
0x95, 0xdc, 0x31, 0x7b, 0x80, 0x6a, 0x90, 0xbb, 0x66, 0xcd, 0x23, 0xa1, 0xe6, 0xf5, 0xcb, 0xa3,
0xb1, 0xfb, 0x8d, 0xaf, 0x8d, 0x43, 0xd6, 0x1b, 0x87, 0xfc, 0x6c, 0x1c, 0xf2, 0xb1, 0x75, 0x0a,
0xeb, 0xad, 0x53, 0xf8, 0xde, 0x3a, 0x85, 0x47, 0xba, 0xec, 0x8e, 0x4a, 0xf8, 0xab, 0xb7, 0xbf,
0x01, 0x00, 0x00, 0xff, 0xff, 0x96, 0xcb, 0x53, 0xa2, 0x25, 0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
package userext.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service GrayRule {
/** 获取灰度策略配置
*
*/
rpc getByMark (GrayRuleGetByMarkReq) returns (GrayRuleGetByMarkResp);
}
message GrayRuleGetByMarkReq {
//
string mark = 1 [(gogoproto.jsontag) = "mark"];
}
message GrayRuleGetByMarkResp {
// 返回code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// 返回msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
//
int64 id = 1 [(gogoproto.jsontag) = "id"];
//
string mark = 2 [(gogoproto.jsontag) = "mark"];
//
string name = 3 [(gogoproto.jsontag) = "name"];
//
string content = 4 [(gogoproto.jsontag) = "content"];
}
}

View File

@@ -0,0 +1,84 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Remind.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
// ================
// Remind Interface
// ================
type RemindRPCClient interface {
// * 预约、取消提醒
//
Operate(ctx context.Context, req *RemindOperateReq, opts ...liverpc.CallOption) (resp *RemindOperateResp, err error)
// * 查询预约状态
//
Query(ctx context.Context, req *RemindQueryReq, opts ...liverpc.CallOption) (resp *RemindQueryResp, err error)
// * 预约、取消提醒
//
Submit(ctx context.Context, req *RemindSubmitReq, opts ...liverpc.CallOption) (resp *RemindSubmitResp, err error)
// * 查询预约状态
//
Get(ctx context.Context, req *RemindGetReq, opts ...liverpc.CallOption) (resp *RemindGetResp, err error)
}
// ======================
// Remind Live Rpc Client
// ======================
type remindRPCClient struct {
client *liverpc.Client
}
// NewRemindRPCClient creates a client that implements the RemindRPCClient interface.
func NewRemindRPCClient(client *liverpc.Client) RemindRPCClient {
return &remindRPCClient{
client: client,
}
}
func (c *remindRPCClient) Operate(ctx context.Context, in *RemindOperateReq, opts ...liverpc.CallOption) (*RemindOperateResp, error) {
out := new(RemindOperateResp)
err := doRPCRequest(ctx, c.client, 1, "Remind.operate", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *remindRPCClient) Query(ctx context.Context, in *RemindQueryReq, opts ...liverpc.CallOption) (*RemindQueryResp, error) {
out := new(RemindQueryResp)
err := doRPCRequest(ctx, c.client, 1, "Remind.query", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *remindRPCClient) Submit(ctx context.Context, in *RemindSubmitReq, opts ...liverpc.CallOption) (*RemindSubmitResp, error) {
out := new(RemindSubmitResp)
err := doRPCRequest(ctx, c.client, 1, "Remind.submit", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *remindRPCClient) Get(ctx context.Context, in *RemindGetReq, opts ...liverpc.CallOption) (*RemindGetResp, error) {
out := new(RemindGetResp)
err := doRPCRequest(ctx, c.client, 1, "Remind.get", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,135 @@
syntax = "proto3";
package userext.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Remind {
/** 预约、取消提醒
*
*/
rpc operate (RemindOperateReq) returns (RemindOperateResp);
/** 查询预约状态
*
*/
rpc query (RemindQueryReq) returns (RemindQueryResp);
/** 预约、取消提醒
*
*/
rpc submit (RemindSubmitReq) returns (RemindSubmitResp);
/** 查询预约状态
*
*/
rpc get (RemindGetReq) returns (RemindGetResp);
}
message RemindOperateReq {
// 活动 id
int64 aid = 1 [(gogoproto.jsontag) = "aid"];
// 0.取消 1.预约
int64 action = 2 [(gogoproto.jsontag) = "action"];
}
message RemindOperateResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg 
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message RemindQueryReq {
// 活动 id
int64 aid = 1 [(gogoproto.jsontag) = "aid"];
}
message RemindQueryResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg 
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// 活动 ID
int64 aid = 1 [(gogoproto.jsontag) = "aid"];
// 1.已经预约 2.没有预约
int64 status = 2 [(gogoproto.jsontag) = "status"];
}
}
message RemindSubmitReq {
// 事件类型
int64 type = 1 [(gogoproto.jsontag) = "type"];
// 事件 id (多个用逗号拼接)
string event_id = 2 [(gogoproto.jsontag) = "event_id"];
// 提交来源
int64 source = 3 [(gogoproto.jsontag) = "source"];
// 1.预约 2.取消预约
int64 action = 4 [(gogoproto.jsontag) = "action"];
}
message RemindSubmitResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg (预约成功,已过期,未开始)
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message RemindGetReq {
// 事件类型
int64 type = 1 [(gogoproto.jsontag) = "type"];
// 事件 id
string event_id = 2 [(gogoproto.jsontag) = "event_id"];
}
message RemindGetResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg 
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message List {
// 事件类型
int64 type = 1 [(gogoproto.jsontag) = "type"];
// 活动 ID
int64 event_id = 2 [(gogoproto.jsontag) = "event_id"];
// 1.已经预约 2.没有预约
int64 status = 3 [(gogoproto.jsontag) = "status"];
// 预约的时间
string date = 4 [(gogoproto.jsontag) = "date"];
}
message Data {
//
repeated List list = 1 [(gogoproto.jsontag) = "list"];
}
}

View File

@@ -0,0 +1,45 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Tag.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
// =============
// Tag Interface
// =============
type TagRPCClient interface {
// * 查询预约状态
//
Test(ctx context.Context, req *TagTestReq, opts ...liverpc.CallOption) (resp *TagTestResp, err error)
}
// ===================
// Tag Live Rpc Client
// ===================
type tagRPCClient struct {
client *liverpc.Client
}
// NewTagRPCClient creates a client that implements the TagRPCClient interface.
func NewTagRPCClient(client *liverpc.Client) TagRPCClient {
return &tagRPCClient{
client: client,
}
}
func (c *tagRPCClient) Test(ctx context.Context, in *TagTestReq, opts ...liverpc.CallOption) (*TagTestResp, error) {
out := new(TagTestResp)
err := doRPCRequest(ctx, c.client, 1, "Tag.test", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}

View File

@@ -0,0 +1,766 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/Tag.proto
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type TagTestReq struct {
// 活动 id
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"`
}
func (m *TagTestReq) Reset() { *m = TagTestReq{} }
func (m *TagTestReq) String() string { return proto.CompactTextString(m) }
func (*TagTestReq) ProtoMessage() {}
func (*TagTestReq) Descriptor() ([]byte, []int) {
return fileDescriptor_Tag_06332839907eeb47, []int{0}
}
func (m *TagTestReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TagTestReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TagTestReq.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *TagTestReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_TagTestReq.Merge(dst, src)
}
func (m *TagTestReq) XXX_Size() int {
return m.Size()
}
func (m *TagTestReq) XXX_DiscardUnknown() {
xxx_messageInfo_TagTestReq.DiscardUnknown(m)
}
var xxx_messageInfo_TagTestReq proto.InternalMessageInfo
func (m *TagTestReq) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
type TagTestResp struct {
// code
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
// msg
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Data *TagTestResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *TagTestResp) Reset() { *m = TagTestResp{} }
func (m *TagTestResp) String() string { return proto.CompactTextString(m) }
func (*TagTestResp) ProtoMessage() {}
func (*TagTestResp) Descriptor() ([]byte, []int) {
return fileDescriptor_Tag_06332839907eeb47, []int{1}
}
func (m *TagTestResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TagTestResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TagTestResp.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *TagTestResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_TagTestResp.Merge(dst, src)
}
func (m *TagTestResp) XXX_Size() int {
return m.Size()
}
func (m *TagTestResp) XXX_DiscardUnknown() {
xxx_messageInfo_TagTestResp.DiscardUnknown(m)
}
var xxx_messageInfo_TagTestResp proto.InternalMessageInfo
func (m *TagTestResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *TagTestResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *TagTestResp) GetData() *TagTestResp_Data {
if m != nil {
return m.Data
}
return nil
}
type TagTestResp_Data struct {
// 活动 ID
Aid int64 `protobuf:"varint,1,opt,name=aid,proto3" json:"aid"`
// 1.已经预约 2.没有预约
Action int64 `protobuf:"varint,2,opt,name=action,proto3" json:"action"`
}
func (m *TagTestResp_Data) Reset() { *m = TagTestResp_Data{} }
func (m *TagTestResp_Data) String() string { return proto.CompactTextString(m) }
func (*TagTestResp_Data) ProtoMessage() {}
func (*TagTestResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_Tag_06332839907eeb47, []int{1, 0}
}
func (m *TagTestResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TagTestResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TagTestResp_Data.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *TagTestResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_TagTestResp_Data.Merge(dst, src)
}
func (m *TagTestResp_Data) XXX_Size() int {
return m.Size()
}
func (m *TagTestResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_TagTestResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_TagTestResp_Data proto.InternalMessageInfo
func (m *TagTestResp_Data) GetAid() int64 {
if m != nil {
return m.Aid
}
return 0
}
func (m *TagTestResp_Data) GetAction() int64 {
if m != nil {
return m.Action
}
return 0
}
func init() {
proto.RegisterType((*TagTestReq)(nil), "userext.v1.TagTestReq")
proto.RegisterType((*TagTestResp)(nil), "userext.v1.TagTestResp")
proto.RegisterType((*TagTestResp_Data)(nil), "userext.v1.TagTestResp.Data")
}
func (m *TagTestReq) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *TagTestReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Id != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintTag(dAtA, i, uint64(m.Id))
}
return i, nil
}
func (m *TagTestResp) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *TagTestResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintTag(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintTag(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintTag(dAtA, i, uint64(m.Data.Size()))
n1, err := m.Data.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
return i, nil
}
func (m *TagTestResp_Data) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *TagTestResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Aid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintTag(dAtA, i, uint64(m.Aid))
}
if m.Action != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintTag(dAtA, i, uint64(m.Action))
}
return i, nil
}
func encodeVarintTag(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *TagTestReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Id != 0 {
n += 1 + sovTag(uint64(m.Id))
}
return n
}
func (m *TagTestResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovTag(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovTag(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovTag(uint64(l))
}
return n
}
func (m *TagTestResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Aid != 0 {
n += 1 + sovTag(uint64(m.Aid))
}
if m.Action != 0 {
n += 1 + sovTag(uint64(m.Action))
}
return n
}
func sovTag(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozTag(x uint64) (n int) {
return sovTag(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *TagTestReq) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: TagTestReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TagTestReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipTag(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTag
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *TagTestResp) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: TagTestResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TagTestResp: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
}
m.Code = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Code |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTag
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Msg = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthTag
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &TagTestResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTag(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTag
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *TagTestResp_Data) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Data: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Aid", wireType)
}
m.Aid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Aid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
}
m.Action = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTag
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Action |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipTag(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTag
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipTag(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTag
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTag
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTag
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthTag
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTag
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipTag(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthTag = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowTag = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/Tag.proto", fileDescriptor_Tag_06332839907eeb47) }
var fileDescriptor_Tag_06332839907eeb47 = []byte{
// 302 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0xf3, 0x30,
0x14, 0x85, 0xeb, 0x24, 0xea, 0xff, 0x73, 0xcb, 0xe4, 0xa1, 0x94, 0xaa, 0x72, 0xaa, 0x8a, 0xa1,
0x0b, 0xae, 0x5a, 0x06, 0x24, 0x06, 0x86, 0x08, 0x5e, 0xc0, 0xca, 0xc4, 0xe6, 0xd6, 0xc6, 0x78,
0x28, 0x6e, 0x1b, 0x27, 0xe2, 0x31, 0x78, 0x2c, 0xd8, 0x3a, 0x32, 0x45, 0x28, 0xd9, 0xf2, 0x14,
0xc8, 0x6e, 0x54, 0x18, 0x60, 0x39, 0xf6, 0xb9, 0x3a, 0x3e, 0xfe, 0x74, 0xe1, 0xb4, 0x98, 0xcf,
0x52, 0xae, 0xe8, 0x66, 0x67, 0xac, 0xc1, 0x90, 0x67, 0x72, 0x27, 0x5f, 0x2c, 0x2d, 0xe6, 0xc3,
0x4b, 0xa5, 0xed, 0x53, 0xbe, 0xa4, 0x2b, 0xb3, 0x9e, 0x29, 0xa3, 0xcc, 0xcc, 0x47, 0x96, 0xf9,
0xa3, 0x77, 0xde, 0xf8, 0xdb, 0xe1, 0xe9, 0xe4, 0x02, 0x20, 0xe5, 0x2a, 0x95, 0x99, 0x65, 0x72,
0x8b, 0xfb, 0x10, 0x68, 0x31, 0x40, 0x63, 0x34, 0x0d, 0x93, 0x6e, 0x53, 0xc6, 0x81, 0x16, 0x2c,
0xd0, 0x62, 0xf2, 0x8e, 0xa0, 0x77, 0x8c, 0x65, 0x1b, 0x3c, 0x82, 0x68, 0x65, 0x84, 0x6c, 0x93,
0xff, 0x9b, 0x32, 0xf6, 0x9e, 0x79, 0xc5, 0xe7, 0x10, 0xae, 0x33, 0x35, 0x08, 0xc6, 0x68, 0x7a,
0x92, 0xfc, 0x6b, 0xca, 0xd8, 0x59, 0xe6, 0x04, 0xdf, 0x40, 0x24, 0xb8, 0xe5, 0x83, 0x70, 0x8c,
0xa6, 0xbd, 0xc5, 0x88, 0x7e, 0x83, 0xd3, 0x1f, 0xfd, 0xf4, 0x8e, 0x5b, 0x7e, 0xa8, 0x75, 0x69,
0xe6, 0x75, 0x78, 0x0f, 0x91, 0x9b, 0xbb, 0x7a, 0x7e, 0xa4, 0xf4, 0xf5, 0x5c, 0x0b, 0xe6, 0x04,
0x4f, 0xa0, 0xcb, 0x57, 0x56, 0x9b, 0x67, 0xff, 0x79, 0x98, 0x40, 0x53, 0xc6, 0xed, 0x84, 0xb5,
0xe7, 0xe2, 0x16, 0xc2, 0x94, 0x2b, 0x7c, 0x0d, 0x91, 0x95, 0x99, 0xc5, 0xfd, 0x5f, 0x19, 0xb6,
0xc3, 0xb3, 0x3f, 0xd8, 0x92, 0xd1, 0x5b, 0x45, 0xd0, 0xbe, 0x22, 0xe8, 0xb3, 0x22, 0xe8, 0xb5,
0x26, 0x9d, 0x7d, 0x4d, 0x3a, 0x1f, 0x35, 0xe9, 0x3c, 0x04, 0xc5, 0x7c, 0xd9, 0xf5, 0x6b, 0xbd,
0xfa, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x96, 0x74, 0x73, 0xcb, 0xa1, 0x01, 0x00, 0x00,
}

View File

@@ -0,0 +1,38 @@
syntax = "proto3";
package userext.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Tag {
/** 查询预约状态
*
*/
rpc test (TagTestReq) returns (TagTestResp);
}
message TagTestReq {
// 活动 id
int64 id = 1 [(gogoproto.jsontag) = "id"];
}
message TagTestResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg 
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// 活动 ID
int64 aid = 1 [(gogoproto.jsontag) = "aid"];
// 1.已经预约 2.没有预约
int64 action = 2 [(gogoproto.jsontag) = "action"];
}
}