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,68 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/AdminSilent.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/AdminSilent.proto
v1/Shield.proto
v1/ShieldMng.proto
v1/Silent.proto
v1/SilentMng.proto
v1/SiteBlockMng.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:
// =====================
// AdminSilent Interface
// =====================
type AdminSilent interface {
// * 查询运营规则
// 拿着规则直接用就好了,有就肯定是当前生效的配置
GetShieldRule(context.Context, *AdminSilentGetShieldRuleReq) (*AdminSilentGetShieldRuleResp, error)
}
// ===========================
// AdminSilent Live Rpc Client
// ===========================
type adminSilentRpcClient struct {
client *liverpc.Client
}
// NewAdminSilentRpcClient creates a Rpc client that implements the AdminSilent interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewAdminSilentRpcClient(client *liverpc.Client) AdminSilent {
return &adminSilentRpcClient{
client: client,
}
}
func (c *adminSilentRpcClient) GetShieldRule(ctx context.Context, in *AdminSilentGetShieldRuleReq) (*AdminSilentGetShieldRuleResp, error) {
out := new(AdminSilentGetShieldRuleResp)
err := doRpcRequest(ctx, c.client, 1, "AdminSilent.get_shield_rule", 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
}

View File

@@ -0,0 +1,843 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/AdminSilent.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 AdminSilentGetShieldRuleReq struct {
//
Roomid int64 `protobuf:"varint,1,opt,name=roomid,proto3" json:"roomid"`
}
func (m *AdminSilentGetShieldRuleReq) Reset() { *m = AdminSilentGetShieldRuleReq{} }
func (m *AdminSilentGetShieldRuleReq) String() string { return proto.CompactTextString(m) }
func (*AdminSilentGetShieldRuleReq) ProtoMessage() {}
func (*AdminSilentGetShieldRuleReq) Descriptor() ([]byte, []int) {
return fileDescriptor_AdminSilent_417b426140a13835, []int{0}
}
func (m *AdminSilentGetShieldRuleReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AdminSilentGetShieldRuleReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AdminSilentGetShieldRuleReq.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 *AdminSilentGetShieldRuleReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_AdminSilentGetShieldRuleReq.Merge(dst, src)
}
func (m *AdminSilentGetShieldRuleReq) XXX_Size() int {
return m.Size()
}
func (m *AdminSilentGetShieldRuleReq) XXX_DiscardUnknown() {
xxx_messageInfo_AdminSilentGetShieldRuleReq.DiscardUnknown(m)
}
var xxx_messageInfo_AdminSilentGetShieldRuleReq proto.InternalMessageInfo
func (m *AdminSilentGetShieldRuleReq) GetRoomid() int64 {
if m != nil {
return m.Roomid
}
return 0
}
type AdminSilentGetShieldRuleResp struct {
//
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
//
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Data *AdminSilentGetShieldRuleResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *AdminSilentGetShieldRuleResp) Reset() { *m = AdminSilentGetShieldRuleResp{} }
func (m *AdminSilentGetShieldRuleResp) String() string { return proto.CompactTextString(m) }
func (*AdminSilentGetShieldRuleResp) ProtoMessage() {}
func (*AdminSilentGetShieldRuleResp) Descriptor() ([]byte, []int) {
return fileDescriptor_AdminSilent_417b426140a13835, []int{1}
}
func (m *AdminSilentGetShieldRuleResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AdminSilentGetShieldRuleResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AdminSilentGetShieldRuleResp.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 *AdminSilentGetShieldRuleResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_AdminSilentGetShieldRuleResp.Merge(dst, src)
}
func (m *AdminSilentGetShieldRuleResp) XXX_Size() int {
return m.Size()
}
func (m *AdminSilentGetShieldRuleResp) XXX_DiscardUnknown() {
xxx_messageInfo_AdminSilentGetShieldRuleResp.DiscardUnknown(m)
}
var xxx_messageInfo_AdminSilentGetShieldRuleResp proto.InternalMessageInfo
func (m *AdminSilentGetShieldRuleResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *AdminSilentGetShieldRuleResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *AdminSilentGetShieldRuleResp) GetData() *AdminSilentGetShieldRuleResp_Data {
if m != nil {
return m.Data
}
return nil
}
type AdminSilentGetShieldRuleResp_Data struct {
//
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id"`
// 为0表示全局规则
Roomid int64 `protobuf:"varint,2,opt,name=roomid,proto3" json:"roomid"`
// 房间真实分要求
RealScore int64 `protobuf:"varint,3,opt,name=real_score,json=realScore,proto3" json:"real_score"`
// 范围0~10, 乘以了10
AiScore int64 `protobuf:"varint,4,opt,name=ai_score,json=aiScore,proto3" json:"ai_score"`
}
func (m *AdminSilentGetShieldRuleResp_Data) Reset() { *m = AdminSilentGetShieldRuleResp_Data{} }
func (m *AdminSilentGetShieldRuleResp_Data) String() string { return proto.CompactTextString(m) }
func (*AdminSilentGetShieldRuleResp_Data) ProtoMessage() {}
func (*AdminSilentGetShieldRuleResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_AdminSilent_417b426140a13835, []int{1, 0}
}
func (m *AdminSilentGetShieldRuleResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AdminSilentGetShieldRuleResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AdminSilentGetShieldRuleResp_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 *AdminSilentGetShieldRuleResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_AdminSilentGetShieldRuleResp_Data.Merge(dst, src)
}
func (m *AdminSilentGetShieldRuleResp_Data) XXX_Size() int {
return m.Size()
}
func (m *AdminSilentGetShieldRuleResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_AdminSilentGetShieldRuleResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_AdminSilentGetShieldRuleResp_Data proto.InternalMessageInfo
func (m *AdminSilentGetShieldRuleResp_Data) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *AdminSilentGetShieldRuleResp_Data) GetRoomid() int64 {
if m != nil {
return m.Roomid
}
return 0
}
func (m *AdminSilentGetShieldRuleResp_Data) GetRealScore() int64 {
if m != nil {
return m.RealScore
}
return 0
}
func (m *AdminSilentGetShieldRuleResp_Data) GetAiScore() int64 {
if m != nil {
return m.AiScore
}
return 0
}
func init() {
proto.RegisterType((*AdminSilentGetShieldRuleReq)(nil), "banned_service.v1.AdminSilentGetShieldRuleReq")
proto.RegisterType((*AdminSilentGetShieldRuleResp)(nil), "banned_service.v1.AdminSilentGetShieldRuleResp")
proto.RegisterType((*AdminSilentGetShieldRuleResp_Data)(nil), "banned_service.v1.AdminSilentGetShieldRuleResp.Data")
}
func (m *AdminSilentGetShieldRuleReq) 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 *AdminSilentGetShieldRuleReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Roomid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintAdminSilent(dAtA, i, uint64(m.Roomid))
}
return i, nil
}
func (m *AdminSilentGetShieldRuleResp) 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 *AdminSilentGetShieldRuleResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintAdminSilent(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintAdminSilent(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintAdminSilent(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 *AdminSilentGetShieldRuleResp_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 *AdminSilentGetShieldRuleResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Id != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintAdminSilent(dAtA, i, uint64(m.Id))
}
if m.Roomid != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintAdminSilent(dAtA, i, uint64(m.Roomid))
}
if m.RealScore != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintAdminSilent(dAtA, i, uint64(m.RealScore))
}
if m.AiScore != 0 {
dAtA[i] = 0x20
i++
i = encodeVarintAdminSilent(dAtA, i, uint64(m.AiScore))
}
return i, nil
}
func encodeVarintAdminSilent(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 *AdminSilentGetShieldRuleReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Roomid != 0 {
n += 1 + sovAdminSilent(uint64(m.Roomid))
}
return n
}
func (m *AdminSilentGetShieldRuleResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovAdminSilent(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovAdminSilent(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovAdminSilent(uint64(l))
}
return n
}
func (m *AdminSilentGetShieldRuleResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Id != 0 {
n += 1 + sovAdminSilent(uint64(m.Id))
}
if m.Roomid != 0 {
n += 1 + sovAdminSilent(uint64(m.Roomid))
}
if m.RealScore != 0 {
n += 1 + sovAdminSilent(uint64(m.RealScore))
}
if m.AiScore != 0 {
n += 1 + sovAdminSilent(uint64(m.AiScore))
}
return n
}
func sovAdminSilent(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozAdminSilent(x uint64) (n int) {
return sovAdminSilent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *AdminSilentGetShieldRuleReq) 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 ErrIntOverflowAdminSilent
}
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: AdminSilentGetShieldRuleReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AdminSilentGetShieldRuleReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
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 ErrIntOverflowAdminSilent
}
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 := skipAdminSilent(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthAdminSilent
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *AdminSilentGetShieldRuleResp) 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 ErrIntOverflowAdminSilent
}
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: AdminSilentGetShieldRuleResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AdminSilentGetShieldRuleResp: 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 ErrIntOverflowAdminSilent
}
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 ErrIntOverflowAdminSilent
}
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 ErrInvalidLengthAdminSilent
}
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 ErrIntOverflowAdminSilent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthAdminSilent
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &AdminSilentGetShieldRuleResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipAdminSilent(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthAdminSilent
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *AdminSilentGetShieldRuleResp_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 ErrIntOverflowAdminSilent
}
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 ErrIntOverflowAdminSilent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= (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 ErrIntOverflowAdminSilent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Roomid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field RealScore", wireType)
}
m.RealScore = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAdminSilent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.RealScore |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field AiScore", wireType)
}
m.AiScore = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAdminSilent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.AiScore |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipAdminSilent(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthAdminSilent
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipAdminSilent(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, ErrIntOverflowAdminSilent
}
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, ErrIntOverflowAdminSilent
}
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, ErrIntOverflowAdminSilent
}
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, ErrInvalidLengthAdminSilent
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAdminSilent
}
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 := skipAdminSilent(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 (
ErrInvalidLengthAdminSilent = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowAdminSilent = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/AdminSilent.proto", fileDescriptor_AdminSilent_417b426140a13835) }
var fileDescriptor_AdminSilent_417b426140a13835 = []byte{
// 371 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xbd, 0x6a, 0xeb, 0x30,
0x18, 0x8d, 0x6c, 0x93, 0x1f, 0xe5, 0x72, 0x2f, 0x57, 0x5c, 0x2e, 0x69, 0x1a, 0xec, 0x90, 0xa5,
0x59, 0x62, 0x93, 0xb4, 0x2f, 0x10, 0x53, 0xe8, 0xae, 0x6c, 0x5d, 0x8c, 0x6c, 0xa9, 0x8e, 0xc0,
0xb6, 0x12, 0xff, 0xed, 0x7d, 0x83, 0xce, 0x7d, 0xa2, 0x8c, 0x19, 0x3b, 0x99, 0x92, 0x6c, 0x7e,
0x8a, 0x62, 0xc5, 0x04, 0x43, 0x49, 0x21, 0xcb, 0xa7, 0xef, 0x1c, 0x1d, 0xce, 0xa7, 0xf3, 0x21,
0xf8, 0x2f, 0x9f, 0x5b, 0x4b, 0x1a, 0xf2, 0x68, 0xc5, 0x03, 0x16, 0xa5, 0xe6, 0x26, 0x16, 0xa9,
0x40, 0x7f, 0x5d, 0x12, 0x45, 0x8c, 0x3a, 0x09, 0x8b, 0x73, 0xee, 0x31, 0x33, 0x9f, 0x0f, 0x67,
0x3e, 0x4f, 0xd7, 0x99, 0x6b, 0x7a, 0x22, 0xb4, 0x7c, 0xe1, 0x0b, 0x4b, 0x2a, 0xdd, 0xec, 0x45,
0x22, 0x09, 0x64, 0x77, 0x72, 0x98, 0x2c, 0xe1, 0x6d, 0xc3, 0xf6, 0x89, 0xa5, 0xab, 0x35, 0x67,
0x01, 0xc5, 0x59, 0xc0, 0x30, 0xdb, 0xa2, 0x09, 0x6c, 0xc7, 0x42, 0x84, 0x9c, 0x0e, 0xc0, 0x18,
0x4c, 0x55, 0x1b, 0x96, 0x85, 0x51, 0x33, 0xb8, 0x3e, 0x27, 0x3b, 0x05, 0x8e, 0x2e, 0x7b, 0x24,
0x1b, 0x34, 0x82, 0x9a, 0x27, 0x28, 0xab, 0x2d, 0xba, 0x65, 0x61, 0x48, 0x8c, 0x65, 0x45, 0x37,
0x50, 0x0d, 0x13, 0x7f, 0xa0, 0x8c, 0xc1, 0xb4, 0x67, 0x77, 0xca, 0xc2, 0xa8, 0x20, 0xae, 0x0a,
0xc2, 0x50, 0xa3, 0x24, 0x25, 0x03, 0x75, 0x0c, 0xa6, 0xfd, 0xc5, 0x83, 0xf9, 0x2d, 0xad, 0xf9,
0xd3, 0x5c, 0xf3, 0x91, 0xa4, 0xe4, 0x34, 0xae, 0x72, 0xc1, 0xb2, 0x0e, 0xdf, 0x01, 0xd4, 0xaa,
0x0b, 0xf4, 0x1f, 0x2a, 0xe7, 0x58, 0xed, 0xb2, 0x30, 0x14, 0x4e, 0xb1, 0xc2, 0x69, 0x23, 0xb2,
0x72, 0x29, 0x32, 0x9a, 0x41, 0x18, 0x33, 0x12, 0x38, 0x89, 0x27, 0x62, 0x26, 0x9f, 0xa7, 0xda,
0xbf, 0xcb, 0xc2, 0x68, 0xb0, 0xb8, 0x57, 0xf5, 0xab, 0xaa, 0x45, 0x77, 0xb0, 0x4b, 0x78, 0x2d,
0xd6, 0xa4, 0xf8, 0x57, 0x59, 0x18, 0x67, 0x0e, 0x77, 0x08, 0x97, 0xc2, 0xc5, 0x2b, 0x80, 0xfd,
0x46, 0x24, 0x14, 0xc3, 0x3f, 0x3e, 0x4b, 0x9d, 0x44, 0xe6, 0x72, 0xe2, 0x2c, 0x60, 0xc8, 0xbc,
0x6a, 0x0b, 0xdb, 0xa1, 0x75, 0xe5, 0xd6, 0xec, 0xd1, 0xee, 0xa0, 0x83, 0xfd, 0x41, 0x07, 0x9f,
0x07, 0x1d, 0xbc, 0x1d, 0xf5, 0xd6, 0xfe, 0xa8, 0xb7, 0x3e, 0x8e, 0x7a, 0xeb, 0x59, 0xc9, 0xe7,
0x6e, 0x5b, 0x7e, 0x9b, 0xfb, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x64, 0x72, 0xc0, 0x5a, 0x90,
0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
package banned_service.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service AdminSilent {
/** 查询运营规则
* 拿着规则直接用就好了,有就肯定是当前生效的配置
*/
rpc get_shield_rule (AdminSilentGetShieldRuleReq) returns (AdminSilentGetShieldRuleResp);
}
message AdminSilentGetShieldRuleReq {
//
int64 roomid = 1 [(gogoproto.jsontag) = "roomid"];
}
message AdminSilentGetShieldRuleResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
//
int64 id = 1 [(gogoproto.jsontag) = "id"];
// 为0表示全局规则
int64 roomid = 2 [(gogoproto.jsontag) = "roomid"];
// 房间真实分要求
int64 real_score = 3 [(gogoproto.jsontag) = "real_score"];
// 范围0~10, 乘以了10
int64 ai_score = 4 [(gogoproto.jsontag) = "ai_score"];
}
}

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",
)
proto_library(
name = "v1_proto",
srcs = [
"AdminSilent.proto",
"Shield.proto",
"ShieldMng.proto",
"Silent.proto",
"SilentMng.proto",
"SiteBlockMng.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/banned_service/api/liverpc/v1",
proto = ":v1_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"AdminSilent.liverpc.go",
"Shield.liverpc.go",
"ShieldMng.liverpc.go",
"Silent.liverpc.go",
"SilentMng.liverpc.go",
"SiteBlockMng.liverpc.go",
],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/live/banned_service/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,46 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Shield.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
// ================
// Shield Interface
// ================
type Shield interface {
// * 是否是屏蔽内容
// 用于房主启用过滤之后,查询弹幕内容是否命中关键字
IsShieldContent(context.Context, *ShieldIsShieldContentReq) (*ShieldIsShieldContentResp, error)
}
// ======================
// Shield Live Rpc Client
// ======================
type shieldRpcClient struct {
client *liverpc.Client
}
// NewShieldRpcClient creates a Rpc client that implements the Shield interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewShieldRpcClient(client *liverpc.Client) Shield {
return &shieldRpcClient{
client: client,
}
}
func (c *shieldRpcClient) IsShieldContent(ctx context.Context, in *ShieldIsShieldContentReq) (*ShieldIsShieldContentResp, error) {
out := new(ShieldIsShieldContentResp)
err := doRpcRequest(ctx, c.client, 1, "Shield.is_shield_content", in, out)
if err != nil {
return nil, err
}
return out, nil
}

