Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 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/rc/api/liverpc",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/live/rc/api/liverpc/v0:go_default_library",
"//app/service/live/rc/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/rc/api/liverpc/v0:all-srcs",
"//app/service/live/rc/api/liverpc/v1:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,52 @@
// 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/rc/api/liverpc/v0"
"go-common/app/service/live/rc/api/liverpc/v1"
"go-common/library/net/rpc/liverpc"
)
// Client that represents a liverpc rc service api
type Client struct {
cli *liverpc.Client
// V0Broadcast presents the controller in liverpc
V0Broadcast v0.BroadcastRPCClient
// V1Achv presents the controller in liverpc
V1Achv v1.AchvRPCClient
// V1TitleStuff presents the controller in liverpc
V1TitleStuff v1.TitleStuffRPCClient
// V1UserTitle presents the controller in liverpc
V1UserTitle v1.UserTitleRPCClient
}
// DiscoveryAppId the discovery id is not the tree name
var DiscoveryAppId = "live.rc"
// New a Client that represents a liverpc live.rc 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.V0Broadcast = v0.NewBroadcastRPCClient(realCli)
cli.V1Achv = v1.NewAchvRPCClient(realCli)
cli.V1TitleStuff = v1.NewTitleStuffRPCClient(realCli)
cli.V1UserTitle = v1.NewUserTitleRPCClient(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 = ["Broadcast.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/rc/api/liverpc/v0",
proto = ":v0_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = ["Broadcast.liverpc.go"],
embed = [":v0_go_proto"],
importpath = "go-common/app/service/live/rc/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,62 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v0/Broadcast.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/Broadcast.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:
// ===================
// Broadcast Interface
// ===================
type BroadcastRPCClient interface {
// * 发送 NOTICE_MSG 广播接口
// 如果有定义默认样式的, 且如果样式字段没有传, 会被补全; 最终输出字段格式参考 http://info.bilibili.co/pages/viewpage.action?pageId=3693681#id-%E5%BC%B9%E5%B9%95%E9%80%9A%E7%9F%A5%E5%8D%8F%E8%AE%AE-%E6%96%B0%E7%89%88%E5%BC%B9%E5%B9%95%E9%80%9A%E7%9F%A5%E5%8D%8F%E8%AE%AE
SendNoticeMsg(ctx context.Context, req *BroadcastSendNoticeMsgReq, opts ...liverpc.CallOption) (resp *BroadcastSendNoticeMsgResp, err error)
}
// =========================
// Broadcast Live Rpc Client
// =========================
type broadcastRPCClient struct {
client *liverpc.Client
}
// NewBroadcastRPCClient creates a client that implements the BroadcastRPCClient interface.
func NewBroadcastRPCClient(client *liverpc.Client) BroadcastRPCClient {
return &broadcastRPCClient{
client: client,
}
}
func (c *broadcastRPCClient) SendNoticeMsg(ctx context.Context, in *BroadcastSendNoticeMsgReq, opts ...liverpc.CallOption) (*BroadcastSendNoticeMsgResp, error) {
out := new(BroadcastSendNoticeMsgResp)
err := doRPCRequest(ctx, c.client, 0, "Broadcast.send_notice_msg", 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,86 @@
syntax = "proto3";
package rc.v0;
option go_package = "v0";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Broadcast {
/** 发送 NOTICE_MSG 广播接口
* 如果有定义默认样式的, 且如果样式字段没有传, 会被补全; 最终输出字段格式参考 http://info.bilibili.co/pages/viewpage.action?pageId=3693681#id-%E5%BC%B9%E5%B9%95%E9%80%9A%E7%9F%A5%E5%8D%8F%E8%AE%AE-%E6%96%B0%E7%89%88%E5%BC%B9%E5%B9%95%E9%80%9A%E7%9F%A5%E5%8D%8F%E8%AE%AE
*/
rpc send_notice_msg (BroadcastSendNoticeMsgReq) returns (BroadcastSendNoticeMsgResp);
}
message BroadcastSendNoticeMsgReq {
// 场景常数 1: 全局 2: 一级分区 3: 二级分区 4: 房间
string scene_key = 1 [(gogoproto.jsontag) = "scene_key"];
// 场景值(一级分区号, 二级分区号, 房间号; 当scene_key = 1时此值被忽略)
string scene_value = 2 [(gogoproto.jsontag) = "scene_value"];
//
MSG msg = 3 [(gogoproto.jsontag) = "msg"];
message FullData {
// 头图
string head_icon = 1 [(gogoproto.jsontag) = "head_icon"];
// 尾图
string tail_icon = 2 [(gogoproto.jsontag) = "tail_icon"];
// 序列帧格式头图
string head_icon_fa = 3 [(gogoproto.jsontag) = "head_icon_fa"];
// 序列帧格式尾图
string tail_icon_fa = 4 [(gogoproto.jsontag) = "tail_icon_fa"];
// 背景颜色
string background = 5 [(gogoproto.jsontag) = "background"];
// 普通文字颜色
string color = 6 [(gogoproto.jsontag) = "color"];
// 高亮文字颜色
string highlight = 7 [(gogoproto.jsontag) = "highlight"];
// 持续时间
int64 time = 8 [(gogoproto.jsontag) = "time"];
}
message HalfData {
// 头图
string head_icon = 1 [(gogoproto.jsontag) = "head_icon"];
// 尾图
string tail_icon = 2 [(gogoproto.jsontag) = "tail_icon"];
// 背景颜色
string background = 3 [(gogoproto.jsontag) = "background"];
// 普通文字颜色
string color = 4 [(gogoproto.jsontag) = "color"];
// 高亮文字颜色
string highlight = 5 [(gogoproto.jsontag) = "highlight"];
// 持续时间
int64 time = 6 [(gogoproto.jsontag) = "time"];
}
message MSG {
//
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
//
string msg_common = 2 [(gogoproto.jsontag) = "msg_common"];
//
string msg_self = 3 [(gogoproto.jsontag) = "msg_self"];
//
string link_url = 4 [(gogoproto.jsontag) = "link_url"];
// 1-系统公告2-小电视/摩天大楼抽奖公告; 3-总督抽奖公告4-总督进场; 5-小电视/摩天大楼抽奖中奖公告; 6-高能公告
int64 msg_type = 5 [(gogoproto.jsontag) = "msg_type"];
//
FullData full = 6 [(gogoproto.jsontag) = "full"];
//
HalfData half = 7 [(gogoproto.jsontag) = "half"];
}
}
message BroadcastSendNoticeMsgResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
repeated int64 data = 3 [(gogoproto.jsontag) = "data"];
}

View File

@@ -0,0 +1,64 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Achv.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/Achv.proto
v1/TitleStuff.proto
v1/UserTitle.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:
// ==============
// Achv Interface
// ==============
type AchvRPCClient interface {
// * 用户成就统计
// 用户成就统计
Userstatus(ctx context.Context, req *AchvUserstatusReq, opts ...liverpc.CallOption) (resp *AchvUserstatusResp, err error)
}
// ====================
// Achv Live Rpc Client
// ====================
type achvRPCClient struct {
client *liverpc.Client
}
// NewAchvRPCClient creates a client that implements the AchvRPCClient interface.
func NewAchvRPCClient(client *liverpc.Client) AchvRPCClient {
return &achvRPCClient{
client: client,
}
}
func (c *achvRPCClient) Userstatus(ctx context.Context, in *AchvUserstatusReq, opts ...liverpc.CallOption) (*AchvUserstatusResp, error) {
out := new(AchvUserstatusResp)
err := doRPCRequest(ctx, c.client, 1, "Achv.userstatus", 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
}

View File

@@ -0,0 +1,817 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/Achv.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 AchvUserstatusReq struct {
}
func (m *AchvUserstatusReq) Reset() { *m = AchvUserstatusReq{} }
func (m *AchvUserstatusReq) String() string { return proto.CompactTextString(m) }
func (*AchvUserstatusReq) ProtoMessage() {}
func (*AchvUserstatusReq) Descriptor() ([]byte, []int) {
return fileDescriptor_Achv_f6f14f04d47f39df, []int{0}
}
func (m *AchvUserstatusReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AchvUserstatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AchvUserstatusReq.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 *AchvUserstatusReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_AchvUserstatusReq.Merge(dst, src)
}
func (m *AchvUserstatusReq) XXX_Size() int {
return m.Size()
}
func (m *AchvUserstatusReq) XXX_DiscardUnknown() {
xxx_messageInfo_AchvUserstatusReq.DiscardUnknown(m)
}
var xxx_messageInfo_AchvUserstatusReq proto.InternalMessageInfo
type AchvUserstatusResp struct {
//
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
//
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message"`
//
Data *AchvUserstatusResp_Data `protobuf:"bytes,4,opt,name=data" json:"data"`
}
func (m *AchvUserstatusResp) Reset() { *m = AchvUserstatusResp{} }
func (m *AchvUserstatusResp) String() string { return proto.CompactTextString(m) }
func (*AchvUserstatusResp) ProtoMessage() {}
func (*AchvUserstatusResp) Descriptor() ([]byte, []int) {
return fileDescriptor_Achv_f6f14f04d47f39df, []int{1}
}
func (m *AchvUserstatusResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AchvUserstatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AchvUserstatusResp.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 *AchvUserstatusResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_AchvUserstatusResp.Merge(dst, src)
}
func (m *AchvUserstatusResp) XXX_Size() int {
return m.Size()
}
func (m *AchvUserstatusResp) XXX_DiscardUnknown() {
xxx_messageInfo_AchvUserstatusResp.DiscardUnknown(m)
}
var xxx_messageInfo_AchvUserstatusResp proto.InternalMessageInfo
func (m *AchvUserstatusResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *AchvUserstatusResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *AchvUserstatusResp) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
func (m *AchvUserstatusResp) GetData() *AchvUserstatusResp_Data {
if m != nil {
return m.Data
}
return nil
}
type AchvUserstatusResp_Data struct {
// 已经领取的
Point int64 `protobuf:"varint,1,opt,name=point,proto3" json:"point"`
// 已经完成
Complete int64 `protobuf:"varint,2,opt,name=complete,proto3" json:"complete"`
// 完成但未领取
UnreceivedNormal int64 `protobuf:"varint,3,opt,name=unreceived_normal,json=unreceivedNormal,proto3" json:"unreceived_normal"`
}
func (m *AchvUserstatusResp_Data) Reset() { *m = AchvUserstatusResp_Data{} }
func (m *AchvUserstatusResp_Data) String() string { return proto.CompactTextString(m) }
func (*AchvUserstatusResp_Data) ProtoMessage() {}
func (*AchvUserstatusResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_Achv_f6f14f04d47f39df, []int{1, 0}
}
func (m *AchvUserstatusResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AchvUserstatusResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AchvUserstatusResp_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 *AchvUserstatusResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_AchvUserstatusResp_Data.Merge(dst, src)
}
func (m *AchvUserstatusResp_Data) XXX_Size() int {
return m.Size()
}
func (m *AchvUserstatusResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_AchvUserstatusResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_AchvUserstatusResp_Data proto.InternalMessageInfo
func (m *AchvUserstatusResp_Data) GetPoint() int64 {
if m != nil {
return m.Point
}
return 0
}
func (m *AchvUserstatusResp_Data) GetComplete() int64 {
if m != nil {
return m.Complete
}
return 0
}
func (m *AchvUserstatusResp_Data) GetUnreceivedNormal() int64 {
if m != nil {
return m.UnreceivedNormal
}
return 0
}
func init() {
proto.RegisterType((*AchvUserstatusReq)(nil), "rc.v1.AchvUserstatusReq")
proto.RegisterType((*AchvUserstatusResp)(nil), "rc.v1.AchvUserstatusResp")
proto.RegisterType((*AchvUserstatusResp_Data)(nil), "rc.v1.AchvUserstatusResp.Data")
}
func (m *AchvUserstatusReq) 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 *AchvUserstatusReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
return i, nil
}
func (m *AchvUserstatusResp) 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 *AchvUserstatusResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintAchv(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintAchv(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if len(m.Message) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintAchv(dAtA, i, uint64(len(m.Message)))
i += copy(dAtA[i:], m.Message)
}
if m.Data != nil {
dAtA[i] = 0x22
i++
i = encodeVarintAchv(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 *AchvUserstatusResp_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 *AchvUserstatusResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Point != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintAchv(dAtA, i, uint64(m.Point))
}
if m.Complete != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintAchv(dAtA, i, uint64(m.Complete))
}
if m.UnreceivedNormal != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintAchv(dAtA, i, uint64(m.UnreceivedNormal))
}
return i, nil
}
func encodeVarintAchv(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 *AchvUserstatusReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func (m *AchvUserstatusResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovAchv(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovAchv(uint64(l))
}
l = len(m.Message)
if l > 0 {
n += 1 + l + sovAchv(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovAchv(uint64(l))
}
return n
}
func (m *AchvUserstatusResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Point != 0 {
n += 1 + sovAchv(uint64(m.Point))
}
if m.Complete != 0 {
n += 1 + sovAchv(uint64(m.Complete))
}
if m.UnreceivedNormal != 0 {
n += 1 + sovAchv(uint64(m.UnreceivedNormal))
}
return n
}
func sovAchv(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozAchv(x uint64) (n int) {
return sovAchv(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *AchvUserstatusReq) 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 ErrIntOverflowAchv
}
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: AchvUserstatusReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AchvUserstatusReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipAchv(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthAchv
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *AchvUserstatusResp) 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 ErrIntOverflowAchv
}
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: AchvUserstatusResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AchvUserstatusResp: 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 ErrIntOverflowAchv
}
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 ErrIntOverflowAchv
}
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 ErrInvalidLengthAchv
}
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 Message", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAchv
}
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 ErrInvalidLengthAchv
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Message = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
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 ErrIntOverflowAchv
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthAchv
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &AchvUserstatusResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipAchv(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthAchv
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *AchvUserstatusResp_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 ErrIntOverflowAchv
}
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 Point", wireType)
}
m.Point = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAchv
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Point |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Complete", wireType)
}
m.Complete = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAchv
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Complete |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field UnreceivedNormal", wireType)
}
m.UnreceivedNormal = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAchv
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.UnreceivedNormal |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipAchv(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthAchv
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipAchv(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, ErrIntOverflowAchv
}
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, ErrIntOverflowAchv
}
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, ErrIntOverflowAchv
}
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, ErrInvalidLengthAchv
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAchv
}
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 := skipAchv(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 (
ErrInvalidLengthAchv = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowAchv = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/Achv.proto", fileDescriptor_Achv_f6f14f04d47f39df) }
var fileDescriptor_Achv_f6f14f04d47f39df = []byte{
// 351 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x6a, 0xf2, 0x40,
0x14, 0xc5, 0x1d, 0x13, 0x3f, 0xf5, 0xfa, 0x15, 0xea, 0x94, 0x42, 0x14, 0xc9, 0x88, 0x50, 0xc8,
0xa6, 0x11, 0xed, 0xb6, 0x1b, 0x43, 0x37, 0xdd, 0x74, 0x31, 0xd0, 0x4d, 0x37, 0x65, 0x8c, 0xd3,
0x28, 0x18, 0x27, 0x66, 0x26, 0x79, 0x8e, 0x6e, 0xfa, 0x4e, 0xa5, 0x2b, 0x97, 0x5d, 0x85, 0xa2,
0xbb, 0x3c, 0x45, 0xc9, 0xa4, 0x5a, 0xa8, 0xb8, 0xb9, 0x73, 0xcf, 0x39, 0xf3, 0xe7, 0xfe, 0x18,
0x38, 0x4b, 0x47, 0xc3, 0x89, 0x3f, 0x4f, 0xdd, 0x28, 0x16, 0x4a, 0xe0, 0x5a, 0xec, 0xbb, 0xe9,
0xa8, 0x7b, 0x1d, 0x2c, 0xd4, 0x3c, 0x99, 0xba, 0xbe, 0x08, 0x87, 0x81, 0x08, 0xc4, 0x50, 0xa7,
0xd3, 0xe4, 0x45, 0x2b, 0x2d, 0x74, 0x57, 0x9e, 0x1a, 0x5c, 0x40, 0xbb, 0xb8, 0xe3, 0x51, 0xf2,
0x58, 0x2a, 0xa6, 0x12, 0x49, 0xf9, 0x7a, 0xf0, 0x51, 0x05, 0xfc, 0xd7, 0x95, 0x11, 0xee, 0x81,
0xe9, 0x8b, 0x19, 0xb7, 0x50, 0x1f, 0x39, 0x86, 0xd7, 0xc8, 0x33, 0xa2, 0x35, 0xd5, 0x15, 0x77,
0xc0, 0x08, 0x65, 0x60, 0x55, 0xfb, 0xc8, 0x69, 0x7a, 0xf5, 0x3c, 0x23, 0x85, 0xa4, 0x45, 0xc1,
0x57, 0x50, 0x0f, 0xb9, 0x94, 0x2c, 0xe0, 0x96, 0xa1, 0xe3, 0x56, 0x9e, 0x91, 0xbd, 0x45, 0xf7,
0x0d, 0xbe, 0x05, 0x73, 0xc6, 0x14, 0xb3, 0xcc, 0x3e, 0x72, 0x5a, 0x63, 0xdb, 0xd5, 0x40, 0xee,
0xf1, 0x20, 0xee, 0x1d, 0x53, 0xac, 0x7c, 0xbf, 0xd8, 0x4f, 0x75, 0xed, 0xbe, 0x21, 0x30, 0x8b,
0x00, 0x13, 0xa8, 0x45, 0x62, 0xb1, 0x52, 0x3f, 0x73, 0x36, 0xf3, 0x8c, 0x94, 0x06, 0x2d, 0x17,
0xec, 0x40, 0xc3, 0x17, 0x61, 0xb4, 0xe4, 0x8a, 0xeb, 0x71, 0x0d, 0xef, 0x7f, 0x9e, 0x91, 0x83,
0x47, 0x0f, 0x1d, 0xf6, 0xa0, 0x9d, 0xac, 0x62, 0xee, 0xf3, 0x45, 0xca, 0x67, 0xcf, 0x2b, 0x11,
0x87, 0x6c, 0xa9, 0x11, 0x0c, 0xef, 0x32, 0xcf, 0xc8, 0x71, 0x48, 0xcf, 0x7f, 0xad, 0x07, 0xed,
0x8c, 0xef, 0xc1, 0x2c, 0x10, 0xf0, 0x04, 0x20, 0x39, 0x60, 0x60, 0xeb, 0x04, 0xdd, 0xba, 0xdb,
0x39, 0xc9, 0xed, 0xf5, 0xde, 0xb7, 0x36, 0xda, 0x6c, 0x6d, 0xf4, 0xb5, 0xb5, 0xd1, 0xeb, 0xce,
0xae, 0x6c, 0x76, 0x76, 0xe5, 0x73, 0x67, 0x57, 0x9e, 0xaa, 0xe9, 0x68, 0xfa, 0x4f, 0xff, 0xe8,
0xcd, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x09, 0x64, 0xdf, 0xf8, 0x18, 0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,41 @@
syntax = "proto3";
package rc.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Achv {
/** 用户成就统计
* 用户成就统计
*/
rpc userstatus (AchvUserstatusReq) returns (AchvUserstatusResp);
}
message AchvUserstatusReq {
}
message AchvUserstatusResp {
//
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 {
// 已经领取的
int64 point = 1 [(gogoproto.jsontag) = "point"];
// 已经完成
int64 complete = 2 [(gogoproto.jsontag) = "complete"];
// 完成但未领取
int64 unreceived_normal = 3 [(gogoproto.jsontag) = "unreceived_normal"];
}
}

View File

@@ -0,0 +1,64 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
proto_library(
name = "v1_proto",
srcs = [
"Achv.proto",
"TitleStuff.proto",
"UserTitle.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/rc/api/liverpc/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"Achv.liverpc.go",
"TitleStuff.liverpc.go",
"UserTitle.liverpc.go",
],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/live/rc/api/liverpc/v1",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/rpc/liverpc:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,45 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/TitleStuff.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
// ====================
// TitleStuff Interface
// ====================
type TitleStuffRPCClient interface {
// * 添加头衔经验原石
//
Add(ctx context.Context, req *TitleStuffAddReq, opts ...liverpc.CallOption) (resp *TitleStuffAddResp, err error)
}
// ==========================
// TitleStuff Live Rpc Client
// ==========================
type titleStuffRPCClient struct {
client *liverpc.Client
}
// NewTitleStuffRPCClient creates a client that implements the TitleStuffRPCClient interface.
func NewTitleStuffRPCClient(client *liverpc.Client) TitleStuffRPCClient {
return &titleStuffRPCClient{
client: client,
}
}
func (c *titleStuffRPCClient) Add(ctx context.Context, in *TitleStuffAddReq, opts ...liverpc.CallOption) (*TitleStuffAddResp, error) {
out := new(TitleStuffAddResp)
err := doRPCRequest(ctx, c.client, 1, "TitleStuff.add", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}

View File

@@ -0,0 +1,765 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/TitleStuff.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 TitleStuffAddReq struct {
// UID
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
// 原石id
Sid int64 `protobuf:"varint,2,opt,name=sid,proto3" json:"sid"`
// 原石数量
Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num"`
}
func (m *TitleStuffAddReq) Reset() { *m = TitleStuffAddReq{} }
func (m *TitleStuffAddReq) String() string { return proto.CompactTextString(m) }
func (*TitleStuffAddReq) ProtoMessage() {}
func (*TitleStuffAddReq) Descriptor() ([]byte, []int) {
return fileDescriptor_TitleStuff_c6a97f7480779908, []int{0}
}
func (m *TitleStuffAddReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TitleStuffAddReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TitleStuffAddReq.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 *TitleStuffAddReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_TitleStuffAddReq.Merge(dst, src)
}
func (m *TitleStuffAddReq) XXX_Size() int {
return m.Size()
}
func (m *TitleStuffAddReq) XXX_DiscardUnknown() {
xxx_messageInfo_TitleStuffAddReq.DiscardUnknown(m)
}
var xxx_messageInfo_TitleStuffAddReq proto.InternalMessageInfo
func (m *TitleStuffAddReq) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *TitleStuffAddReq) GetSid() int64 {
if m != nil {
return m.Sid
}
return 0
}
func (m *TitleStuffAddReq) GetNum() int64 {
if m != nil {
return m.Num
}
return 0
}
type TitleStuffAddResp 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 *TitleStuffAddResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *TitleStuffAddResp) Reset() { *m = TitleStuffAddResp{} }
func (m *TitleStuffAddResp) String() string { return proto.CompactTextString(m) }
func (*TitleStuffAddResp) ProtoMessage() {}
func (*TitleStuffAddResp) Descriptor() ([]byte, []int) {
return fileDescriptor_TitleStuff_c6a97f7480779908, []int{1}
}
func (m *TitleStuffAddResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TitleStuffAddResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TitleStuffAddResp.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 *TitleStuffAddResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_TitleStuffAddResp.Merge(dst, src)
}
func (m *TitleStuffAddResp) XXX_Size() int {
return m.Size()
}
func (m *TitleStuffAddResp) XXX_DiscardUnknown() {
xxx_messageInfo_TitleStuffAddResp.DiscardUnknown(m)
}
var xxx_messageInfo_TitleStuffAddResp proto.InternalMessageInfo
func (m *TitleStuffAddResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *TitleStuffAddResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *TitleStuffAddResp) GetData() *TitleStuffAddResp_Data {
if m != nil {
return m.Data
}
return nil
}
type TitleStuffAddResp_Data struct {
}
func (m *TitleStuffAddResp_Data) Reset() { *m = TitleStuffAddResp_Data{} }
func (m *TitleStuffAddResp_Data) String() string { return proto.CompactTextString(m) }
func (*TitleStuffAddResp_Data) ProtoMessage() {}
func (*TitleStuffAddResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_TitleStuff_c6a97f7480779908, []int{1, 0}
}
func (m *TitleStuffAddResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TitleStuffAddResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TitleStuffAddResp_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 *TitleStuffAddResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_TitleStuffAddResp_Data.Merge(dst, src)
}
func (m *TitleStuffAddResp_Data) XXX_Size() int {
return m.Size()
}
func (m *TitleStuffAddResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_TitleStuffAddResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_TitleStuffAddResp_Data proto.InternalMessageInfo
func init() {
proto.RegisterType((*TitleStuffAddReq)(nil), "rc.v1.TitleStuffAddReq")
proto.RegisterType((*TitleStuffAddResp)(nil), "rc.v1.TitleStuffAddResp")
proto.RegisterType((*TitleStuffAddResp_Data)(nil), "rc.v1.TitleStuffAddResp.Data")
}
func (m *TitleStuffAddReq) 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 *TitleStuffAddReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintTitleStuff(dAtA, i, uint64(m.Uid))
}
if m.Sid != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintTitleStuff(dAtA, i, uint64(m.Sid))
}
if m.Num != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintTitleStuff(dAtA, i, uint64(m.Num))
}
return i, nil
}
func (m *TitleStuffAddResp) 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 *TitleStuffAddResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintTitleStuff(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintTitleStuff(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintTitleStuff(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 *TitleStuffAddResp_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 *TitleStuffAddResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
return i, nil
}
func encodeVarintTitleStuff(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 *TitleStuffAddReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovTitleStuff(uint64(m.Uid))
}
if m.Sid != 0 {
n += 1 + sovTitleStuff(uint64(m.Sid))
}
if m.Num != 0 {
n += 1 + sovTitleStuff(uint64(m.Num))
}
return n
}
func (m *TitleStuffAddResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovTitleStuff(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovTitleStuff(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovTitleStuff(uint64(l))
}
return n
}
func (m *TitleStuffAddResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func sovTitleStuff(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozTitleStuff(x uint64) (n int) {
return sovTitleStuff(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *TitleStuffAddReq) 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 ErrIntOverflowTitleStuff
}
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: TitleStuffAddReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TitleStuffAddReq: 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 ErrIntOverflowTitleStuff
}
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 Sid", wireType)
}
m.Sid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTitleStuff
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Sid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Num", wireType)
}
m.Num = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTitleStuff
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Num |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipTitleStuff(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTitleStuff
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *TitleStuffAddResp) 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 ErrIntOverflowTitleStuff
}
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: TitleStuffAddResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TitleStuffAddResp: 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 ErrIntOverflowTitleStuff
}
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 ErrIntOverflowTitleStuff
}
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 ErrInvalidLengthTitleStuff
}
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 ErrIntOverflowTitleStuff
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthTitleStuff
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &TitleStuffAddResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTitleStuff(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTitleStuff
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *TitleStuffAddResp_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 ErrIntOverflowTitleStuff
}
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 {
default:
iNdEx = preIndex
skippy, err := skipTitleStuff(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTitleStuff
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipTitleStuff(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, ErrIntOverflowTitleStuff
}
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, ErrIntOverflowTitleStuff
}
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, ErrIntOverflowTitleStuff
}
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, ErrInvalidLengthTitleStuff
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowTitleStuff
}
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 := skipTitleStuff(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 (
ErrInvalidLengthTitleStuff = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowTitleStuff = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/TitleStuff.proto", fileDescriptor_TitleStuff_c6a97f7480779908) }
var fileDescriptor_TitleStuff_c6a97f7480779908 = []byte{
// 285 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2e, 0x33, 0xd4, 0x0f,
0xc9, 0x2c, 0xc9, 0x49, 0x0d, 0x2e, 0x29, 0x4d, 0x4b, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
0x62, 0x2d, 0x4a, 0xd6, 0x2b, 0x33, 0x94, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b,
0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0xcb, 0x26, 0x95, 0xa6, 0x81, 0x79, 0x60,
0x0e, 0x98, 0x05, 0xd1, 0xa5, 0x94, 0xcc, 0x25, 0x80, 0x30, 0xc9, 0x31, 0x25, 0x25, 0x28, 0xb5,
0x50, 0x48, 0x92, 0x8b, 0xb9, 0x34, 0x33, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd9, 0x89, 0xfd,
0xd5, 0x3d, 0x79, 0x10, 0x37, 0x08, 0x44, 0x80, 0xa4, 0x8a, 0x33, 0x53, 0x24, 0x98, 0x10, 0x52,
0xc5, 0x20, 0xa9, 0x62, 0x88, 0x54, 0x5e, 0x69, 0xae, 0x04, 0x33, 0x42, 0x2a, 0xaf, 0x34, 0x37,
0x08, 0x44, 0x28, 0x4d, 0x64, 0xe4, 0x12, 0x44, 0xb3, 0xa5, 0xb8, 0x40, 0x48, 0x86, 0x8b, 0x25,
0x39, 0x3f, 0x25, 0x15, 0x6a, 0x0f, 0xc7, 0xab, 0x7b, 0xf2, 0x60, 0x7e, 0x10, 0x98, 0x04, 0x19,
0x97, 0x5b, 0x9c, 0x0e, 0xb6, 0x89, 0x13, 0x62, 0x5c, 0x6e, 0x71, 0x7a, 0x10, 0x88, 0x10, 0xb2,
0xe6, 0x62, 0x49, 0x49, 0x2c, 0x49, 0x04, 0x5b, 0xc5, 0x6d, 0x24, 0xab, 0x07, 0xf6, 0xb8, 0x1e,
0x86, 0x05, 0x7a, 0x2e, 0x89, 0x25, 0x89, 0x10, 0x73, 0x41, 0xca, 0x83, 0xc0, 0xa4, 0x14, 0x1b,
0x17, 0x0b, 0x48, 0xdc, 0xc8, 0x8d, 0x8b, 0x0b, 0xa1, 0x43, 0xc8, 0x82, 0x8b, 0x39, 0x31, 0x25,
0x45, 0x48, 0x1c, 0xbb, 0x59, 0x85, 0x52, 0x12, 0xb8, 0x2c, 0x71, 0x92, 0x39, 0xf1, 0x48, 0x8e,
0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58,
0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa6, 0x32, 0xc3, 0x24, 0x36, 0x70, 0x28, 0x1b, 0x03,
0x02, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x61, 0x02, 0x28, 0xb2, 0x01, 0x00, 0x00,
}

View File

@@ -0,0 +1,39 @@
syntax = "proto3";
package rc.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service TitleStuff {
/** 添加头衔经验原石
*
*/
rpc add (TitleStuffAddReq) returns (TitleStuffAddResp);
}
message TitleStuffAddReq {
// UID
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 原石id
int64 sid = 2 [(gogoproto.jsontag) = "sid"];
// 原石数量
int64 num = 3 [(gogoproto.jsontag) = "num"];
}
message TitleStuffAddResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}

View File

@@ -0,0 +1,97 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/UserTitle.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
// ===================
// UserTitle Interface
// ===================
type UserTitleRPCClient interface {
// * 根据头衔id获取头衔名称头衔不存在不返回
//
GetTitleByIds(ctx context.Context, req *UserTitleGetTitleByIdsReq, opts ...liverpc.CallOption) (resp *UserTitleGetTitleByIdsResp, err error)
// * 移动端获取佩戴的头衔
//
GetMobileTitle(ctx context.Context, req *UserTitleGetMobileTitleReq, opts ...liverpc.CallOption) (resp *UserTitleGetMobileTitleResp, err error)
// * 获取弹幕头衔(需要登录态)
//
GetCommentTitle(ctx context.Context, req *UserTitleGetCommentTitleReq, opts ...liverpc.CallOption) (resp *UserTitleGetCommentTitleResp, err error)
// * 添加头衔
//
Add(ctx context.Context, req *UserTitleAddReq, opts ...liverpc.CallOption) (resp *UserTitleAddResp, err error)
// * 个人中心我的头衔列表
//
GetAll(ctx context.Context, req *UserTitleGetAllReq, opts ...liverpc.CallOption) (resp *UserTitleGetAllResp, err error)
}
// =========================
// UserTitle Live Rpc Client
// =========================
type userTitleRPCClient struct {
client *liverpc.Client
}
// NewUserTitleRPCClient creates a client that implements the UserTitleRPCClient interface.
func NewUserTitleRPCClient(client *liverpc.Client) UserTitleRPCClient {
return &userTitleRPCClient{
client: client,
}
}
func (c *userTitleRPCClient) GetTitleByIds(ctx context.Context, in *UserTitleGetTitleByIdsReq, opts ...liverpc.CallOption) (*UserTitleGetTitleByIdsResp, error) {
out := new(UserTitleGetTitleByIdsResp)
err := doRPCRequest(ctx, c.client, 1, "UserTitle.getTitleByIds", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userTitleRPCClient) GetMobileTitle(ctx context.Context, in *UserTitleGetMobileTitleReq, opts ...liverpc.CallOption) (*UserTitleGetMobileTitleResp, error) {
out := new(UserTitleGetMobileTitleResp)
err := doRPCRequest(ctx, c.client, 1, "UserTitle.getMobileTitle", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userTitleRPCClient) GetCommentTitle(ctx context.Context, in *UserTitleGetCommentTitleReq, opts ...liverpc.CallOption) (*UserTitleGetCommentTitleResp, error) {
out := new(UserTitleGetCommentTitleResp)
err := doRPCRequest(ctx, c.client, 1, "UserTitle.getCommentTitle", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userTitleRPCClient) Add(ctx context.Context, in *UserTitleAddReq, opts ...liverpc.CallOption) (*UserTitleAddResp, error) {
out := new(UserTitleAddResp)
err := doRPCRequest(ctx, c.client, 1, "UserTitle.add", in, out, opts)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userTitleRPCClient) GetAll(ctx context.Context, in *UserTitleGetAllReq, opts ...liverpc.CallOption) (*UserTitleGetAllResp, error) {
out := new(UserTitleGetAllResp)
err := doRPCRequest(ctx, c.client, 1, "UserTitle.getAll", 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,156 @@
syntax = "proto3";
package rc.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service UserTitle {
/** 根据头衔id获取头衔名称头衔不存在不返回
*
*/
rpc getTitleByIds (UserTitleGetTitleByIdsReq) returns (UserTitleGetTitleByIdsResp);
/** 移动端获取佩戴的头衔
*
*/
rpc getMobileTitle (UserTitleGetMobileTitleReq) returns (UserTitleGetMobileTitleResp);
/** 获取弹幕头衔(需要登录态)
*
*/
rpc getCommentTitle (UserTitleGetCommentTitleReq) returns (UserTitleGetCommentTitleResp);
/** 添加头衔
*
*/
rpc add (UserTitleAddReq) returns (UserTitleAddResp);
/** 个人中心我的头衔列表
*
*/
rpc getAll (UserTitleGetAllReq) returns (UserTitleGetAllResp);
}
message UserTitleGetTitleByIdsReq {
// 头衔ID列表
repeated int64 ids = 1 [(gogoproto.jsontag) = "ids"];
}
message UserTitleGetTitleByIdsResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
string message = 3 [(gogoproto.jsontag) = "message"];
//
map<int64, string> data = 4 [(gogoproto.jsontag) = "data"];
}
message UserTitleGetMobileTitleReq {
//
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
}
message UserTitleGetMobileTitleResp {
//
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 {
// 头衔标识
string title = 1 [(gogoproto.jsontag) = "title"];
// 头衔名称
string activity = 2 [(gogoproto.jsontag) = "activity"];
}
}
message UserTitleGetCommentTitleReq {
}
message UserTitleGetCommentTitleResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
// data[0]老头衔唯一标识如 'cake-flour', data[1]新头衔唯一标识如'title-137-1', 无头衔为空数组
repeated string data = 3 [(gogoproto.jsontag) = "data"];
}
message UserTitleAddReq {
// UID
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 头衔id
int64 title_id = 2 [(gogoproto.jsontag) = "title_id"];
// 过期时间dateTime
string expire_time = 3 [(gogoproto.jsontag) = "expire_time"];
// 积分
int64 score = 4 [(gogoproto.jsontag) = "score"];
}
message UserTitleAddResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message UserTitleGetAllReq {
// UID
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
}
message UserTitleGetAllResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
string message = 3 [(gogoproto.jsontag) = "message"];
// type -> content
map<int64, Data> data = 4 [(gogoproto.jsontag) = "data"];
message Data {
//
string id = 1 [(gogoproto.jsontag) = "id"];
//
string uid = 2 [(gogoproto.jsontag) = "uid"];
// 头衔id
string tid = 3 [(gogoproto.jsontag) = "tid"];
// 数量
string num = 4 [(gogoproto.jsontag) = "num"];
//
string score = 5 [(gogoproto.jsontag) = "score"];
//
string create_time = 6 [(gogoproto.jsontag) = "create_time"];
//
string expire_time = 7 [(gogoproto.jsontag) = "expire_time"];
//
string status = 8 [(gogoproto.jsontag) = "status"];
}
}