feat: 添加舰长购买解析。

main
NorthLan 3 years ago
parent ac822ff069
commit 657f3c800d

@ -101,8 +101,8 @@ func (l *LiveBilibili) PreConnect() (url string, err error) {
l.AddMessageHandler( l.AddMessageHandler(
msg_handler.NewDanmakuHandler(l.RoomInfo.RoomId), msg_handler.NewDanmakuHandler(l.RoomInfo.RoomId),
msg_handler.NewSendGiftHandler(l.RoomInfo.RoomId), msg_handler.NewSendGiftHandler(l.RoomInfo.RoomId),
msg_handler.NewGuardBuyHandler(l.RoomInfo.RoomId),
//&msg_handler.InterActWordHandler{}, //&msg_handler.InterActWordHandler{},
//&msg_handler.SendGiftHandler{},
) )
return return
} }

@ -0,0 +1,68 @@
package msg_handler
import (
"encoding/json"
"git.noahlan.cn/northlan/ntools-go/kafka"
"git.noahlan.cn/northlan/ntools-go/logger"
"live-gateway/config"
"live-gateway/pb"
kfk "live-gateway/pkg/kafka"
"strconv"
)
type GuardBuy struct {
Uid int64 `json:"uid"` // 用户ID
Uname string `json:"username"` // 用户名
GuardLevel int32 `json:"guard_level"` // 等级(3舰长 1总督)
Num int32 `json:"num"` // 数量
Price int64 `json:"price"` // 价格 金瓜子
GiftId int64 `json:"gift_id"` // 礼物ID
GiftName string `json:"gift_name"` // 礼物名
StartTime int64 `json:"start_time"` // 开始时间
EndTime int64 `json:"end_time"` // 结束时间
}
type GuardBuyHandler struct {
producer *kafka.Producer
liveRoomId int64
}
func NewGuardBuyHandler(liveRoomId int64) *GuardBuyHandler {
cfg := config.Config.Kafka.GuardBuy
return &GuardBuyHandler{
producer: kafka.NewKafkaProducer(kfk.DefaultProducerConfig, cfg.Addr, cfg.Topic),
liveRoomId: liveRoomId,
}
}
func (h *GuardBuyHandler) CMD() string {
return "GUARD_BUY"
}
func (h *GuardBuyHandler) HandlerMessage(data []byte) {
var baseMsg struct {
CMD string `json:"cmd"`
Data *GuardBuy `json:"data"`
}
if err := json.Unmarshal(data, &baseMsg); err != nil {
return
}
logger.SLog.Infof("%s 购买 %s x %d", baseMsg.Data.Uname, baseMsg.Data.GiftName, baseMsg.Data.Num)
dmMsg := &pbMq.MqGuardBuy{
Platform: pbMq.Platform_name[int32(pbMq.Platform_bilibili)],
LiveRoomId: h.liveRoomId,
Uid: baseMsg.Data.Uid,
Uname: baseMsg.Data.Uname,
GuardLevel: baseMsg.Data.GuardLevel,
Num: baseMsg.Data.Num,
Price: baseMsg.Data.Price,
GiftId: baseMsg.Data.GiftId,
GiftName: baseMsg.Data.GiftName,
StartTime: baseMsg.Data.StartTime,
EndTime: baseMsg.Data.EndTime,
}
_ = h.producer.SendMessageAsync(dmMsg, strconv.FormatInt(dmMsg.Uid, 10))
}

@ -21,8 +21,11 @@ Log:
Compress: true # 压缩日志 Compress: true # 压缩日志
Kafka: Kafka:
Danmaku: Danmaku:
Addr: ["127.0.0.1:9093"] Addr: [ "127.0.0.1:9093" ]
Topic: "danmaku-dev" Topic: "danmaku-dev"
Gift: Gift:
Addr: [ "127.0.0.1:9093" ] Addr: [ "127.0.0.1:9093" ]
Topic: "gift-dev" Topic: "gift-dev"
GuardBuy:
Addr: [ "127.0.0.1:9093" ]
Topic: "guardBuy-dev"

@ -33,6 +33,7 @@ type (
Kafka struct { Kafka struct {
Danmaku Kafka Danmaku Kafka
Gift Kafka Gift Kafka
GuardBuy Kafka
} }
} }
) )