View File

@@ -0,0 +1,871 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/Shield.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 ShieldIsShieldContentReq struct {
// 房主uid
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
// 内容
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content"`
}
func (m *ShieldIsShieldContentReq) Reset() { *m = ShieldIsShieldContentReq{} }
func (m *ShieldIsShieldContentReq) String() string { return proto.CompactTextString(m) }
func (*ShieldIsShieldContentReq) ProtoMessage() {}
func (*ShieldIsShieldContentReq) Descriptor() ([]byte, []int) {
return fileDescriptor_Shield_14b4a725a4fd2eaf, []int{0}
}
func (m *ShieldIsShieldContentReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ShieldIsShieldContentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ShieldIsShieldContentReq.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 *ShieldIsShieldContentReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShieldIsShieldContentReq.Merge(dst, src)
}
func (m *ShieldIsShieldContentReq) XXX_Size() int {
return m.Size()
}
func (m *ShieldIsShieldContentReq) XXX_DiscardUnknown() {
xxx_messageInfo_ShieldIsShieldContentReq.DiscardUnknown(m)
}
var xxx_messageInfo_ShieldIsShieldContentReq proto.InternalMessageInfo
func (m *ShieldIsShieldContentReq) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *ShieldIsShieldContentReq) GetContent() string {
if m != nil {
return m.Content
}
return ""
}
type ShieldIsShieldContentResp struct {
//
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
//
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Data *ShieldIsShieldContentResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *ShieldIsShieldContentResp) Reset() { *m = ShieldIsShieldContentResp{} }
func (m *ShieldIsShieldContentResp) String() string { return proto.CompactTextString(m) }
func (*ShieldIsShieldContentResp) ProtoMessage() {}
func (*ShieldIsShieldContentResp) Descriptor() ([]byte, []int) {
return fileDescriptor_Shield_14b4a725a4fd2eaf, []int{1}
}
func (m *ShieldIsShieldContentResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ShieldIsShieldContentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ShieldIsShieldContentResp.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 *ShieldIsShieldContentResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShieldIsShieldContentResp.Merge(dst, src)
}
func (m *ShieldIsShieldContentResp) XXX_Size() int {
return m.Size()
}
func (m *ShieldIsShieldContentResp) XXX_DiscardUnknown() {
xxx_messageInfo_ShieldIsShieldContentResp.DiscardUnknown(m)
}
var xxx_messageInfo_ShieldIsShieldContentResp proto.InternalMessageInfo
func (m *ShieldIsShieldContentResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *ShieldIsShieldContentResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *ShieldIsShieldContentResp) GetData() *ShieldIsShieldContentResp_Data {
if m != nil {
return m.Data
}
return nil
}
type ShieldIsShieldContentResp_Data struct {
//
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
// 是否是被屏蔽的内容
IsShieldContent bool `protobuf:"varint,2,opt,name=is_shield_content,json=isShieldContent,proto3" json:"is_shield_content"`
// 命中的屏蔽词
ShieldBy string `protobuf:"bytes,3,opt,name=shield_by,json=shieldBy,proto3" json:"shield_by"`
}
func (m *ShieldIsShieldContentResp_Data) Reset() { *m = ShieldIsShieldContentResp_Data{} }
func (m *ShieldIsShieldContentResp_Data) String() string { return proto.CompactTextString(m) }
func (*ShieldIsShieldContentResp_Data) ProtoMessage() {}
func (*ShieldIsShieldContentResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_Shield_14b4a725a4fd2eaf, []int{1, 0}
}
func (m *ShieldIsShieldContentResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ShieldIsShieldContentResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ShieldIsShieldContentResp_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 *ShieldIsShieldContentResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShieldIsShieldContentResp_Data.Merge(dst, src)
}
func (m *ShieldIsShieldContentResp_Data) XXX_Size() int {
return m.Size()
}
func (m *ShieldIsShieldContentResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_ShieldIsShieldContentResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_ShieldIsShieldContentResp_Data proto.InternalMessageInfo
func (m *ShieldIsShieldContentResp_Data) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *ShieldIsShieldContentResp_Data) GetIsShieldContent() bool {
if m != nil {
return m.IsShieldContent
}
return false
}
func (m *ShieldIsShieldContentResp_Data) GetShieldBy() string {
if m != nil {
return m.ShieldBy
}
return ""
}
func init() {
proto.RegisterType((*ShieldIsShieldContentReq)(nil), "banned_service.v1.ShieldIsShieldContentReq")
proto.RegisterType((*ShieldIsShieldContentResp)(nil), "banned_service.v1.ShieldIsShieldContentResp")
proto.RegisterType((*ShieldIsShieldContentResp_Data)(nil), "banned_service.v1.ShieldIsShieldContentResp.Data")
}
func (m *ShieldIsShieldContentReq) 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 *ShieldIsShieldContentReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintShield(dAtA, i, uint64(m.Uid))
}
if len(m.Content) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintShield(dAtA, i, uint64(len(m.Content)))
i += copy(dAtA[i:], m.Content)
}
return i, nil
}
func (m *ShieldIsShieldContentResp) 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 *ShieldIsShieldContentResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintShield(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintShield(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintShield(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 *ShieldIsShieldContentResp_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 *ShieldIsShieldContentResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintShield(dAtA, i, uint64(m.Uid))
}
if m.IsShieldContent {
dAtA[i] = 0x10
i++
if m.IsShieldContent {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if len(m.ShieldBy) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintShield(dAtA, i, uint64(len(m.ShieldBy)))
i += copy(dAtA[i:], m.ShieldBy)
}
return i, nil
}
func encodeVarintShield(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 *ShieldIsShieldContentReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovShield(uint64(m.Uid))
}
l = len(m.Content)
if l > 0 {
n += 1 + l + sovShield(uint64(l))
}
return n
}
func (m *ShieldIsShieldContentResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovShield(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovShield(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovShield(uint64(l))
}
return n
}
func (m *ShieldIsShieldContentResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovShield(uint64(m.Uid))
}
if m.IsShieldContent {
n += 2
}
l = len(m.ShieldBy)
if l > 0 {
n += 1 + l + sovShield(uint64(l))
}
return n
}
func sovShield(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozShield(x uint64) (n int) {
return sovShield(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ShieldIsShieldContentReq) 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 ErrIntOverflowShield
}
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: ShieldIsShieldContentReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ShieldIsShieldContentReq: 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 ErrIntOverflowShield
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Uid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
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 ErrIntOverflowShield
}
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 ErrInvalidLengthShield
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Content = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipShield(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthShield
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ShieldIsShieldContentResp) 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 ErrIntOverflowShield
}
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: ShieldIsShieldContentResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ShieldIsShieldContentResp: 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 ErrIntOverflowShield
}
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 ErrIntOverflowShield
}
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 ErrInvalidLengthShield
}
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 ErrIntOverflowShield
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthShield
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &ShieldIsShieldContentResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipShield(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthShield
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ShieldIsShieldContentResp_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 ErrIntOverflowShield
}
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 Uid", wireType)
}
m.Uid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShield
}
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 IsShieldContent", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShield
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.IsShieldContent = bool(v != 0)
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ShieldBy", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShield
}
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 ErrInvalidLengthShield
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ShieldBy = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipShield(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthShield
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipShield(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, ErrIntOverflowShield
}
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, ErrIntOverflowShield
}
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, ErrIntOverflowShield
}
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, ErrInvalidLengthShield
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowShield
}
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 := skipShield(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 (
ErrInvalidLengthShield = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowShield = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/Shield.proto", fileDescriptor_Shield_14b4a725a4fd2eaf) }
var fileDescriptor_Shield_14b4a725a4fd2eaf = []byte{
// 351 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x33, 0xd4, 0x0f,
0xce, 0xc8, 0x4c, 0xcd, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4c, 0x4a, 0xcc,
0xcb, 0x4b, 0x4d, 0x89, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x33, 0x94, 0xd2,
0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7,
0x07, 0xab, 0x4c, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0x62, 0x82, 0x52, 0x0c, 0x97,
0x04, 0xc4, 0x44, 0xcf, 0x62, 0x08, 0xed, 0x9c, 0x9f, 0x57, 0x92, 0x9a, 0x57, 0x12, 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, 0xb9, 0xd8, 0x93, 0x21, 0x0a, 0x25, 0x98,
0x14, 0x18, 0x35, 0x38, 0x9d, 0xb8, 0x5f, 0xdd, 0x93, 0x87, 0x09, 0x05, 0xc1, 0x18, 0x4a, 0x3b,
0x98, 0xb8, 0x24, 0x71, 0x18, 0x5f, 0x5c, 0x20, 0x24, 0xc3, 0xc5, 0x92, 0x9c, 0x9f, 0x92, 0x0a,
0xb5, 0x80, 0xe3, 0xd5, 0x3d, 0x79, 0x30, 0x3f, 0x08, 0x4c, 0x82, 0x6c, 0xcf, 0x2d, 0x4e, 0x87,
0x1a, 0x0f, 0xb6, 0x3d, 0xb7, 0x38, 0x3d, 0x08, 0x44, 0x08, 0xf9, 0x73, 0xb1, 0xa4, 0x24, 0x96,
0x24, 0x4a, 0x30, 0x2b, 0x30, 0x6a, 0x70, 0x1b, 0x19, 0xea, 0x61, 0x84, 0x82, 0x1e, 0x4e, 0x4b,
0xf5, 0x5c, 0x12, 0x4b, 0x12, 0x21, 0x76, 0x81, 0x8c, 0x08, 0x02, 0x93, 0x52, 0x13, 0x18, 0xb9,
0x58, 0x40, 0x12, 0xf8, 0xbc, 0xec, 0xc8, 0x25, 0x98, 0x59, 0x1c, 0x5f, 0x0c, 0x36, 0x30, 0x1e,
0xd9, 0xf3, 0x1c, 0x4e, 0xa2, 0xaf, 0xee, 0xc9, 0x63, 0x4a, 0x06, 0xf1, 0x67, 0xa2, 0xda, 0x2f,
0xa4, 0xc5, 0xc5, 0x09, 0x55, 0x92, 0x54, 0x09, 0x76, 0x3c, 0xa7, 0x13, 0xef, 0xab, 0x7b, 0xf2,
0x08, 0xc1, 0x20, 0x0e, 0x08, 0xd3, 0xa9, 0xd2, 0xa8, 0x82, 0x8b, 0x0d, 0xa2, 0x59, 0x28, 0x0f,
0x8b, 0xc5, 0x42, 0xda, 0xc4, 0x7b, 0xba, 0x50, 0x4a, 0x87, 0x94, 0x10, 0x72, 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, 0xba,
0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x49, 0x4c, 0xac, 0x53, 0x8c, 0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
package banned_service.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Shield {
/** 是否是屏蔽内容
* 用于房主启用过滤之后,查询弹幕内容是否命中关键字
*/
rpc is_shield_content (ShieldIsShieldContentReq) returns (ShieldIsShieldContentResp);
}
message ShieldIsShieldContentReq {
// 房主uid
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 内容
string content = 2 [(gogoproto.jsontag) = "content"];
}
message ShieldIsShieldContentResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
//
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
// 是否是被屏蔽的内容
bool is_shield_content = 2 [(gogoproto.jsontag) = "is_shield_content"];
// 命中的屏蔽词
string shield_by = 3 [(gogoproto.jsontag) = "shield_by"];
}
}

View File

@@ -0,0 +1,46 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/ShieldMng.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
// ===================
// ShieldMng Interface
// ===================
type ShieldMng interface {
// * 查询用户是否被屏蔽
//
IsShieldUser(context.Context, *ShieldMngIsShieldUserReq) (*ShieldMngIsShieldUserResp, error)
}
// =========================
// ShieldMng Live Rpc Client
// =========================
type shieldMngRpcClient struct {
client *liverpc.Client
}
// NewShieldMngRpcClient creates a Rpc client that implements the ShieldMng interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewShieldMngRpcClient(client *liverpc.Client) ShieldMng {
return &shieldMngRpcClient{
client: client,
}
}
func (c *shieldMngRpcClient) IsShieldUser(ctx context.Context, in *ShieldMngIsShieldUserReq) (*ShieldMngIsShieldUserResp, error) {
out := new(ShieldMngIsShieldUserResp)
err := doRpcRequest(ctx, c.client, 1, "ShieldMng.is_shield_user", 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/ShieldMng.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 ShieldMngIsShieldUserReq struct {
//
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
//
ShieldUid int64 `protobuf:"varint,2,opt,name=shield_uid,json=shieldUid,proto3" json:"shield_uid"`
}
func (m *ShieldMngIsShieldUserReq) Reset() { *m = ShieldMngIsShieldUserReq{} }
func (m *ShieldMngIsShieldUserReq) String() string { return proto.CompactTextString(m) }
func (*ShieldMngIsShieldUserReq) ProtoMessage() {}
func (*ShieldMngIsShieldUserReq) Descriptor() ([]byte, []int) {
return fileDescriptor_ShieldMng_c683407439c9b594, []int{0}
}
func (m *ShieldMngIsShieldUserReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ShieldMngIsShieldUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ShieldMngIsShieldUserReq.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 *ShieldMngIsShieldUserReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShieldMngIsShieldUserReq.Merge(dst, src)
}
func (m *ShieldMngIsShieldUserReq) XXX_Size() int {
return m.Size()
}
func (m *ShieldMngIsShieldUserReq) XXX_DiscardUnknown() {
xxx_messageInfo_ShieldMngIsShieldUserReq.DiscardUnknown(m)
}
var xxx_messageInfo_ShieldMngIsShieldUserReq proto.InternalMessageInfo
func (m *ShieldMngIsShieldUserReq) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *ShieldMngIsShieldUserReq) GetShieldUid() int64 {
if m != nil {
return m.ShieldUid
}
return 0
}
type ShieldMngIsShieldUserResp struct {
//
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
//
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Data *ShieldMngIsShieldUserResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *ShieldMngIsShieldUserResp) Reset() { *m = ShieldMngIsShieldUserResp{} }
func (m *ShieldMngIsShieldUserResp) String() string { return proto.CompactTextString(m) }
func (*ShieldMngIsShieldUserResp) ProtoMessage() {}
func (*ShieldMngIsShieldUserResp) Descriptor() ([]byte, []int) {
return fileDescriptor_ShieldMng_c683407439c9b594, []int{1}
}
func (m *ShieldMngIsShieldUserResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ShieldMngIsShieldUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ShieldMngIsShieldUserResp.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 *ShieldMngIsShieldUserResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShieldMngIsShieldUserResp.Merge(dst, src)
}
func (m *ShieldMngIsShieldUserResp) XXX_Size() int {
return m.Size()
}
func (m *ShieldMngIsShieldUserResp) XXX_DiscardUnknown() {
xxx_messageInfo_ShieldMngIsShieldUserResp.DiscardUnknown(m)
}
var xxx_messageInfo_ShieldMngIsShieldUserResp proto.InternalMessageInfo
func (m *ShieldMngIsShieldUserResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *ShieldMngIsShieldUserResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *ShieldMngIsShieldUserResp) GetData() *ShieldMngIsShieldUserResp_Data {
if m != nil {
return m.Data
}
return nil
}
type ShieldMngIsShieldUserResp_Data struct {
//
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
//
ShieldUid int64 `protobuf:"varint,2,opt,name=shield_uid,json=shieldUid,proto3" json:"shield_uid"`
//
IsShieldUser bool `protobuf:"varint,3,opt,name=is_shield_user,json=isShieldUser,proto3" json:"is_shield_user"`
}
func (m *ShieldMngIsShieldUserResp_Data) Reset() { *m = ShieldMngIsShieldUserResp_Data{} }
func (m *ShieldMngIsShieldUserResp_Data) String() string { return proto.CompactTextString(m) }
func (*ShieldMngIsShieldUserResp_Data) ProtoMessage() {}
func (*ShieldMngIsShieldUserResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_ShieldMng_c683407439c9b594, []int{1, 0}
}
func (m *ShieldMngIsShieldUserResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ShieldMngIsShieldUserResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ShieldMngIsShieldUserResp_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 *ShieldMngIsShieldUserResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShieldMngIsShieldUserResp_Data.Merge(dst, src)
}
func (m *ShieldMngIsShieldUserResp_Data) XXX_Size() int {
return m.Size()
}
func (m *ShieldMngIsShieldUserResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_ShieldMngIsShieldUserResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_ShieldMngIsShieldUserResp_Data proto.InternalMessageInfo
func (m *ShieldMngIsShieldUserResp_Data) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *ShieldMngIsShieldUserResp_Data) GetShieldUid() int64 {
if m != nil {
return m.ShieldUid
}
return 0
}
func (m *ShieldMngIsShieldUserResp_Data) GetIsShieldUser() bool {
if m != nil {
return m.IsShieldUser
}
return false
}
func init() {
proto.RegisterType((*ShieldMngIsShieldUserReq)(nil), "banned_service.v1.ShieldMngIsShieldUserReq")
proto.RegisterType((*ShieldMngIsShieldUserResp)(nil), "banned_service.v1.ShieldMngIsShieldUserResp")
proto.RegisterType((*ShieldMngIsShieldUserResp_Data)(nil), "banned_service.v1.ShieldMngIsShieldUserResp.Data")
}
func (m *ShieldMngIsShieldUserReq) 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 *ShieldMngIsShieldUserReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintShieldMng(dAtA, i, uint64(m.Uid))
}
if m.ShieldUid != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintShieldMng(dAtA, i, uint64(m.ShieldUid))
}
return i, nil
}
func (m *ShieldMngIsShieldUserResp) 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 *ShieldMngIsShieldUserResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintShieldMng(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintShieldMng(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintShieldMng(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 *ShieldMngIsShieldUserResp_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 *ShieldMngIsShieldUserResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintShieldMng(dAtA, i, uint64(m.Uid))
}
if m.ShieldUid != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintShieldMng(dAtA, i, uint64(m.ShieldUid))
}
if m.IsShieldUser {
dAtA[i] = 0x18
i++
if m.IsShieldUser {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
return i, nil
}
func encodeVarintShieldMng(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 *ShieldMngIsShieldUserReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovShieldMng(uint64(m.Uid))
}
if m.ShieldUid != 0 {
n += 1 + sovShieldMng(uint64(m.ShieldUid))
}
return n
}
func (m *ShieldMngIsShieldUserResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovShieldMng(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovShieldMng(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovShieldMng(uint64(l))
}
return n
}
func (m *ShieldMngIsShieldUserResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovShieldMng(uint64(m.Uid))
}
if m.ShieldUid != 0 {
n += 1 + sovShieldMng(uint64(m.ShieldUid))
}
if m.IsShieldUser {
n += 2
}
return n
}
func sovShieldMng(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozShieldMng(x uint64) (n int) {
return sovShieldMng(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ShieldMngIsShieldUserReq) 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 ErrIntOverflowShieldMng
}
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: ShieldMngIsShieldUserReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ShieldMngIsShieldUserReq: 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 ErrIntOverflowShieldMng
}
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 ShieldUid", wireType)
}
m.ShieldUid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShieldMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ShieldUid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipShieldMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthShieldMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ShieldMngIsShieldUserResp) 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 ErrIntOverflowShieldMng
}
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: ShieldMngIsShieldUserResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ShieldMngIsShieldUserResp: 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 ErrIntOverflowShieldMng
}
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 ErrIntOverflowShieldMng
}
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 ErrInvalidLengthShieldMng
}
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 ErrIntOverflowShieldMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthShieldMng
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &ShieldMngIsShieldUserResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipShieldMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthShieldMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ShieldMngIsShieldUserResp_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 ErrIntOverflowShieldMng
}
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 Uid", wireType)
}
m.Uid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShieldMng
}
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 ShieldUid", wireType)
}
m.ShieldUid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShieldMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ShieldUid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field IsShieldUser", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShieldMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.IsShieldUser = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipShieldMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthShieldMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipShieldMng(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, ErrIntOverflowShieldMng
}
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, ErrIntOverflowShieldMng
}
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, ErrIntOverflowShieldMng
}
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, ErrInvalidLengthShieldMng
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowShieldMng
}
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 := skipShieldMng(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 (
ErrInvalidLengthShieldMng = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowShieldMng = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/ShieldMng.proto", fileDescriptor_ShieldMng_c683407439c9b594) }
var fileDescriptor_ShieldMng_c683407439c9b594 = []byte{
// 333 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x33, 0xd4, 0x0f,
0xce, 0xc8, 0x4c, 0xcd, 0x49, 0xf1, 0xcd, 0x4b, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12,
0x4c, 0x4a, 0xcc, 0xcb, 0x4b, 0x4d, 0x89, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b,
0x33, 0x94, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf,
0x4f, 0xcf, 0xd7, 0x07, 0xab, 0x4c, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0x62, 0x82,
0x52, 0x0a, 0x97, 0x04, 0xdc, 0x50, 0xcf, 0x62, 0x08, 0x33, 0xb4, 0x38, 0xb5, 0x28, 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, 0x08, 0xe9, 0x72, 0x71, 0x15, 0x83, 0xd5, 0xc6, 0x83,
0x54, 0x30, 0x81, 0x55, 0xf0, 0xbd, 0xba, 0x27, 0x8f, 0x24, 0x1a, 0xc4, 0x09, 0x61, 0x87, 0x66,
0xa6, 0x28, 0x6d, 0x62, 0xe2, 0x92, 0xc4, 0x61, 0x4d, 0x71, 0x81, 0x90, 0x0c, 0x17, 0x4b, 0x72,
0x7e, 0x4a, 0x2a, 0xd4, 0x22, 0x8e, 0x57, 0xf7, 0xe4, 0xc1, 0xfc, 0x20, 0x30, 0x09, 0x72, 0x45,
0x6e, 0x71, 0x3a, 0xd8, 0x0e, 0x4e, 0x88, 0x2b, 0x72, 0x8b, 0xd3, 0x83, 0x40, 0x84, 0x90, 0x3f,
0x17, 0x4b, 0x4a, 0x62, 0x49, 0xa2, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xa1, 0x1e, 0x46,
0x68, 0xe8, 0xe1, 0xb4, 0x54, 0xcf, 0x25, 0xb1, 0x24, 0x11, 0x62, 0x17, 0xc8, 0x88, 0x20, 0x30,
0x29, 0xd5, 0xc5, 0xc8, 0xc5, 0x02, 0x92, 0xa0, 0x9e, 0xd7, 0x85, 0x2c, 0xb8, 0xf8, 0x32, 0x8b,
0xe3, 0x61, 0x72, 0xc5, 0xa9, 0x45, 0x60, 0xd7, 0x72, 0x38, 0x09, 0xbd, 0xba, 0x27, 0x8f, 0x26,
0x13, 0xc4, 0x93, 0x89, 0xe4, 0x4a, 0xa3, 0x0a, 0x2e, 0x4e, 0xb8, 0xf3, 0x85, 0xb2, 0xd1, 0x8d,
0x11, 0xd2, 0x26, 0xde, 0xbb, 0x85, 0x52, 0x3a, 0xa4, 0x84, 0x8d, 0x93, 0xcc, 0x89, 0x47, 0x72,
0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7,
0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x31, 0x95, 0x19, 0x26, 0xb1, 0x81, 0x53, 0x8e, 0x31,
0x20, 0x00, 0x00, 0xff, 0xff, 0x0a, 0xf8, 0x63, 0x71, 0x91, 0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,42 @@
syntax = "proto3";
package banned_service.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service ShieldMng {
/** 查询用户是否被屏蔽
*
*/
rpc is_shield_user (ShieldMngIsShieldUserReq) returns (ShieldMngIsShieldUserResp);
}
message ShieldMngIsShieldUserReq {
//
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
//
int64 shield_uid = 2 [(gogoproto.jsontag) = "shield_uid"];
}
message ShieldMngIsShieldUserResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
//
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
//
int64 shield_uid = 2 [(gogoproto.jsontag) = "shield_uid"];
//
bool is_shield_user = 3 [(gogoproto.jsontag) = "is_shield_user"];
}
}

View File

@@ -0,0 +1,46 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/Silent.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
// ================
// Silent Interface
// ================
type Silent interface {
// * 获取禁言
//
GetRoomSilent(context.Context, *SilentGetRoomSilentReq) (*SilentGetRoomSilentResp, error)
}
// ======================
// Silent Live Rpc Client
// ======================
type silentRpcClient struct {
client *liverpc.Client
}
// NewSilentRpcClient creates a Rpc client that implements the Silent interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewSilentRpcClient(client *liverpc.Client) Silent {
return &silentRpcClient{
client: client,
}
}
func (c *silentRpcClient) GetRoomSilent(ctx context.Context, in *SilentGetRoomSilentReq) (*SilentGetRoomSilentResp, error) {
out := new(SilentGetRoomSilentResp)
err := doRpcRequest(ctx, c.client, 1, "Silent.get_room_silent", in, out)
if err != nil {
return nil, err
}
return out, nil
}

