Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@ -0,0 +1,16 @@
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//app/service/live/live_user/api/liverpc:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,35 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["client.go"],
importpath = "go-common/app/service/live/live_user/api/liverpc",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/live/live_user/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/live_user/api/liverpc/v1:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,51 @@
// 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/live_user/api/liverpc/v1"
"go-common/library/net/rpc/liverpc"
)
// Client that represents a liverpc live_user service api
type Client struct {
cli *liverpc.Client
// V1Guard presents the controller in liverpc
V1Guard v1.Guard
// V1Note presents the controller in liverpc
V1Note v1.Note
// V1RoomAdmin presents the controller in liverpc
V1RoomAdmin v1.RoomAdmin
// V1UserSetting presents the controller in liverpc
V1UserSetting v1.UserSetting
}
// DiscoveryAppId the discovery id is not the tree name
var DiscoveryAppId = "live.liveuser"
// New a Client that represents a liverpc live.liveuser 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.V1Guard = v1.NewGuardRpcClient(realCli)
cli.V1Note = v1.NewNoteRpcClient(realCli)
cli.V1RoomAdmin = v1.NewRoomAdminRpcClient(realCli)
cli.V1UserSetting = v1.NewUserSettingRpcClient(realCli)
}

View File

@ -0,0 +1,66 @@
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 = [
"Guard.proto",
"Note.proto",
"RoomAdmin.proto",
"UserSetting.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/live_user/api/liverpc/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"Guard.liverpc.go",
"Note.liverpc.go",
"RoomAdmin.liverpc.go",
"UserSetting.liverpc.go",
],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/live/live_user/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,79 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Guard.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/Guard.proto
v1/Note.proto
v1/RoomAdmin.proto
v1/UserSetting.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:
// ===============
// Guard Interface
// ===============
type Guard interface {
// * 根据uid获取大航海信息
//
GetByUidTargetId(context.Context, *GuardGetByUidTargetIdReq) (*GuardGetByUidTargetIdResp, error)
// * 根据uid获取大航海信息
//
GetByUid(context.Context, *GuardGetByUidReq) (*GuardGetByUidResp, error)
}
// =====================
// Guard Live Rpc Client
// =====================
type guardRpcClient struct {
client *liverpc.Client
}
// NewGuardRpcClient creates a Rpc client that implements the Guard interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewGuardRpcClient(client *liverpc.Client) Guard {
return &guardRpcClient{
client: client,
}
}
func (c *guardRpcClient) GetByUidTargetId(ctx context.Context, in *GuardGetByUidTargetIdReq) (*GuardGetByUidTargetIdResp, error) {
out := new(GuardGetByUidTargetIdResp)
err := doRpcRequest(ctx, c.client, 1, "Guard.getByUidTargetId", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *guardRpcClient) GetByUid(ctx context.Context, in *GuardGetByUidReq) (*GuardGetByUidResp, error) {
out := new(GuardGetByUidResp)
err := doRpcRequest(ctx, c.client, 1, "Guard.getByUid", in, out)
if err != nil {
return nil, err
}
return out, nil
}
// =====
// Utils
// =====
func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
err = client.Call(ctx, version, method, in, out)
return
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,102 @@
syntax = "proto3";
package live_user.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Guard {
/** 根据uid获取大航海信息
*
*/
rpc getByUidTargetId (GuardGetByUidTargetIdReq) returns (GuardGetByUidTargetIdResp);
/** 根据uid获取大航海信息
*
*/
rpc getByUid (GuardGetByUidReq) returns (GuardGetByUidResp);
}
message GuardGetByUidTargetIdReq {
// uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 主播id
int64 target_id = 2 [(gogoproto.jsontag) = "target_id"];
// 是否只返回最高等级的守护为1时会改变返回数据结构
int64 is_limit_one = 3 [(gogoproto.jsontag) = "is_limit_one"];
}
message GuardGetByUidTargetIdResp {
//
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 {
//
int64 id = 1 [(gogoproto.jsontag) = "id"];
//
int64 uid = 2 [(gogoproto.jsontag) = "uid"];
// up主id
int64 target_id = 3 [(gogoproto.jsontag) = "target_id"];
// 1:总督,2:提督,3:舰长
int64 privilege_type = 4 [(gogoproto.jsontag) = "privilege_type"];
// 开始时间
string start_time = 5 [(gogoproto.jsontag) = "start_time"];
// 过期时间
string expired_time = 6 [(gogoproto.jsontag) = "expired_time"];
// 创建时间
string ctime = 7 [(gogoproto.jsontag) = "ctime"];
// 修改时间
string utime = 8 [(gogoproto.jsontag) = "utime"];
}
}
message GuardGetByUidReq {
// uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 是否包含过期的守护,默认包含
int64 inc_expire = 2 [(gogoproto.jsontag) = "inc_expire"];
// 是否只返回等级最高的一条,默认0
int64 is_limit_one = 3 [(gogoproto.jsontag) = "is_limit_one"];
}
message GuardGetByUidResp {
//
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 {
//
int64 id = 1 [(gogoproto.jsontag) = "id"];
//
int64 uid = 2 [(gogoproto.jsontag) = "uid"];
// up主id
int64 target_id = 3 [(gogoproto.jsontag) = "target_id"];
// 1:总督,2:提督,3:舰长
int64 privilege_type = 4 [(gogoproto.jsontag) = "privilege_type"];
// 开始时间
string start_time = 5 [(gogoproto.jsontag) = "start_time"];
// 过期时间
string expired_time = 6 [(gogoproto.jsontag) = "expired_time"];
// 创建时间
string ctime = 7 [(gogoproto.jsontag) = "ctime"];
// 修改时间
string utime = 8 [(gogoproto.jsontag) = "utime"];
}
}

View File

@ -0,0 +1,46 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Note.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
// ==============
// Note Interface
// ==============
type Note interface {
// * 大航海续费提醒
//
Get(context.Context, *NoteGetReq) (*NoteGetResp, error)
}
// ====================
// Note Live Rpc Client
// ====================
type noteRpcClient struct {
client *liverpc.Client
}
// NewNoteRpcClient creates a Rpc client that implements the Note interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewNoteRpcClient(client *liverpc.Client) Note {
return &noteRpcClient{
client: client,
}
}
func (c *noteRpcClient) Get(ctx context.Context, in *NoteGetReq) (*NoteGetResp, error) {
out := new(NoteGetResp)
err := doRpcRequest(ctx, c.client, 1, "Note.get", in, out)
if err != nil {
return nil, err
}
return out, nil
}