@ -72,6 +72,133 @@ func (Platform) EnumDescriptor() ([]byte, []int) {
return file_mq_proto_rawDescGZIP(), []int{0} return file_mq_proto_rawDescGZIP(), []int{0}
} }
type MqGuardBuy struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"`
LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"`
Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"`
Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"`
GuardLevel int32 `protobuf:"varint,5,opt,name=guardLevel,proto3" json:"guardLevel,omitempty"`
Num int32 `protobuf:"varint,6,opt,name=num,proto3" json:"num,omitempty"`
Price int64 `protobuf:"varint,7,opt,name=price,proto3" json:"price,omitempty"`
GiftId int64 `protobuf:"varint,8,opt,name=giftId,proto3" json:"giftId,omitempty"`
GiftName string `protobuf:"bytes,9,opt,name=giftName,proto3" json:"giftName,omitempty"`
StartTime int64 `protobuf:"varint,10,opt,name=startTime,proto3" json:"startTime,omitempty"`
EndTime int64 `protobuf:"varint,11,opt,name=endTime,proto3" json:"endTime,omitempty"`
}
func (x *MqGuardBuy) Reset() {
*x = MqGuardBuy{}
if protoimpl.UnsafeEnabled {
mi := &file_mq_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MqGuardBuy) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MqGuardBuy) ProtoMessage() {}
func (x *MqGuardBuy) ProtoReflect() protoreflect.Message {
mi := &file_mq_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MqGuardBuy.ProtoReflect.Descriptor instead.
func (*MqGuardBuy) Descriptor() ([]byte, []int) {
return file_mq_proto_rawDescGZIP(), []int{0}
}
func (x *MqGuardBuy) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *MqGuardBuy) GetLiveRoomId() int64 {
if x != nil {
return x.LiveRoomId
}
return 0
}
func (x *MqGuardBuy) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *MqGuardBuy) GetUname() string {
if x != nil {
return x.Uname
}
return ""
}
func (x *MqGuardBuy) GetGuardLevel() int32 {
if x != nil {
return x.GuardLevel
}
return 0
}
func (x *MqGuardBuy) GetNum() int32 {
if x != nil {
return x.Num
}
return 0
}
func (x *MqGuardBuy) GetPrice() int64 {
if x != nil {
return x.Price
}
return 0
}
func (x *MqGuardBuy) GetGiftId() int64 {
if x != nil {
return x.GiftId
}
return 0
}
func (x *MqGuardBuy) GetGiftName() string {
if x != nil {
return x.GiftName
}
return ""
}
func (x *MqGuardBuy) GetStartTime() int64 {
if x != nil {
return x.StartTime
}
return 0
}
func (x *MqGuardBuy) GetEndTime() int64 {
if x != nil {
return x.EndTime
}
return 0
}
type MqDanmaku struct { type MqDanmaku struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -88,7 +215,7 @@ type MqDanmaku struct {
func (x *MqDanmaku) Reset() { func (x *MqDanmaku) Reset() {
*x = MqDanmaku{} *x = MqDanmaku{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_mq_proto_msgTypes[0] mi := &file_mq_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -101,7 +228,7 @@ func (x *MqDanmaku) String() string {
func (*MqDanmaku) ProtoMessage() {} func (*MqDanmaku) ProtoMessage() {}
func (x *MqDanmaku) ProtoReflect() protoreflect.Message { func (x *MqDanmaku) ProtoReflect() protoreflect.Message {
mi := &file_mq_proto_msgTypes[0] mi := &file_mq_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -114,7 +241,7 @@ func (x *MqDanmaku) ProtoReflect() protoreflect.Message {
// Deprecated: Use MqDanmaku.ProtoReflect.Descriptor instead. // Deprecated: Use MqDanmaku.ProtoReflect.Descriptor instead.
func (*MqDanmaku) Descriptor() ([]byte, []int) { func (*MqDanmaku) Descriptor() ([]byte, []int) {
return file_mq_proto_rawDescGZIP(), []int{0} return file_mq_proto_rawDescGZIP(), []int{1}
} }
func (x *MqDanmaku) GetPlatform() string { func (x *MqDanmaku) GetPlatform() string {
@ -178,7 +305,7 @@ type MqGift struct {
func (x *MqGift) Reset() { func (x *MqGift) Reset() {
*x = MqGift{} *x = MqGift{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_mq_proto_msgTypes[1] mi := &file_mq_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -191,7 +318,7 @@ func (x *MqGift) String() string {
func (*MqGift) ProtoMessage() {} func (*MqGift) ProtoMessage() {}
func (x *MqGift) ProtoReflect() protoreflect.Message { func (x *MqGift) ProtoReflect() protoreflect.Message {
mi := &file_mq_proto_msgTypes[1] mi := &file_mq_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -204,7 +331,7 @@ func (x *MqGift) ProtoReflect() protoreflect.Message {
// Deprecated: Use MqGift.ProtoReflect.Descriptor instead. // Deprecated: Use MqGift.ProtoReflect.Descriptor instead.
func (*MqGift) Descriptor() ([]byte, []int) { func (*MqGift) Descriptor() ([]byte, []int) {
return file_mq_proto_rawDescGZIP(), []int{1} return file_mq_proto_rawDescGZIP(), []int{2}
} }
func (x *MqGift) GetPlatform() string { func (x *MqGift) GetPlatform() string {
@ -273,37 +400,55 @@ func (x *MqGift) GetIsPaid() bool {
var File_mq_proto protoreflect.FileDescriptor var File_mq_proto protoreflect.FileDescriptor
var file_mq_proto_rawDesc = []byte{ var file_mq_proto_rawDesc = []byte{
0x0a, 0x08, 0x6d, 0x71, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xa5, 0x0a, 0x08, 0x6d, 0x71, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xa4,
0x01, 0x0a, 0x09, 0x4d, 0x71, 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x6b, 0x75, 0x12, 0x1a, 0x0a, 0x08, 0x02, 0x0a, 0x0a, 0x4d, 0x71, 0x47, 0x75, 0x61, 0x72, 0x64, 0x42, 0x75, 0x79, 0x12, 0x1a, 0x0a,
0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76,
0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c,
0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75,
0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d,
0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x75, 0x61, 0x72, 0x64, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18,
0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x67, 0x75, 0x61, 0x72, 0x64, 0x4c, 0x65, 0x76, 0x65,
0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe0, 0x01, 0x0a, 0x06, 0x4d, 0x71, 0x47, 0x69, 0x66, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01,
0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66,
0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49,
0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20,
0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a,
0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03,
0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65,
0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e,
0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa5, 0x01, 0x0a, 0x09, 0x4d, 0x71, 0x44, 0x61, 0x6e, 0x6d,
0x03, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x61, 0x6b, 0x75, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18,
0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12,
0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20,
0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69,
0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x2a, 0x39, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0c, 0x0a, 0x08, 0x62, 0x69, 0x6c, 0x69, 0x62, 0x69, 0x6c, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
0x69, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x68, 0x75, 0x79, 0x61, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x05, 0x64, 0x6f, 0x75, 0x79, 0x75, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x79, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20,
0x69, 0x6e, 0x10, 0x03, 0x42, 0x07, 0x5a, 0x05, 0x2f, 0x70, 0x62, 0x4d, 0x71, 0x62, 0x06, 0x70, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe0, 0x01,
0x72, 0x6f, 0x74, 0x6f, 0x33, 0x0a, 0x06, 0x4d, 0x71, 0x47, 0x69, 0x66, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74,
0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74,
0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d,
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f,
0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69,
0x66, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28,
0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61,
0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61,
0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61,
0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64,
0x2a, 0x39, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0c, 0x0a, 0x08,
0x62, 0x69, 0x6c, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x68, 0x75,
0x79, 0x61, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x64, 0x6f, 0x75, 0x79, 0x75, 0x10, 0x02, 0x12,
0x0a, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x10, 0x03, 0x42, 0x07, 0x5a, 0x05, 0x2f,
0x70, 0x62, 0x4d, 0x71, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -319,11 +464,12 @@ func file_mq_proto_rawDescGZIP() []byte {
} }
var file_mq_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_mq_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_mq_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_mq_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_mq_proto_goTypes = []interface{}{ var file_mq_proto_goTypes = []interface{}{
(Platform)(0), // 0: pb.Platform (Platform)(0), // 0: pb.Platform
(*MqDanmaku)(nil), // 1: pb.MqDanmaku (*MqGuardBuy)(nil), // 1: pb.MqGuardBuy
(*MqGift)(nil), // 2: pb.MqGift (*MqDanmaku)(nil), // 2: pb.MqDanmaku
(*MqGift)(nil), // 3: pb.MqGift
} }
var file_mq_proto_depIdxs = []int32{ var file_mq_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method output_type
@ -340,7 +486,7 @@ func file_mq_proto_init() {
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_mq_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_mq_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqDanmaku); i { switch v := v.(*MqGuardBuy); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -352,6 +498,18 @@ func file_mq_proto_init() {
} }
} }
file_mq_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_mq_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqDanmaku); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_mq_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MqGift); i { switch v := v.(*MqGift); i {
case 0: case 0:
return &v.state return &v.state
@ -370,7 +528,7 @@ func file_mq_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_mq_proto_rawDesc, RawDescriptor: file_mq_proto_rawDesc,
NumEnums: 1, NumEnums: 1,
NumMessages: 2, NumMessages: 3,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

@ -11,6 +11,20 @@ enum Platform {
douyin = 3; // douyin = 3; //
} }
message MqGuardBuy {
string platform = 1;
int64 liveRoomId = 2;
int64 uid = 3;
string uname = 4;
int32 guardLevel = 5;
int32 num = 6;
int64 price = 7;
int64 giftId = 8;
string giftName = 9;
int64 startTime = 10;
int64 endTime = 11;
}
message MqDanmaku { message MqDanmaku {
string platform = 1; string platform = 1;
int64 liveRoomId = 2; int64 liveRoomId = 2;

Loading…
Cancel
Save