View File

@@ -0,0 +1,817 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/Silent.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 SilentGetRoomSilentReq struct {
//
RoomId int64 `protobuf:"varint,1,opt,name=room_id,json=roomId,proto3" json:"room_id"`
}
func (m *SilentGetRoomSilentReq) Reset() { *m = SilentGetRoomSilentReq{} }
func (m *SilentGetRoomSilentReq) String() string { return proto.CompactTextString(m) }
func (*SilentGetRoomSilentReq) ProtoMessage() {}
func (*SilentGetRoomSilentReq) Descriptor() ([]byte, []int) {
return fileDescriptor_Silent_de6616e052635452, []int{0}
}
func (m *SilentGetRoomSilentReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SilentGetRoomSilentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SilentGetRoomSilentReq.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 *SilentGetRoomSilentReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_SilentGetRoomSilentReq.Merge(dst, src)
}
func (m *SilentGetRoomSilentReq) XXX_Size() int {
return m.Size()
}
func (m *SilentGetRoomSilentReq) XXX_DiscardUnknown() {
xxx_messageInfo_SilentGetRoomSilentReq.DiscardUnknown(m)
}
var xxx_messageInfo_SilentGetRoomSilentReq proto.InternalMessageInfo
func (m *SilentGetRoomSilentReq) GetRoomId() int64 {
if m != nil {
return m.RoomId
}
return 0
}
type SilentGetRoomSilentResp struct {
//
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
//
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Data *SilentGetRoomSilentResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *SilentGetRoomSilentResp) Reset() { *m = SilentGetRoomSilentResp{} }
func (m *SilentGetRoomSilentResp) String() string { return proto.CompactTextString(m) }
func (*SilentGetRoomSilentResp) ProtoMessage() {}
func (*SilentGetRoomSilentResp) Descriptor() ([]byte, []int) {
return fileDescriptor_Silent_de6616e052635452, []int{1}
}
func (m *SilentGetRoomSilentResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SilentGetRoomSilentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SilentGetRoomSilentResp.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 *SilentGetRoomSilentResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_SilentGetRoomSilentResp.Merge(dst, src)
}
func (m *SilentGetRoomSilentResp) XXX_Size() int {
return m.Size()
}
func (m *SilentGetRoomSilentResp) XXX_DiscardUnknown() {
xxx_messageInfo_SilentGetRoomSilentResp.DiscardUnknown(m)
}
var xxx_messageInfo_SilentGetRoomSilentResp proto.InternalMessageInfo
func (m *SilentGetRoomSilentResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *SilentGetRoomSilentResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *SilentGetRoomSilentResp) GetData() *SilentGetRoomSilentResp_Data {
if m != nil {
return m.Data
}
return nil
}
type SilentGetRoomSilentResp_Data struct {
// level等级 medal粉丝勋章等级 member全部
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type"`
// 等级type=level时为用户等级要求 type为medal为粉丝勋章等级要求 type为member时1表示开启0表示未开启
Level int64 `protobuf:"varint,2,opt,name=level,proto3" json:"level"`
// 还剩多少秒时间到期, -1表示直到直播结束都不过期
Second int64 `protobuf:"varint,3,opt,name=second,proto3" json:"second"`
}
func (m *SilentGetRoomSilentResp_Data) Reset() { *m = SilentGetRoomSilentResp_Data{} }
func (m *SilentGetRoomSilentResp_Data) String() string { return proto.CompactTextString(m) }
func (*SilentGetRoomSilentResp_Data) ProtoMessage() {}
func (*SilentGetRoomSilentResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_Silent_de6616e052635452, []int{1, 0}
}
func (m *SilentGetRoomSilentResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SilentGetRoomSilentResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SilentGetRoomSilentResp_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 *SilentGetRoomSilentResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_SilentGetRoomSilentResp_Data.Merge(dst, src)
}
func (m *SilentGetRoomSilentResp_Data) XXX_Size() int {
return m.Size()
}
func (m *SilentGetRoomSilentResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_SilentGetRoomSilentResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_SilentGetRoomSilentResp_Data proto.InternalMessageInfo
func (m *SilentGetRoomSilentResp_Data) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (m *SilentGetRoomSilentResp_Data) GetLevel() int64 {
if m != nil {
return m.Level
}
return 0
}
func (m *SilentGetRoomSilentResp_Data) GetSecond() int64 {
if m != nil {
return m.Second
}
return 0
}
func init() {
proto.RegisterType((*SilentGetRoomSilentReq)(nil), "banned_service.v1.SilentGetRoomSilentReq")
proto.RegisterType((*SilentGetRoomSilentResp)(nil), "banned_service.v1.SilentGetRoomSilentResp")
proto.RegisterType((*SilentGetRoomSilentResp_Data)(nil), "banned_service.v1.SilentGetRoomSilentResp.Data")
}
func (m *SilentGetRoomSilentReq) 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 *SilentGetRoomSilentReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.RoomId != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintSilent(dAtA, i, uint64(m.RoomId))
}
return i, nil
}
func (m *SilentGetRoomSilentResp) 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 *SilentGetRoomSilentResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintSilent(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSilent(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintSilent(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 *SilentGetRoomSilentResp_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 *SilentGetRoomSilentResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Type) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintSilent(dAtA, i, uint64(len(m.Type)))
i += copy(dAtA[i:], m.Type)
}
if m.Level != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintSilent(dAtA, i, uint64(m.Level))
}
if m.Second != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintSilent(dAtA, i, uint64(m.Second))
}
return i, nil
}
func encodeVarintSilent(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 *SilentGetRoomSilentReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.RoomId != 0 {
n += 1 + sovSilent(uint64(m.RoomId))
}
return n
}
func (m *SilentGetRoomSilentResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovSilent(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovSilent(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovSilent(uint64(l))
}
return n
}
func (m *SilentGetRoomSilentResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Type)
if l > 0 {
n += 1 + l + sovSilent(uint64(l))
}
if m.Level != 0 {
n += 1 + sovSilent(uint64(m.Level))
}
if m.Second != 0 {
n += 1 + sovSilent(uint64(m.Second))
}
return n
}
func sovSilent(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozSilent(x uint64) (n int) {
return sovSilent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *SilentGetRoomSilentReq) 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 ErrIntOverflowSilent
}
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: SilentGetRoomSilentReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SilentGetRoomSilentReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
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 ErrIntOverflowSilent
}
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 := skipSilent(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSilent
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SilentGetRoomSilentResp) 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 ErrIntOverflowSilent
}
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: SilentGetRoomSilentResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SilentGetRoomSilentResp: 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 ErrIntOverflowSilent
}
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 ErrIntOverflowSilent
}
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 ErrInvalidLengthSilent
}
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 ErrIntOverflowSilent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSilent
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &SilentGetRoomSilentResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSilent(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSilent
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SilentGetRoomSilentResp_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 ErrIntOverflowSilent
}
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 Type", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSilent
}
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 ErrInvalidLengthSilent
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Type = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType)
}
m.Level = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSilent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Level |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Second", wireType)
}
m.Second = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSilent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Second |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipSilent(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSilent
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipSilent(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, ErrIntOverflowSilent
}
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, ErrIntOverflowSilent
}
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, ErrIntOverflowSilent
}
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, ErrInvalidLengthSilent
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSilent
}
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 := skipSilent(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 (
ErrInvalidLengthSilent = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowSilent = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/Silent.proto", fileDescriptor_Silent_de6616e052635452) }
var fileDescriptor_Silent_de6616e052635452 = []byte{
// 346 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0x31, 0x4f, 0xc2, 0x40,
0x14, 0xe6, 0x28, 0x16, 0x79, 0x0c, 0xc4, 0x1b, 0x14, 0x09, 0x69, 0x09, 0x71, 0x40, 0x13, 0xdb,
0x80, 0xbb, 0x43, 0x63, 0x62, 0x1c, 0x5c, 0xce, 0xcd, 0x85, 0xb4, 0xbd, 0xb3, 0x34, 0xa1, 0x3d,
0x68, 0x8f, 0x26, 0xfe, 0x07, 0x07, 0x7f, 0x96, 0x23, 0xa3, 0x53, 0x63, 0x60, 0xeb, 0xaf, 0x30,
0x77, 0x57, 0x27, 0x35, 0x61, 0xf9, 0xde, 0xfb, 0xbe, 0xbc, 0x7e, 0xef, 0x7b, 0x3d, 0xe8, 0x15,
0x53, 0xf7, 0x29, 0x5e, 0xb2, 0x54, 0x38, 0xab, 0x8c, 0x0b, 0x8e, 0x4f, 0x02, 0x3f, 0x4d, 0x19,
0x9d, 0xe7, 0x2c, 0x2b, 0xe2, 0x90, 0x39, 0xc5, 0x74, 0x70, 0x1d, 0xc5, 0x62, 0xb1, 0x09, 0x9c,
0x90, 0x27, 0x6e, 0xc4, 0x23, 0xee, 0xaa, 0xc9, 0x60, 0xf3, 0xa2, 0x98, 0x22, 0xaa, 0xd3, 0x0e,
0xe3, 0x5b, 0x38, 0xd5, 0x8e, 0xf7, 0x4c, 0x10, 0xce, 0x13, 0x4d, 0x08, 0x5b, 0xe3, 0x0b, 0x68,
0x67, 0x9c, 0x27, 0xf3, 0x98, 0xf6, 0xd1, 0x08, 0x4d, 0x0c, 0xaf, 0x5b, 0x95, 0xf6, 0x8f, 0x44,
0x4c, 0xd9, 0x3c, 0xd0, 0xf1, 0x5b, 0x13, 0xce, 0xfe, 0x34, 0xc8, 0x57, 0x78, 0x08, 0xad, 0x90,
0x53, 0x56, 0x7f, 0x7e, 0x5c, 0x95, 0xb6, 0xe2, 0x44, 0x21, 0x3e, 0x07, 0x23, 0xc9, 0xa3, 0x7e,
0x73, 0x84, 0x26, 0x1d, 0xaf, 0x5d, 0x95, 0xb6, 0xa4, 0x44, 0x02, 0x7e, 0x84, 0x16, 0xf5, 0x85,
0xdf, 0x37, 0x46, 0x68, 0xd2, 0x9d, 0xb9, 0xce, 0xaf, 0x2b, 0x9d, 0x7f, 0x56, 0x3a, 0x77, 0xbe,
0xf0, 0xf5, 0x26, 0x69, 0x40, 0x14, 0x0e, 0x62, 0x68, 0x49, 0x5d, 0xe6, 0x11, 0xaf, 0x2b, 0x9d,
0xa7, 0xa3, 0xa7, 0x24, 0x27, 0x0a, 0xb1, 0x0d, 0x47, 0x4b, 0x56, 0xb0, 0xa5, 0x4a, 0x64, 0x78,
0x9d, 0xaa, 0xb4, 0xb5, 0x40, 0x74, 0xc1, 0x63, 0x30, 0x73, 0x16, 0xf2, 0x94, 0xaa, 0x5c, 0x86,
0x07, 0x55, 0x69, 0xd7, 0x0a, 0xa9, 0xeb, 0x2c, 0x03, 0x53, 0xa7, 0xc1, 0x0b, 0xe8, 0x45, 0x4c,
0xcc, 0xd5, 0xff, 0xca, 0xb5, 0x74, 0x79, 0xe8, 0x21, 0xeb, 0xc1, 0xd5, 0xe1, 0x37, 0x7b, 0xc3,
0x8f, 0x9d, 0x85, 0xb6, 0x3b, 0x0b, 0x7d, 0xed, 0x2c, 0xf4, 0xbe, 0xb7, 0x1a, 0xdb, 0xbd, 0xd5,
0xf8, 0xdc, 0x5b, 0x8d, 0xe7, 0x66, 0x31, 0x0d, 0x4c, 0xf5, 0xce, 0x37, 0xdf, 0x01, 0x00, 0x00,
0xff, 0xff, 0xab, 0xb0, 0xfb, 0x98, 0x3c, 0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,40 @@
syntax = "proto3";
package banned_service.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Silent {
/** 获取禁言
*
*/
rpc get_room_silent (SilentGetRoomSilentReq) returns (SilentGetRoomSilentResp);
}
message SilentGetRoomSilentReq {
//
int64 room_id = 1 [(gogoproto.jsontag) = "room_id"];
}
message SilentGetRoomSilentResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
// level等级 medal粉丝勋章等级 member全部
string type = 1 [(gogoproto.jsontag) = "type"];
// 等级type=level时为用户等级要求 type为medal为粉丝勋章等级要求 type为member时1表示开启0表示未开启
int64 level = 2 [(gogoproto.jsontag) = "level"];
// 还剩多少秒时间到期, -1表示直到直播结束都不过期
int64 second = 3 [(gogoproto.jsontag) = "second"];
}
}

View File

@@ -0,0 +1,46 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/SilentMng.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
// ===================
// SilentMng Interface
// ===================
type SilentMng interface {
// * 查询是否是黑名单
//
IsBlockUser(context.Context, *SilentMngIsBlockUserReq) (*SilentMngIsBlockUserResp, error)
}
// =========================
// SilentMng Live Rpc Client
// =========================
type silentMngRpcClient struct {
client *liverpc.Client
}
// NewSilentMngRpcClient creates a Rpc client that implements the SilentMng interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewSilentMngRpcClient(client *liverpc.Client) SilentMng {
return &silentMngRpcClient{
client: client,
}
}
func (c *silentMngRpcClient) IsBlockUser(ctx context.Context, in *SilentMngIsBlockUserReq) (*SilentMngIsBlockUserResp, error) {
out := new(SilentMngIsBlockUserResp)
err := doRpcRequest(ctx, c.client, 1, "SilentMng.is_block_user", in, out)
if err != nil {
return nil, err
}
return out, nil
}