View File

@ -0,0 +1,846 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/Note.proto
package v1
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
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 NoteGetReq struct {
}
func (m *NoteGetReq) Reset() { *m = NoteGetReq{} }
func (m *NoteGetReq) String() string { return proto.CompactTextString(m) }
func (*NoteGetReq) ProtoMessage() {}
func (*NoteGetReq) Descriptor() ([]byte, []int) {
return fileDescriptor_Note_75b5333a56a3cb9f, []int{0}
}
func (m *NoteGetReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *NoteGetReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_NoteGetReq.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 *NoteGetReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_NoteGetReq.Merge(dst, src)
}
func (m *NoteGetReq) XXX_Size() int {
return m.Size()
}
func (m *NoteGetReq) XXX_DiscardUnknown() {
xxx_messageInfo_NoteGetReq.DiscardUnknown(m)
}
var xxx_messageInfo_NoteGetReq proto.InternalMessageInfo
type NoteGetResp struct {
// code
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
// msg
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
//
Data *NoteGetResp_Data `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"`
}
func (m *NoteGetResp) Reset() { *m = NoteGetResp{} }
func (m *NoteGetResp) String() string { return proto.CompactTextString(m) }
func (*NoteGetResp) ProtoMessage() {}
func (*NoteGetResp) Descriptor() ([]byte, []int) {
return fileDescriptor_Note_75b5333a56a3cb9f, []int{1}
}
func (m *NoteGetResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *NoteGetResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_NoteGetResp.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 *NoteGetResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_NoteGetResp.Merge(dst, src)
}
func (m *NoteGetResp) XXX_Size() int {
return m.Size()
}
func (m *NoteGetResp) XXX_DiscardUnknown() {
xxx_messageInfo_NoteGetResp.DiscardUnknown(m)
}
var xxx_messageInfo_NoteGetResp proto.InternalMessageInfo
func (m *NoteGetResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *NoteGetResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *NoteGetResp) GetData() *NoteGetResp_Data {
if m != nil {
return m.Data
}
return nil
}
type NoteGetResp_Data struct {
// logo 的 url
Logo string `protobuf:"bytes,1,opt,name=logo,proto3" json:"logo,omitempty"`
// 标题
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
// 内容
Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
// 跳转链接
Link string `protobuf:"bytes,4,opt,name=link,proto3" json:"link,omitempty"`
}
func (m *NoteGetResp_Data) Reset() { *m = NoteGetResp_Data{} }
func (m *NoteGetResp_Data) String() string { return proto.CompactTextString(m) }
func (*NoteGetResp_Data) ProtoMessage() {}
func (*NoteGetResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_Note_75b5333a56a3cb9f, []int{1, 0}
}
func (m *NoteGetResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *NoteGetResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_NoteGetResp_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 *NoteGetResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_NoteGetResp_Data.Merge(dst, src)
}
func (m *NoteGetResp_Data) XXX_Size() int {
return m.Size()
}
func (m *NoteGetResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_NoteGetResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_NoteGetResp_Data proto.InternalMessageInfo
func (m *NoteGetResp_Data) GetLogo() string {
if m != nil {
return m.Logo
}
return ""
}
func (m *NoteGetResp_Data) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *NoteGetResp_Data) GetContent() string {
if m != nil {
return m.Content
}
return ""
}
func (m *NoteGetResp_Data) GetLink() string {
if m != nil {
return m.Link
}
return ""
}
func init() {
proto.RegisterType((*NoteGetReq)(nil), "live_user.v1.NoteGetReq")
proto.RegisterType((*NoteGetResp)(nil), "live_user.v1.NoteGetResp")
proto.RegisterType((*NoteGetResp_Data)(nil), "live_user.v1.NoteGetResp.Data")
}
func (m *NoteGetReq) 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 *NoteGetReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
return i, nil
}
func (m *NoteGetResp) 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 *NoteGetResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintNote(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintNote(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintNote(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 *NoteGetResp_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 *NoteGetResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Logo) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintNote(dAtA, i, uint64(len(m.Logo)))
i += copy(dAtA[i:], m.Logo)
}
if len(m.Title) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintNote(dAtA, i, uint64(len(m.Title)))
i += copy(dAtA[i:], m.Title)
}
if len(m.Content) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintNote(dAtA, i, uint64(len(m.Content)))
i += copy(dAtA[i:], m.Content)
}
if len(m.Link) > 0 {
dAtA[i] = 0x22
i++
i = encodeVarintNote(dAtA, i, uint64(len(m.Link)))
i += copy(dAtA[i:], m.Link)
}
return i, nil
}
func encodeVarintNote(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 *NoteGetReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
return n
}
func (m *NoteGetResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovNote(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovNote(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovNote(uint64(l))
}
return n
}
func (m *NoteGetResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Logo)
if l > 0 {
n += 1 + l + sovNote(uint64(l))
}
l = len(m.Title)
if l > 0 {
n += 1 + l + sovNote(uint64(l))
}
l = len(m.Content)
if l > 0 {
n += 1 + l + sovNote(uint64(l))
}
l = len(m.Link)
if l > 0 {
n += 1 + l + sovNote(uint64(l))
}
return n
}
func sovNote(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozNote(x uint64) (n int) {
return sovNote(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *NoteGetReq) 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 ErrIntOverflowNote
}
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: NoteGetReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: NoteGetReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := skipNote(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthNote
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *NoteGetResp) 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 ErrIntOverflowNote
}
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: NoteGetResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: NoteGetResp: 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 ErrIntOverflowNote
}
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 ErrIntOverflowNote
}
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 ErrInvalidLengthNote
}
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 ErrIntOverflowNote
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthNote
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &NoteGetResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipNote(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthNote
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *NoteGetResp_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 ErrIntOverflowNote
}
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 Logo", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowNote
}
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 ErrInvalidLengthNote
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Logo = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowNote
}
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 ErrInvalidLengthNote
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Title = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
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 ErrIntOverflowNote
}
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 ErrInvalidLengthNote
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Content = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Link", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowNote
}
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 ErrInvalidLengthNote
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Link = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipNote(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthNote
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipNote(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, ErrIntOverflowNote
}
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, ErrIntOverflowNote
}
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, ErrIntOverflowNote
}
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, ErrInvalidLengthNote
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowNote
}
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 := skipNote(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 (
ErrInvalidLengthNote = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowNote = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/Note.proto", fileDescriptor_Note_75b5333a56a3cb9f) }
var fileDescriptor_Note_75b5333a56a3cb9f = []byte{
// 255 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0xc3, 0x30,
0x14, 0x45, 0xe3, 0xc6, 0x80, 0xf2, 0x5a, 0x24, 0x64, 0x31, 0x98, 0x0a, 0x59, 0x51, 0xa7, 0x4c,
0x46, 0x09, 0x1b, 0x63, 0x85, 0xc4, 0xc6, 0xe0, 0x91, 0x01, 0x14, 0xda, 0xa7, 0x28, 0x6a, 0x88,
0xdb, 0xe6, 0x91, 0xef, 0xe0, 0xaf, 0x60, 0xec, 0xc8, 0x88, 0x92, 0x1f, 0x41, 0x36, 0xa5, 0xea,
0x92, 0xed, 0x1e, 0xd9, 0xba, 0xe7, 0xea, 0xc1, 0x79, 0x9b, 0xde, 0x3c, 0x5a, 0x42, 0xbd, 0xde,
0x5a, 0xb2, 0x62, 0x52, 0x95, 0x2d, 0xbe, 0xbc, 0x37, 0xb8, 0xd5, 0x6d, 0x3a, 0x9b, 0x00, 0xb8,
0xb7, 0x07, 0x24, 0x83, 0x9b, 0xd9, 0x27, 0x83, 0xf1, 0x01, 0x9b, 0xb5, 0x10, 0xc0, 0x17, 0x76,
0x89, 0x92, 0xc5, 0x2c, 0x09, 0x8d, 0xcf, 0xe2, 0x02, 0xc2, 0xb7, 0xa6, 0x90, 0xa3, 0x98, 0x25,
0x91, 0x71, 0x51, 0x64, 0xc0, 0x97, 0x39, 0xe5, 0x32, 0x8c, 0x59, 0x32, 0xce, 0x94, 0x3e, 0x16,
0xe8, 0xa3, 0x3a, 0x7d, 0x9f, 0x53, 0x6e, 0xfc, 0xdf, 0xe9, 0x33, 0x70, 0x47, 0xce, 0x50, 0xd9,
0xc2, 0x7a, 0x43, 0x64, 0x7c, 0x16, 0x97, 0x70, 0x42, 0x25, 0x55, 0xb8, 0x77, 0xfc, 0x81, 0x90,
0x70, 0xb6, 0xb0, 0x35, 0x61, 0x4d, 0x5e, 0x14, 0x99, 0x7f, 0xf4, 0x1d, 0x65, 0xbd, 0x92, 0x7c,
0xdf, 0x51, 0xd6, 0xab, 0x6c, 0x0e, 0xdc, 0x99, 0xc5, 0x1d, 0x84, 0x05, 0x92, 0x90, 0x03, 0xa3,
0x36, 0xd3, 0xab, 0xc1, 0xb9, 0xf3, 0xeb, 0xaf, 0x4e, 0xb1, 0x5d, 0xa7, 0xd8, 0x4f, 0xa7, 0xd8,
0x47, 0xaf, 0x82, 0x5d, 0xaf, 0x82, 0xef, 0x5e, 0x05, 0x4f, 0xa3, 0x36, 0x7d, 0x3d, 0xf5, 0xe7,
0xbc, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x91, 0x30, 0x00, 0x12, 0x5f, 0x01, 0x00, 0x00,
}

View File

@ -0,0 +1,40 @@
syntax = "proto3";
package live_user.v1;
option go_package = "v1";
service Note {
/** 大航海续费提醒
*
*/
rpc get (NoteGetReq) returns (NoteGetResp);
}
message NoteGetReq {
}
message NoteGetResp {
// code
int64 code = 1;
// msg 
string msg = 2;
//
Data data = 3;
message Data {
// logo 的 url
string logo = 1;
// 标题
string title = 2;
// 内容
string content = 3;
// 跳转链接
string link = 4;
}
}

View File

@ -0,0 +1,46 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/RoomAdmin.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
// ===================
// RoomAdmin Interface
// ===================
type RoomAdmin interface {
// * 判断是否房管,防止和room循环调用,传入所有参数
//
IsRoomAdmin(context.Context, *RoomAdminIsRoomAdminReq) (*RoomAdminIsRoomAdminResp, error)
}
// =========================
// RoomAdmin Live Rpc Client
// =========================
type roomAdminRpcClient struct {
client *liverpc.Client
}
// NewRoomAdminRpcClient creates a Rpc client that implements the RoomAdmin interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewRoomAdminRpcClient(client *liverpc.Client) RoomAdmin {
return &roomAdminRpcClient{
client: client,
}
}
func (c *roomAdminRpcClient) IsRoomAdmin(ctx context.Context, in *RoomAdminIsRoomAdminReq) (*RoomAdminIsRoomAdminResp, error) {
out := new(RoomAdminIsRoomAdminResp)
err := doRpcRequest(ctx, c.client, 1, "RoomAdmin.is_room_admin", in, out)
if err != nil {
return nil, err
}
return out, nil
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
syntax = "proto3";
package live_user.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service RoomAdmin {
/** 判断是否房管,防止和room循环调用,传入所有参数
*
*/
rpc is_room_admin (RoomAdminIsRoomAdminReq) returns (RoomAdminIsRoomAdminResp);
}
message RoomAdminIsRoomAdminReq {
// 用户id
string uid = 1 [(gogoproto.jsontag) = "uid"];
// 主播的用户 roomid
int64 roomid = 2 [(gogoproto.jsontag) = "roomid"];
// 主播的用户 anchor_id
int64 anchor_id = 3 [(gogoproto.jsontag) = "anchor_id"];
}
message RoomAdminIsRoomAdminResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message UI {
// 用户id
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 用户名
string uname = 2 [(gogoproto.jsontag) = "uname"];
}
message Data {
// banner
UI userinfo = 1 [(gogoproto.jsontag) = "userinfo"];
// 房管的用户id
int64 uid = 2 [(gogoproto.jsontag) = "uid"];
// 房间号
int64 roomid = 3 [(gogoproto.jsontag) = "roomid"];
// 创建时间 "2017-07-26 17:12:51"
string ctime = 4 [(gogoproto.jsontag) = "ctime"];
}
}

View File

@ -0,0 +1,46 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/UserSetting.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
// =====================
// UserSetting Interface
// =====================
type UserSetting interface {
// * 移动端首页获取用户关注标签
//
GetTag(context.Context, *UserSettingGetTagReq) (*UserSettingGetTagResp, error)
}
// ===========================
// UserSetting Live Rpc Client
// ===========================
type userSettingRpcClient struct {
client *liverpc.Client
}
// NewUserSettingRpcClient creates a Rpc client that implements the UserSetting interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewUserSettingRpcClient(client *liverpc.Client) UserSetting {
return &userSettingRpcClient{
client: client,
}
}
func (c *userSettingRpcClient) GetTag(ctx context.Context, in *UserSettingGetTagReq) (*UserSettingGetTagResp, error) {
out := new(UserSettingGetTagResp)
err := doRpcRequest(ctx, c.client, 1, "UserSetting.get_tag", in, out)
if err != nil {
return nil, err
}
return out, nil
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,65 @@
syntax = "proto3";
package live_user.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service UserSetting {
/** 移动端首页获取用户关注标签
*
*/
rpc get_tag (UserSettingGetTagReq) returns (UserSettingGetTagResp);
}
message UserSettingGetTagReq {
}
message UserSettingGetTagResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Tags {
// tag id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// tag name
string name = 2 [(gogoproto.jsontag) = "name"];
// 标签图标
string pic = 3 [(gogoproto.jsontag) = "pic"];
// 是否为推荐标签 1是 0否
int64 is_advice = 4 [(gogoproto.jsontag) = "is_advice"];
// 父分区id
int64 parent_id = 5 [(gogoproto.jsontag) = "parent_id"];
// 父分区名
string parent_name = 6 [(gogoproto.jsontag) = "parent_name"];
// 活动id
int64 act_id = 7 [(gogoproto.jsontag) = "act_id"];
}
message OfflineTags {
// 标签id
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 标签名称
string name = 2 [(gogoproto.jsontag) = "name"];
}
message Data {
// 常用标签列表
repeated Tags tags = 1 [(gogoproto.jsontag) = "tags"];
// 下线被删除的标签
repeated OfflineTags offline = 2 [(gogoproto.jsontag) = "offline"];
// 用户id
int64 uid = 3 [(gogoproto.jsontag) = "uid"];
// 是否灰度 1代表灰度 0不灰也就是不可见
int64 is_gray = 4 [(gogoproto.jsontag) = "is_gray"];
}
}