1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

feat: SendGuildChannelMessage

This commit is contained in:
Mrs4s 2021-11-10 04:12:01 +08:00
parent cc17020dab
commit 75d6d547d2
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7
4 changed files with 547 additions and 110 deletions

View File

@ -2,11 +2,105 @@ package client
import (
"github.com/Mrs4s/MiraiGo/client/pb/channel"
"github.com/Mrs4s/MiraiGo/client/pb/msg"
"github.com/Mrs4s/MiraiGo/internal/packets"
"github.com/pkg/errors"
"google.golang.org/protobuf/proto"
"time"
)
func init() {
decoders["MsgPush.PushGroupProMsg"] = decodeGuildEventFlowPacket
}
func decodeGuildEventFlowPacket(c *QQClient, _ *incomingPacketInfo, payload []byte) (interface{}, error) {
push := new(channel.MsgOnlinePush)
if err := proto.Unmarshal(payload, push); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
}
for _, m := range push.Msgs {
if m.Head.ContentHead.GetType() == 3841 {
type tipsPushInfo struct {
TinyId uint64
TargetMessageSenderUin int64
GuildId uint64
ChannelId uint64
}
// todo: 回头 event flow 的处理移出去重构下逻辑, 先暂时这样方便改
var common *msg.CommonElem
if m.Body != nil {
for _, e := range m.Body.RichText.Elems {
if e.CommonElem != nil {
common = e.CommonElem
break
}
}
}
if m.Head.ContentHead.GetSubType() == 2 { // todo: tips?
if common == nil { // empty tips
}
tipsInfo := &tipsPushInfo{
TinyId: m.Head.RoutingHead.GetFromTinyid(),
GuildId: m.Head.RoutingHead.GetGuildId(),
ChannelId: m.Head.RoutingHead.GetChannelId(),
}
if len(m.CtrlHead.IncludeUin) > 0 {
tipsInfo.TargetMessageSenderUin = int64(m.CtrlHead.IncludeUin[0])
}
return tipsInfo, nil
}
if common == nil || common.GetServiceType() != 500 {
continue
}
eventBody := new(channel.EventBody)
if err := proto.Unmarshal(common.PbElem, eventBody); err != nil {
c.Error("failed to unmarshal guild channel event body: %v", err)
continue
}
if eventBody.UpdateMsg != nil {
if eventBody.UpdateMsg.GetEventType() == 1 || eventBody.UpdateMsg.GetEventType() == 2 { // todo: 撤回消息
continue
}
if eventBody.UpdateMsg.GetEventType() == 4 { // 消息贴表情更新 (包含添加或删除)
t, err := c.GuildService.pullRoamMsgByEventFlow(m.Head.RoutingHead.GetGuildId(), m.Head.RoutingHead.GetChannelId(), eventBody.UpdateMsg.GetMsgSeq(), eventBody.UpdateMsg.GetMsgSeq(), eventBody.UpdateMsg.GetEventVersion()-1)
if err != nil || len(t) == 0 {
c.Error("process guild event flow error: pull eventMsg message error: %v", err)
continue
}
// 自己的消息被贴表情会单独推送一个tips, 这里不需要解析
if t[0].Head.RoutingHead.GetFromTinyid() == c.GuildService.TinyId {
continue
}
updatedEvent := &GuildMessageReactionsUpdatedEvent{
GuildId: m.Head.RoutingHead.GetGuildId(),
ChannelId: m.Head.RoutingHead.GetChannelId(),
MessageId: t[0].Head.ContentHead.GetSeq(),
CurrentReactions: decodeGuildMessageEmojiReactions(t[0]),
}
tipsInfo, err := c.waitPacketTimeoutSyncF("MsgPush.PushGroupProMsg", time.Second, func(i interface{}) bool {
if i == nil {
return false
}
_, ok := i.(*tipsPushInfo)
return ok
})
if err == nil {
updatedEvent.OperatorId = tipsInfo.(*tipsPushInfo).TinyId
updatedEvent.MessageSenderUin = tipsInfo.(*tipsPushInfo).TargetMessageSenderUin
}
c.dispatchGuildMessageReactionsUpdatedEvent(updatedEvent)
}
}
continue
}
if cm := c.parseGuildChannelMessage(m); cm != nil {
c.dispatchGuildChannelMessage(cm)
}
}
return nil, nil
}
func (s *GuildService) pullRoamMsgByEventFlow(guildId, channelId, beginSeq, endSeq, eventVersion uint64) ([]*channel.ChannelMsgContent, error) {
payload, _ := proto.Marshal(&channel.ChannelMsgReq{
ChannelParam: &channel.ChannelParam{

View File

@ -2,6 +2,7 @@ package client
import (
"encoding/hex"
"math/rand"
"strconv"
"github.com/Mrs4s/MiraiGo/client/pb/cmd0x388"
@ -9,36 +10,48 @@ import (
"github.com/pkg/errors"
"time"
"github.com/Mrs4s/MiraiGo/client/pb/channel"
"github.com/Mrs4s/MiraiGo/client/pb/msg"
"github.com/Mrs4s/MiraiGo/message"
"google.golang.org/protobuf/proto"
)
func init() {
decoders["MsgPush.PushGroupProMsg"] = decodeGuildMessagePushPacket
}
func (c *QQClient) parseGuildChannelMessage(msg *channel.ChannelMsgContent) *message.GuildChannelMessage {
guild := c.GuildService.FindGuild(msg.Head.RoutingHead.GetGuildId())
if guild == nil {
return nil // todo: sync guild info
}
// mem := guild.FindMember(msg.Head.RoutingHead.GetFromTinyid())
return &message.GuildChannelMessage{
Id: msg.Head.ContentHead.GetSeq(),
InternalId: msg.Body.RichText.Attr.GetRandom(),
GuildId: msg.Head.RoutingHead.GetGuildId(),
ChannelId: msg.Head.RoutingHead.GetChannelId(),
Time: int64(msg.Head.ContentHead.GetTime()),
Sender: &message.GuildSender{
TinyId: msg.Head.RoutingHead.GetFromTinyid(),
Nickname: string(msg.ExtInfo.GetFromNick()),
func (s *GuildService) SendGuildChannelMessage(guildId, channelId uint64, m *message.SendingMessage) error {
mr := rand.Uint32() // 客户端似乎是生成的 u32 虽然类型是u64
req := &channel.DF62ReqBody{Msg: &channel.ChannelMsgContent{
Head: &channel.ChannelMsgHead{
RoutingHead: &channel.ChannelRoutingHead{
GuildId: &guildId,
ChannelId: &channelId,
FromUin: proto.Uint64(uint64(s.c.Uin)),
},
ContentHead: &channel.ChannelContentHead{
Type: proto.Uint64(3840), // const
Random: proto.Uint64(uint64(mr)),
},
},
Elements: message.ParseMessageElems(msg.Body.RichText.Elems),
Body: &msg.MessageBody{
RichText: &msg.RichText{
Elems: message.ToProtoElems(m.Elements, true),
},
},
}}
seq := s.c.nextSeq()
payload, _ := proto.Marshal(req)
packet := packets.BuildUniPacket(s.c.Uin, seq, "MsgProxy.SendMsg", 1, s.c.OutGoingPacketSessionId, []byte{}, s.c.sigInfo.d2Key, payload)
rsp, err := s.c.sendAndWaitDynamic(seq, packet)
if err != nil {
return errors.Wrap(err, "send packet error")
}
body := new(channel.DF62RspBody)
if err = proto.Unmarshal(rsp, body); err != nil {
return errors.Wrap(err, "failed to unmarshal protobuf message")
}
if body.GetResult() != 0 {
return errors.Errorf("send channel message error: server response %v", body.GetResult())
}
// todo: 返回 *message.GuildMessage
return nil
}
func (s *GuildService) QueryImage(guildId, channelId uint64, hash []byte, size uint64) (*message.GuildImageElement, error) {
@ -91,94 +104,6 @@ func (s *GuildService) QueryImage(guildId, channelId uint64, hash []byte, size u
return nil, errors.New("image is not exists")
}
func decodeGuildMessagePushPacket(c *QQClient, _ *incomingPacketInfo, payload []byte) (interface{}, error) {
push := new(channel.MsgOnlinePush)
if err := proto.Unmarshal(payload, push); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal protobuf message")
}
for _, m := range push.Msgs {
if m.Head.ContentHead.GetType() == 3841 {
type tipsPushInfo struct {
TinyId uint64
TargetMessageSenderUin int64
GuildId uint64
ChannelId uint64
}
// todo: 回头 event flow 的处理移出去重构下逻辑, 先暂时这样方便改
var common *msg.CommonElem
if m.Body != nil {
for _, e := range m.Body.RichText.Elems {
if e.CommonElem != nil {
common = e.CommonElem
break
}
}
}
if m.Head.ContentHead.GetSubType() == 2 { // todo: tips?
if common == nil { // empty tips
}
tipsInfo := &tipsPushInfo{
TinyId: m.Head.RoutingHead.GetFromTinyid(),
GuildId: m.Head.RoutingHead.GetGuildId(),
ChannelId: m.Head.RoutingHead.GetChannelId(),
}
if len(m.CtrlHead.IncludeUin) > 0 {
tipsInfo.TargetMessageSenderUin = int64(m.CtrlHead.IncludeUin[0])
}
return tipsInfo, nil
}
if common == nil || common.GetServiceType() != 500 {
continue
}
eventBody := new(channel.EventBody)
if err := proto.Unmarshal(common.PbElem, eventBody); err != nil {
c.Error("failed to unmarshal guild channel event body: %v", err)
continue
}
if eventBody.UpdateMsg != nil {
if eventBody.UpdateMsg.GetEventType() == 1 || eventBody.UpdateMsg.GetEventType() == 2 { // todo: 撤回消息
continue
}
if eventBody.UpdateMsg.GetEventType() == 4 { // 消息贴表情更新 (包含添加或删除)
t, err := c.GuildService.pullRoamMsgByEventFlow(m.Head.RoutingHead.GetGuildId(), m.Head.RoutingHead.GetChannelId(), eventBody.UpdateMsg.GetMsgSeq(), eventBody.UpdateMsg.GetMsgSeq(), eventBody.UpdateMsg.GetEventVersion()-1)
if err != nil || len(t) == 0 {
c.Error("process guild event flow error: pull eventMsg message error: %v", err)
continue
}
// 自己的消息被贴表情会单独推送一个tips, 这里不需要解析
if t[0].Head.RoutingHead.GetFromTinyid() == c.GuildService.TinyId {
continue
}
updatedEvent := &GuildMessageReactionsUpdatedEvent{
GuildId: m.Head.RoutingHead.GetGuildId(),
ChannelId: m.Head.RoutingHead.GetChannelId(),
MessageId: t[0].Head.ContentHead.GetSeq(),
CurrentReactions: decodeGuildMessageEmojiReactions(t[0]),
}
tipsInfo, err := c.waitPacketTimeoutSyncF("MsgPush.PushGroupProMsg", time.Second, func(i interface{}) bool {
if i == nil {
return false
}
_, ok := i.(*tipsPushInfo)
return ok
})
if err == nil {
updatedEvent.OperatorId = tipsInfo.(*tipsPushInfo).TinyId
updatedEvent.MessageSenderUin = tipsInfo.(*tipsPushInfo).TargetMessageSenderUin
}
c.dispatchGuildMessageReactionsUpdatedEvent(updatedEvent)
}
}
continue
}
if cm := c.parseGuildChannelMessage(m); cm != nil {
c.dispatchGuildChannelMessage(cm)
}
}
return nil, nil
}
func decodeGuildMessageEmojiReactions(content *channel.ChannelMsgContent) (r []*message.GuildMessageEmojiReaction) {
r = []*message.GuildMessageEmojiReaction{}
var common *msg.CommonElem
@ -214,3 +139,23 @@ func decodeGuildMessageEmojiReactions(content *channel.ChannelMsgContent) (r []*
}
return
}
func (c *QQClient) parseGuildChannelMessage(msg *channel.ChannelMsgContent) *message.GuildChannelMessage {
guild := c.GuildService.FindGuild(msg.Head.RoutingHead.GetGuildId())
if guild == nil {
return nil // todo: sync guild info
}
// mem := guild.FindMember(msg.Head.RoutingHead.GetFromTinyid())
return &message.GuildChannelMessage{
Id: msg.Head.ContentHead.GetSeq(),
InternalId: msg.Body.RichText.Attr.GetRandom(),
GuildId: msg.Head.RoutingHead.GetGuildId(),
ChannelId: msg.Head.RoutingHead.GetChannelId(),
Time: int64(msg.Head.ContentHead.GetTime()),
Sender: &message.GuildSender{
TinyId: msg.Head.RoutingHead.GetFromTinyid(),
Nickname: string(msg.ExtInfo.GetFromNick()),
},
Elements: message.ParseMessageElems(msg.Body.RichText.Elems),
}
}

View File

@ -0,0 +1,371 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.14.0
// source: pb/channel/oidb0xf62.proto
package channel
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type DF62ReqBody struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Msg *ChannelMsgContent `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}
func (x *DF62ReqBody) Reset() {
*x = DF62ReqBody{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_oidb0xf62_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DF62ReqBody) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DF62ReqBody) ProtoMessage() {}
func (x *DF62ReqBody) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_oidb0xf62_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 DF62ReqBody.ProtoReflect.Descriptor instead.
func (*DF62ReqBody) Descriptor() ([]byte, []int) {
return file_pb_channel_oidb0xf62_proto_rawDescGZIP(), []int{0}
}
func (x *DF62ReqBody) GetMsg() *ChannelMsgContent {
if x != nil {
return x.Msg
}
return nil
}
type DF62RspBody struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Result *uint32 `protobuf:"varint,1,opt,name=result" json:"result,omitempty"`
Errmsg []byte `protobuf:"bytes,2,opt,name=errmsg" json:"errmsg,omitempty"`
SendTime *uint32 `protobuf:"varint,3,opt,name=sendTime" json:"sendTime,omitempty"`
Head *ChannelMsgHead `protobuf:"bytes,4,opt,name=head" json:"head,omitempty"`
ErrType *uint32 `protobuf:"varint,5,opt,name=errType" json:"errType,omitempty"`
TransSvrInfo *TransSvrInfo `protobuf:"bytes,6,opt,name=transSvrInfo" json:"transSvrInfo,omitempty"`
FreqLimitInfo *ChannelFreqLimitInfo `protobuf:"bytes,7,opt,name=freqLimitInfo" json:"freqLimitInfo,omitempty"`
}
func (x *DF62RspBody) Reset() {
*x = DF62RspBody{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_oidb0xf62_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DF62RspBody) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DF62RspBody) ProtoMessage() {}
func (x *DF62RspBody) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_oidb0xf62_proto_msgTypes[1]
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 DF62RspBody.ProtoReflect.Descriptor instead.
func (*DF62RspBody) Descriptor() ([]byte, []int) {
return file_pb_channel_oidb0xf62_proto_rawDescGZIP(), []int{1}
}
func (x *DF62RspBody) GetResult() uint32 {
if x != nil && x.Result != nil {
return *x.Result
}
return 0
}
func (x *DF62RspBody) GetErrmsg() []byte {
if x != nil {
return x.Errmsg
}
return nil
}
func (x *DF62RspBody) GetSendTime() uint32 {
if x != nil && x.SendTime != nil {
return *x.SendTime
}
return 0
}
func (x *DF62RspBody) GetHead() *ChannelMsgHead {
if x != nil {
return x.Head
}
return nil
}
func (x *DF62RspBody) GetErrType() uint32 {
if x != nil && x.ErrType != nil {
return *x.ErrType
}
return 0
}
func (x *DF62RspBody) GetTransSvrInfo() *TransSvrInfo {
if x != nil {
return x.TransSvrInfo
}
return nil
}
func (x *DF62RspBody) GetFreqLimitInfo() *ChannelFreqLimitInfo {
if x != nil {
return x.FreqLimitInfo
}
return nil
}
type TransSvrInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SubType *uint32 `protobuf:"varint,1,opt,name=subType" json:"subType,omitempty"`
RetCode *int32 `protobuf:"varint,2,opt,name=retCode" json:"retCode,omitempty"`
ErrMsg []byte `protobuf:"bytes,3,opt,name=errMsg" json:"errMsg,omitempty"`
TransInfo []byte `protobuf:"bytes,4,opt,name=transInfo" json:"transInfo,omitempty"`
}
func (x *TransSvrInfo) Reset() {
*x = TransSvrInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_pb_channel_oidb0xf62_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TransSvrInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TransSvrInfo) ProtoMessage() {}
func (x *TransSvrInfo) ProtoReflect() protoreflect.Message {
mi := &file_pb_channel_oidb0xf62_proto_msgTypes[2]
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 TransSvrInfo.ProtoReflect.Descriptor instead.
func (*TransSvrInfo) Descriptor() ([]byte, []int) {
return file_pb_channel_oidb0xf62_proto_rawDescGZIP(), []int{2}
}
func (x *TransSvrInfo) GetSubType() uint32 {
if x != nil && x.SubType != nil {
return *x.SubType
}
return 0
}
func (x *TransSvrInfo) GetRetCode() int32 {
if x != nil && x.RetCode != nil {
return *x.RetCode
}
return 0
}
func (x *TransSvrInfo) GetErrMsg() []byte {
if x != nil {
return x.ErrMsg
}
return nil
}
func (x *TransSvrInfo) GetTransInfo() []byte {
if x != nil {
return x.TransInfo
}
return nil
}
var File_pb_channel_oidb0xf62_proto protoreflect.FileDescriptor
var file_pb_channel_oidb0xf62_proto_rawDesc = []byte{
0x0a, 0x1a, 0x70, 0x62, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x6f, 0x69, 0x64,
0x62, 0x30, 0x78, 0x66, 0x36, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x68,
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x1a, 0x17, 0x70, 0x62, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b,
0x0a, 0x0b, 0x44, 0x46, 0x36, 0x32, 0x52, 0x65, 0x71, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x2c, 0x0a,
0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x43,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0xa0, 0x02, 0x0a, 0x0b,
0x44, 0x46, 0x36, 0x32, 0x52, 0x73, 0x70, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x72,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0c, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x73,
0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73,
0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18,
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e,
0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x48, 0x65, 0x61, 0x64, 0x52, 0x04,
0x68, 0x65, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18,
0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x65, 0x72, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x39,
0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x53, 0x76, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x06,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x54,
0x72, 0x61, 0x6e, 0x73, 0x53, 0x76, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x74, 0x72, 0x61,
0x6e, 0x73, 0x53, 0x76, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x43, 0x0a, 0x0d, 0x66, 0x72, 0x65,
0x71, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1d, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x46, 0x72, 0x65, 0x71, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x0d, 0x66, 0x72, 0x65, 0x71, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x78,
0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x53, 0x76, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18,
0x0a, 0x07, 0x73, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x07, 0x73, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x43,
0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x74, 0x43, 0x6f,
0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72,
0x61, 0x6e, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x74,
0x72, 0x61, 0x6e, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x14, 0x5a, 0x12, 0x70, 0x62, 0x2f, 0x63,
0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x3b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
}
var (
file_pb_channel_oidb0xf62_proto_rawDescOnce sync.Once
file_pb_channel_oidb0xf62_proto_rawDescData = file_pb_channel_oidb0xf62_proto_rawDesc
)
func file_pb_channel_oidb0xf62_proto_rawDescGZIP() []byte {
file_pb_channel_oidb0xf62_proto_rawDescOnce.Do(func() {
file_pb_channel_oidb0xf62_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_channel_oidb0xf62_proto_rawDescData)
})
return file_pb_channel_oidb0xf62_proto_rawDescData
}
var file_pb_channel_oidb0xf62_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_pb_channel_oidb0xf62_proto_goTypes = []interface{}{
(*DF62ReqBody)(nil), // 0: channel.DF62ReqBody
(*DF62RspBody)(nil), // 1: channel.DF62RspBody
(*TransSvrInfo)(nil), // 2: channel.TransSvrInfo
(*ChannelMsgContent)(nil), // 3: channel.ChannelMsgContent
(*ChannelMsgHead)(nil), // 4: channel.ChannelMsgHead
(*ChannelFreqLimitInfo)(nil), // 5: channel.ChannelFreqLimitInfo
}
var file_pb_channel_oidb0xf62_proto_depIdxs = []int32{
3, // 0: channel.DF62ReqBody.msg:type_name -> channel.ChannelMsgContent
4, // 1: channel.DF62RspBody.head:type_name -> channel.ChannelMsgHead
2, // 2: channel.DF62RspBody.transSvrInfo:type_name -> channel.TransSvrInfo
5, // 3: channel.DF62RspBody.freqLimitInfo:type_name -> channel.ChannelFreqLimitInfo
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_pb_channel_oidb0xf62_proto_init() }
func file_pb_channel_oidb0xf62_proto_init() {
if File_pb_channel_oidb0xf62_proto != nil {
return
}
file_pb_channel_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_pb_channel_oidb0xf62_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DF62ReqBody); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_oidb0xf62_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DF62RspBody); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pb_channel_oidb0xf62_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TransSvrInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pb_channel_oidb0xf62_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_pb_channel_oidb0xf62_proto_goTypes,
DependencyIndexes: file_pb_channel_oidb0xf62_proto_depIdxs,
MessageInfos: file_pb_channel_oidb0xf62_proto_msgTypes,
}.Build()
File_pb_channel_oidb0xf62_proto = out.File
file_pb_channel_oidb0xf62_proto_rawDesc = nil
file_pb_channel_oidb0xf62_proto_goTypes = nil
file_pb_channel_oidb0xf62_proto_depIdxs = nil
}

View File

@ -0,0 +1,27 @@
syntax = "proto2";
package channel;
option go_package = "pb/channel;channel";
import "pb/channel/common.proto";
message DF62ReqBody {
optional ChannelMsgContent msg = 1;
}
message DF62RspBody {
optional uint32 result = 1;
optional bytes errmsg = 2;
optional uint32 sendTime = 3;
optional ChannelMsgHead head = 4;
optional uint32 errType = 5;
optional TransSvrInfo transSvrInfo = 6;
optional ChannelFreqLimitInfo freqLimitInfo = 7;
}
message TransSvrInfo {
optional uint32 subType = 1;
optional int32 retCode = 2;
optional bytes errMsg = 3;
optional bytes transInfo = 4;
}