View File

@@ -0,0 +1,958 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/SilentMng.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 SilentMngIsBlockUserReq struct {
//
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
//
Roomid int64 `protobuf:"varint,2,opt,name=roomid,proto3" json:"roomid"`
// 1表示弹幕禁言2表示房间信息
Type int64 `protobuf:"varint,3,opt,name=type,proto3" json:"type"`
}
func (m *SilentMngIsBlockUserReq) Reset() { *m = SilentMngIsBlockUserReq{} }
func (m *SilentMngIsBlockUserReq) String() string { return proto.CompactTextString(m) }
func (*SilentMngIsBlockUserReq) ProtoMessage() {}
func (*SilentMngIsBlockUserReq) Descriptor() ([]byte, []int) {
return fileDescriptor_SilentMng_e4a1d159043b9556, []int{0}
}
func (m *SilentMngIsBlockUserReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SilentMngIsBlockUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SilentMngIsBlockUserReq.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 *SilentMngIsBlockUserReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_SilentMngIsBlockUserReq.Merge(dst, src)
}
func (m *SilentMngIsBlockUserReq) XXX_Size() int {
return m.Size()
}
func (m *SilentMngIsBlockUserReq) XXX_DiscardUnknown() {
xxx_messageInfo_SilentMngIsBlockUserReq.DiscardUnknown(m)
}
var xxx_messageInfo_SilentMngIsBlockUserReq proto.InternalMessageInfo
func (m *SilentMngIsBlockUserReq) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *SilentMngIsBlockUserReq) GetRoomid() int64 {
if m != nil {
return m.Roomid
}
return 0
}
func (m *SilentMngIsBlockUserReq) GetType() int64 {
if m != nil {
return m.Type
}
return 0
}
type SilentMngIsBlockUserResp struct {
//
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code"`
//
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg"`
//
Data *SilentMngIsBlockUserResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *SilentMngIsBlockUserResp) Reset() { *m = SilentMngIsBlockUserResp{} }
func (m *SilentMngIsBlockUserResp) String() string { return proto.CompactTextString(m) }
func (*SilentMngIsBlockUserResp) ProtoMessage() {}
func (*SilentMngIsBlockUserResp) Descriptor() ([]byte, []int) {
return fileDescriptor_SilentMng_e4a1d159043b9556, []int{1}
}
func (m *SilentMngIsBlockUserResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SilentMngIsBlockUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SilentMngIsBlockUserResp.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 *SilentMngIsBlockUserResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_SilentMngIsBlockUserResp.Merge(dst, src)
}
func (m *SilentMngIsBlockUserResp) XXX_Size() int {
return m.Size()
}
func (m *SilentMngIsBlockUserResp) XXX_DiscardUnknown() {
xxx_messageInfo_SilentMngIsBlockUserResp.DiscardUnknown(m)
}
var xxx_messageInfo_SilentMngIsBlockUserResp proto.InternalMessageInfo
func (m *SilentMngIsBlockUserResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *SilentMngIsBlockUserResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *SilentMngIsBlockUserResp) GetData() *SilentMngIsBlockUserResp_Data {
if m != nil {
return m.Data
}
return nil
}
type SilentMngIsBlockUserResp_Data struct {
//
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
//
Roomid int64 `protobuf:"varint,2,opt,name=roomid,proto3" json:"roomid"`
//
IsBlockUser bool `protobuf:"varint,3,opt,name=is_block_user,json=isBlockUser,proto3" json:"is_block_user"`
//
Type int64 `protobuf:"varint,4,opt,name=type,proto3" json:"type"`
// 禁言到期时间戳
BlockEndTime int64 `protobuf:"varint,5,opt,name=block_end_time,json=blockEndTime,proto3" json:"block_end_time"`
}
func (m *SilentMngIsBlockUserResp_Data) Reset() { *m = SilentMngIsBlockUserResp_Data{} }
func (m *SilentMngIsBlockUserResp_Data) String() string { return proto.CompactTextString(m) }
func (*SilentMngIsBlockUserResp_Data) ProtoMessage() {}
func (*SilentMngIsBlockUserResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_SilentMng_e4a1d159043b9556, []int{1, 0}
}
func (m *SilentMngIsBlockUserResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SilentMngIsBlockUserResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SilentMngIsBlockUserResp_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 *SilentMngIsBlockUserResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_SilentMngIsBlockUserResp_Data.Merge(dst, src)
}
func (m *SilentMngIsBlockUserResp_Data) XXX_Size() int {
return m.Size()
}
func (m *SilentMngIsBlockUserResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_SilentMngIsBlockUserResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_SilentMngIsBlockUserResp_Data proto.InternalMessageInfo
func (m *SilentMngIsBlockUserResp_Data) GetUid() int64 {
if m != nil {
return m.Uid
}
return 0
}
func (m *SilentMngIsBlockUserResp_Data) GetRoomid() int64 {
if m != nil {
return m.Roomid
}
return 0
}
func (m *SilentMngIsBlockUserResp_Data) GetIsBlockUser() bool {
if m != nil {
return m.IsBlockUser
}
return false
}
func (m *SilentMngIsBlockUserResp_Data) GetType() int64 {
if m != nil {
return m.Type
}
return 0
}
func (m *SilentMngIsBlockUserResp_Data) GetBlockEndTime() int64 {
if m != nil {
return m.BlockEndTime
}
return 0
}
func init() {
proto.RegisterType((*SilentMngIsBlockUserReq)(nil), "banned_service.v1.SilentMngIsBlockUserReq")
proto.RegisterType((*SilentMngIsBlockUserResp)(nil), "banned_service.v1.SilentMngIsBlockUserResp")
proto.RegisterType((*SilentMngIsBlockUserResp_Data)(nil), "banned_service.v1.SilentMngIsBlockUserResp.Data")
}
func (m *SilentMngIsBlockUserReq) 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 *SilentMngIsBlockUserReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintSilentMng(dAtA, i, uint64(m.Uid))
}
if m.Roomid != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintSilentMng(dAtA, i, uint64(m.Roomid))
}
if m.Type != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintSilentMng(dAtA, i, uint64(m.Type))
}
return i, nil
}
func (m *SilentMngIsBlockUserResp) 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 *SilentMngIsBlockUserResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintSilentMng(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSilentMng(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintSilentMng(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 *SilentMngIsBlockUserResp_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 *SilentMngIsBlockUserResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Uid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintSilentMng(dAtA, i, uint64(m.Uid))
}
if m.Roomid != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintSilentMng(dAtA, i, uint64(m.Roomid))
}
if m.IsBlockUser {
dAtA[i] = 0x18
i++
if m.IsBlockUser {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
if m.Type != 0 {
dAtA[i] = 0x20
i++
i = encodeVarintSilentMng(dAtA, i, uint64(m.Type))
}
if m.BlockEndTime != 0 {
dAtA[i] = 0x28
i++
i = encodeVarintSilentMng(dAtA, i, uint64(m.BlockEndTime))
}
return i, nil
}
func encodeVarintSilentMng(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 *SilentMngIsBlockUserReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovSilentMng(uint64(m.Uid))
}
if m.Roomid != 0 {
n += 1 + sovSilentMng(uint64(m.Roomid))
}
if m.Type != 0 {
n += 1 + sovSilentMng(uint64(m.Type))
}
return n
}
func (m *SilentMngIsBlockUserResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovSilentMng(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovSilentMng(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovSilentMng(uint64(l))
}
return n
}
func (m *SilentMngIsBlockUserResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Uid != 0 {
n += 1 + sovSilentMng(uint64(m.Uid))
}
if m.Roomid != 0 {
n += 1 + sovSilentMng(uint64(m.Roomid))
}
if m.IsBlockUser {
n += 2
}
if m.Type != 0 {
n += 1 + sovSilentMng(uint64(m.Type))
}
if m.BlockEndTime != 0 {
n += 1 + sovSilentMng(uint64(m.BlockEndTime))
}
return n
}
func sovSilentMng(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozSilentMng(x uint64) (n int) {
return sovSilentMng(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *SilentMngIsBlockUserReq) 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 ErrIntOverflowSilentMng
}
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: SilentMngIsBlockUserReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SilentMngIsBlockUserReq: 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 ErrIntOverflowSilentMng
}
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 ErrIntOverflowSilentMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Roomid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
m.Type = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSilentMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Type |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipSilentMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSilentMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SilentMngIsBlockUserResp) 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 ErrIntOverflowSilentMng
}
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: SilentMngIsBlockUserResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SilentMngIsBlockUserResp: 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 ErrIntOverflowSilentMng
}
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 ErrIntOverflowSilentMng
}
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 ErrInvalidLengthSilentMng
}
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 ErrIntOverflowSilentMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSilentMng
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &SilentMngIsBlockUserResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSilentMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSilentMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SilentMngIsBlockUserResp_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 ErrIntOverflowSilentMng
}
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 Uid", wireType)
}
m.Uid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSilentMng
}
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 ErrIntOverflowSilentMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Roomid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field IsBlockUser", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSilentMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.IsBlockUser = bool(v != 0)
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
m.Type = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSilentMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Type |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field BlockEndTime", wireType)
}
m.BlockEndTime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSilentMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.BlockEndTime |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipSilentMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSilentMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipSilentMng(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, ErrIntOverflowSilentMng
}
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, ErrIntOverflowSilentMng
}
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, ErrIntOverflowSilentMng
}
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, ErrInvalidLengthSilentMng
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSilentMng
}
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 := skipSilentMng(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 (
ErrInvalidLengthSilentMng = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowSilentMng = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/SilentMng.proto", fileDescriptor_SilentMng_e4a1d159043b9556) }
var fileDescriptor_SilentMng_e4a1d159043b9556 = []byte{
// 385 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x52, 0x3d, 0x4f, 0xe3, 0x40,
0x14, 0x8c, 0x13, 0x5f, 0x2e, 0xd9, 0xdc, 0x9d, 0x94, 0x6d, 0xce, 0x17, 0x45, 0xf6, 0x29, 0x15,
0x02, 0xe1, 0x90, 0x20, 0x24, 0x6a, 0x0b, 0x0a, 0x0a, 0x28, 0x16, 0x68, 0x68, 0x2c, 0x7f, 0x2c,
0xce, 0x8a, 0xd8, 0x9b, 0x78, 0x6d, 0x4b, 0xfc, 0x0b, 0x7e, 0x16, 0x65, 0x0a, 0x0a, 0x2a, 0x0b,
0x25, 0x9d, 0x7f, 0x02, 0x15, 0xda, 0xe7, 0x28, 0x88, 0x10, 0x24, 0x10, 0xcd, 0xd8, 0xe3, 0x79,
0xef, 0xcd, 0x68, 0x64, 0x84, 0xb3, 0x41, 0xff, 0x9c, 0x8d, 0x69, 0x94, 0x9c, 0x46, 0x81, 0x39,
0x89, 0x79, 0xc2, 0x71, 0xdb, 0x75, 0xa2, 0x88, 0xfa, 0xb6, 0xa0, 0x71, 0xc6, 0x3c, 0x6a, 0x66,
0x83, 0xce, 0x6e, 0xc0, 0x92, 0x51, 0xea, 0x9a, 0x1e, 0x0f, 0xfb, 0x01, 0x0f, 0x78, 0x1f, 0x26,
0xdd, 0xf4, 0x1a, 0x18, 0x10, 0x78, 0x2b, 0x2f, 0xf4, 0x32, 0xf4, 0x77, 0x75, 0xf4, 0x44, 0x58,
0x63, 0xee, 0xdd, 0x5c, 0x0a, 0x1a, 0x13, 0x3a, 0xc5, 0xff, 0x50, 0x2d, 0x65, 0xbe, 0xa6, 0xfc,
0x57, 0xb6, 0x6a, 0xd6, 0xcf, 0x22, 0x37, 0x24, 0x25, 0x12, 0x70, 0x0f, 0xd5, 0x63, 0xce, 0x43,
0xe6, 0x6b, 0x55, 0x50, 0x51, 0x91, 0x1b, 0xcb, 0x2f, 0x64, 0xf9, 0xc4, 0x5d, 0xa4, 0x26, 0xb7,
0x13, 0xaa, 0xd5, 0x60, 0xa2, 0x51, 0xe4, 0x06, 0x70, 0x02, 0xd8, 0x7b, 0xae, 0x22, 0x6d, 0xb3,
0xb1, 0x98, 0xc8, 0x55, 0x8f, 0xfb, 0x74, 0x69, 0x0d, 0xab, 0x92, 0x13, 0x40, 0x99, 0x2b, 0x14,
0x01, 0x38, 0x37, 0xcb, 0x5c, 0xa1, 0x08, 0x88, 0x04, 0x7c, 0x86, 0x54, 0xdf, 0x49, 0x1c, 0xf0,
0x6c, 0x0d, 0xf7, 0xcc, 0x77, 0xf5, 0x98, 0x1f, 0x79, 0x9a, 0x47, 0x4e, 0xe2, 0x94, 0x56, 0xf2,
0x02, 0x01, 0xec, 0x3c, 0x28, 0x48, 0x95, 0xc2, 0x77, 0xbb, 0x38, 0x40, 0xbf, 0x99, 0xb0, 0x5d,
0x69, 0x68, 0xa7, 0x82, 0xc6, 0x10, 0xb0, 0x61, 0xb5, 0x8b, 0xdc, 0x78, 0x2b, 0x90, 0x16, 0x7b,
0xcd, 0xb5, 0xaa, 0x50, 0xdd, 0x54, 0x21, 0x3e, 0x44, 0x7f, 0xca, 0x45, 0x1a, 0xf9, 0x76, 0xc2,
0x42, 0xaa, 0xfd, 0x80, 0x39, 0x5c, 0xe4, 0xc6, 0x9a, 0x42, 0x7e, 0x01, 0x3f, 0x8e, 0xfc, 0x0b,
0x16, 0xd2, 0x61, 0x8a, 0x9a, 0xab, 0x1e, 0xf0, 0x68, 0x2d, 0x1b, 0xde, 0xfe, 0x74, 0x6d, 0xd3,
0xce, 0xce, 0x17, 0x2a, 0xb6, 0xba, 0xf7, 0x73, 0x5d, 0x99, 0xcd, 0x75, 0xe5, 0x69, 0xae, 0x2b,
0x77, 0x0b, 0xbd, 0x32, 0x5b, 0xe8, 0x95, 0xc7, 0x85, 0x5e, 0xb9, 0xaa, 0x66, 0x03, 0xb7, 0x0e,
0x3f, 0xe4, 0xfe, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x55, 0xed, 0x6d, 0xe8, 0x02, 0x00,
0x00,
}

View File

@@ -0,0 +1,48 @@
syntax = "proto3";
package banned_service.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service SilentMng {
/** 查询是否是黑名单
*
*/
rpc is_block_user (SilentMngIsBlockUserReq) returns (SilentMngIsBlockUserResp);
}
message SilentMngIsBlockUserReq {
//
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
//
int64 roomid = 2 [(gogoproto.jsontag) = "roomid"];
// 1表示弹幕禁言2表示房间信息
int64 type = 3 [(gogoproto.jsontag) = "type"];
}
message SilentMngIsBlockUserResp {
//
int64 code = 1 [(gogoproto.jsontag) = "code"];
//
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
//
int64 uid = 1 [(gogoproto.jsontag) = "uid"];
//
int64 roomid = 2 [(gogoproto.jsontag) = "roomid"];
//
bool is_block_user = 3 [(gogoproto.jsontag) = "is_block_user"];
//
int64 type = 4 [(gogoproto.jsontag) = "type"];
// 禁言到期时间戳
int64 block_end_time = 5 [(gogoproto.jsontag) = "block_end_time"];
}
}

View File

@@ -0,0 +1,46 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v1/SiteBlockMng.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
// ======================
// SiteBlockMng Interface
// ======================
type SiteBlockMng interface {
// * 是否封禁
// room-ex调用
IsBlockUser(context.Context, *SiteBlockMngIsBlockUserReq) (*SiteBlockMngIsBlockUserResp, error)
}
// ============================
// SiteBlockMng Live Rpc Client
// ============================
type siteBlockMngRpcClient struct {
client *liverpc.Client
}
// NewSiteBlockMngRpcClient creates a Rpc client that implements the SiteBlockMng interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewSiteBlockMngRpcClient(client *liverpc.Client) SiteBlockMng {
return &siteBlockMngRpcClient{
client: client,
}
}
func (c *siteBlockMngRpcClient) IsBlockUser(ctx context.Context, in *SiteBlockMngIsBlockUserReq) (*SiteBlockMngIsBlockUserResp, error) {
out := new(SiteBlockMngIsBlockUserResp)
err := doRpcRequest(ctx, c.client, 1, "SiteBlockMng.isBlockUser", in, out)
if err != nil {
return nil, err
}
return out, nil
}

View File

@@ -0,0 +1,737 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: v1/SiteBlockMng.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 SiteBlockMngIsBlockUserReq struct {
//
Tuid int64 `protobuf:"varint,1,opt,name=tuid,proto3" json:"tuid"`
}
func (m *SiteBlockMngIsBlockUserReq) Reset() { *m = SiteBlockMngIsBlockUserReq{} }
func (m *SiteBlockMngIsBlockUserReq) String() string { return proto.CompactTextString(m) }
func (*SiteBlockMngIsBlockUserReq) ProtoMessage() {}
func (*SiteBlockMngIsBlockUserReq) Descriptor() ([]byte, []int) {
return fileDescriptor_SiteBlockMng_7cdfb51c66347671, []int{0}
}
func (m *SiteBlockMngIsBlockUserReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SiteBlockMngIsBlockUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SiteBlockMngIsBlockUserReq.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 *SiteBlockMngIsBlockUserReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_SiteBlockMngIsBlockUserReq.Merge(dst, src)
}
func (m *SiteBlockMngIsBlockUserReq) XXX_Size() int {
return m.Size()
}
func (m *SiteBlockMngIsBlockUserReq) XXX_DiscardUnknown() {
xxx_messageInfo_SiteBlockMngIsBlockUserReq.DiscardUnknown(m)
}
var xxx_messageInfo_SiteBlockMngIsBlockUserReq proto.InternalMessageInfo
func (m *SiteBlockMngIsBlockUserReq) GetTuid() int64 {
if m != nil {
return m.Tuid
}
return 0
}
type SiteBlockMngIsBlockUserResp 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 *SiteBlockMngIsBlockUserResp_Data `protobuf:"bytes,3,opt,name=data" json:"data"`
}
func (m *SiteBlockMngIsBlockUserResp) Reset() { *m = SiteBlockMngIsBlockUserResp{} }
func (m *SiteBlockMngIsBlockUserResp) String() string { return proto.CompactTextString(m) }
func (*SiteBlockMngIsBlockUserResp) ProtoMessage() {}
func (*SiteBlockMngIsBlockUserResp) Descriptor() ([]byte, []int) {
return fileDescriptor_SiteBlockMng_7cdfb51c66347671, []int{1}
}
func (m *SiteBlockMngIsBlockUserResp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SiteBlockMngIsBlockUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SiteBlockMngIsBlockUserResp.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 *SiteBlockMngIsBlockUserResp) XXX_Merge(src proto.Message) {
xxx_messageInfo_SiteBlockMngIsBlockUserResp.Merge(dst, src)
}
func (m *SiteBlockMngIsBlockUserResp) XXX_Size() int {
return m.Size()
}
func (m *SiteBlockMngIsBlockUserResp) XXX_DiscardUnknown() {
xxx_messageInfo_SiteBlockMngIsBlockUserResp.DiscardUnknown(m)
}
var xxx_messageInfo_SiteBlockMngIsBlockUserResp proto.InternalMessageInfo
func (m *SiteBlockMngIsBlockUserResp) GetCode() int64 {
if m != nil {
return m.Code
}
return 0
}
func (m *SiteBlockMngIsBlockUserResp) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
func (m *SiteBlockMngIsBlockUserResp) GetData() *SiteBlockMngIsBlockUserResp_Data {
if m != nil {
return m.Data
}
return nil
}
type SiteBlockMngIsBlockUserResp_Data struct {
//
IsBlock bool `protobuf:"varint,1,opt,name=is_block,json=isBlock,proto3" json:"is_block"`
}
func (m *SiteBlockMngIsBlockUserResp_Data) Reset() { *m = SiteBlockMngIsBlockUserResp_Data{} }
func (m *SiteBlockMngIsBlockUserResp_Data) String() string { return proto.CompactTextString(m) }
func (*SiteBlockMngIsBlockUserResp_Data) ProtoMessage() {}
func (*SiteBlockMngIsBlockUserResp_Data) Descriptor() ([]byte, []int) {
return fileDescriptor_SiteBlockMng_7cdfb51c66347671, []int{1, 0}
}
func (m *SiteBlockMngIsBlockUserResp_Data) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SiteBlockMngIsBlockUserResp_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SiteBlockMngIsBlockUserResp_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 *SiteBlockMngIsBlockUserResp_Data) XXX_Merge(src proto.Message) {
xxx_messageInfo_SiteBlockMngIsBlockUserResp_Data.Merge(dst, src)
}
func (m *SiteBlockMngIsBlockUserResp_Data) XXX_Size() int {
return m.Size()
}
func (m *SiteBlockMngIsBlockUserResp_Data) XXX_DiscardUnknown() {
xxx_messageInfo_SiteBlockMngIsBlockUserResp_Data.DiscardUnknown(m)
}
var xxx_messageInfo_SiteBlockMngIsBlockUserResp_Data proto.InternalMessageInfo
func (m *SiteBlockMngIsBlockUserResp_Data) GetIsBlock() bool {
if m != nil {
return m.IsBlock
}
return false
}
func init() {
proto.RegisterType((*SiteBlockMngIsBlockUserReq)(nil), "banned_service.v1.SiteBlockMngIsBlockUserReq")
proto.RegisterType((*SiteBlockMngIsBlockUserResp)(nil), "banned_service.v1.SiteBlockMngIsBlockUserResp")
proto.RegisterType((*SiteBlockMngIsBlockUserResp_Data)(nil), "banned_service.v1.SiteBlockMngIsBlockUserResp.Data")
}
func (m *SiteBlockMngIsBlockUserReq) 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 *SiteBlockMngIsBlockUserReq) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Tuid != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintSiteBlockMng(dAtA, i, uint64(m.Tuid))
}
return i, nil
}
func (m *SiteBlockMngIsBlockUserResp) 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 *SiteBlockMngIsBlockUserResp) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Code != 0 {
dAtA[i] = 0x8
i++
i = encodeVarintSiteBlockMng(dAtA, i, uint64(m.Code))
}
if len(m.Msg) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSiteBlockMng(dAtA, i, uint64(len(m.Msg)))
i += copy(dAtA[i:], m.Msg)
}
if m.Data != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintSiteBlockMng(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 *SiteBlockMngIsBlockUserResp_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 *SiteBlockMngIsBlockUserResp_Data) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.IsBlock {
dAtA[i] = 0x8
i++
if m.IsBlock {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i++
}
return i, nil
}
func encodeVarintSiteBlockMng(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 *SiteBlockMngIsBlockUserReq) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Tuid != 0 {
n += 1 + sovSiteBlockMng(uint64(m.Tuid))
}
return n
}
func (m *SiteBlockMngIsBlockUserResp) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Code != 0 {
n += 1 + sovSiteBlockMng(uint64(m.Code))
}
l = len(m.Msg)
if l > 0 {
n += 1 + l + sovSiteBlockMng(uint64(l))
}
if m.Data != nil {
l = m.Data.Size()
n += 1 + l + sovSiteBlockMng(uint64(l))
}
return n
}
func (m *SiteBlockMngIsBlockUserResp_Data) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.IsBlock {
n += 2
}
return n
}
func sovSiteBlockMng(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozSiteBlockMng(x uint64) (n int) {
return sovSiteBlockMng(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *SiteBlockMngIsBlockUserReq) 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 ErrIntOverflowSiteBlockMng
}
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: SiteBlockMngIsBlockUserReq: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SiteBlockMngIsBlockUserReq: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Tuid", wireType)
}
m.Tuid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSiteBlockMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Tuid |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipSiteBlockMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSiteBlockMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SiteBlockMngIsBlockUserResp) 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 ErrIntOverflowSiteBlockMng
}
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: SiteBlockMngIsBlockUserResp: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SiteBlockMngIsBlockUserResp: 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 ErrIntOverflowSiteBlockMng
}
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 ErrIntOverflowSiteBlockMng
}
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 ErrInvalidLengthSiteBlockMng
}
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 ErrIntOverflowSiteBlockMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSiteBlockMng
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &SiteBlockMngIsBlockUserResp_Data{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSiteBlockMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSiteBlockMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SiteBlockMngIsBlockUserResp_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 ErrIntOverflowSiteBlockMng
}
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 IsBlock", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSiteBlockMng
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.IsBlock = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipSiteBlockMng(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthSiteBlockMng
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipSiteBlockMng(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, ErrIntOverflowSiteBlockMng
}
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, ErrIntOverflowSiteBlockMng
}
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, ErrIntOverflowSiteBlockMng
}
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, ErrInvalidLengthSiteBlockMng
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSiteBlockMng
}
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 := skipSiteBlockMng(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 (
ErrInvalidLengthSiteBlockMng = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowSiteBlockMng = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("v1/SiteBlockMng.proto", fileDescriptor_SiteBlockMng_7cdfb51c66347671) }
var fileDescriptor_SiteBlockMng_7cdfb51c66347671 = []byte{
// 308 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x33, 0xd4, 0x0f,
0xce, 0x2c, 0x49, 0x75, 0xca, 0xc9, 0x4f, 0xce, 0xf6, 0xcd, 0x4b, 0xd7, 0x2b, 0x28, 0xca, 0x2f,
0xc9, 0x17, 0x12, 0x4c, 0x4a, 0xcc, 0xcb, 0x4b, 0x4d, 0x89, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c,
0x4e, 0xd5, 0x2b, 0x33, 0x94, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf,
0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0xab, 0x4c, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30,
0x0b, 0x62, 0x82, 0x92, 0x15, 0x97, 0x14, 0xb2, 0xb9, 0x9e, 0xc5, 0x60, 0x56, 0x68, 0x71, 0x6a,
0x51, 0x50, 0x6a, 0xa1, 0x90, 0x0c, 0x17, 0x4b, 0x49, 0x69, 0x66, 0x8a, 0x04, 0xa3, 0x02, 0xa3,
0x06, 0xb3, 0x13, 0xc7, 0xab, 0x7b, 0xf2, 0x60, 0x7e, 0x10, 0x98, 0x54, 0xba, 0xc5, 0xc8, 0x25,
0x8d, 0x53, 0x73, 0x71, 0x01, 0x48, 0x77, 0x72, 0x7e, 0x4a, 0x2a, 0xb2, 0x6e, 0x10, 0x3f, 0x08,
0x4c, 0x0a, 0x49, 0x72, 0x31, 0xe7, 0x16, 0xa7, 0x4b, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x3a, 0xb1,
0xbf, 0xba, 0x27, 0x0f, 0xe2, 0x06, 0x81, 0x08, 0xa1, 0x40, 0x2e, 0x96, 0x94, 0xc4, 0x92, 0x44,
0x09, 0x66, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x63, 0x3d, 0x0c, 0x5f, 0xea, 0xe1, 0xb1, 0x56, 0xcf,
0x25, 0xb1, 0x24, 0x11, 0x62, 0x1b, 0xc8, 0x90, 0x20, 0x30, 0x29, 0xa5, 0xcf, 0xc5, 0x02, 0x12,
0x17, 0x52, 0xe7, 0xe2, 0xc8, 0x2c, 0x8e, 0x4f, 0x02, 0x69, 0x00, 0xbb, 0x8b, 0xc3, 0x89, 0xe7,
0xd5, 0x3d, 0x79, 0xb8, 0x58, 0x10, 0x7b, 0x26, 0xc4, 0x34, 0xa3, 0x1a, 0x2e, 0x1e, 0x64, 0x4b,
0x84, 0x72, 0xb8, 0xb8, 0x33, 0x11, 0x16, 0x09, 0xe9, 0x92, 0xe2, 0xa8, 0x42, 0x29, 0x3d, 0xd2,
0xfc, 0xe0, 0x24, 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31,
0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x4c, 0x65,
0x86, 0x49, 0x6c, 0xe0, 0xb8, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x00, 0x1b, 0x90, 0xa5,
0x16, 0x02, 0x00, 0x00,
}

View File

@@ -0,0 +1,36 @@
syntax = "proto3";
package banned_service.v1;
option go_package = "v1";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service SiteBlockMng {
/** 是否封禁
* room-ex调用
*/
rpc isBlockUser (SiteBlockMngIsBlockUserReq) returns (SiteBlockMngIsBlockUserResp);
}
message SiteBlockMngIsBlockUserReq {
//
int64 tuid = 1 [(gogoproto.jsontag) = "tuid"];
}
message SiteBlockMngIsBlockUserResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
//
bool is_block = 1 [(gogoproto.jsontag) = "is_block"];
}
}