DengBiao 1 рік тому
джерело
коміт
9825f412ec
13 змінених файлів з 1061 додано та 492 видалено
  1. +26
    -0
      internal/logic/api/logic_ext.go
  2. +5
    -0
      internal/logic/app/friend_app.go
  3. +10
    -0
      internal/logic/app/group_app.go
  4. +25
    -0
      internal/logic/app/message_app.go
  5. +30
    -0
      internal/logic/domain/friend/friend_service.go
  6. +36
    -1
      internal/logic/domain/group/model/group.go
  7. +10
    -0
      internal/logic/domain/message/repo/message_repo.go
  8. +92
    -0
      internal/logic/domain/message/service/message_service.go
  9. +1
    -0
      internal/logic/proxy/message_proxy.go
  10. +184
    -117
      pkg/pb/connect.ext.pb.go
  11. +618
    -372
      pkg/pb/logic.ext.pb.go
  12. +8
    -2
      pkg/proto/connect.ext.proto
  13. +16
    -0
      pkg/proto/logic.ext.proto

+ 26
- 0
internal/logic/api/logic_ext.go Переглянути файл

@@ -10,6 +10,32 @@ import (

type LogicExtServer struct{}

func (s *LogicExtServer) RecallMessage(ctx context.Context, in *pb.RecallMessageReq) (*pb.RecallMessageResp, error) {
userId, deviceId, err := grpclib.GetCtxData(ctx)
if err != nil {
return nil, err
}
if in.MessageContentBack != "" {
buf, err := proto.Marshal(&pb.Text{
Text: in.MessageContentBack,
})
if err != nil {
return nil, err
}
in.MessageContent = buf
}
sender := pb.Sender{
SenderType: pb.SenderType_ST_USER,
SenderId: userId,
DeviceId: deviceId,
}
seq, err := app.MessageApp.RecallMessage(ctx, &sender, in)
if err != nil {
return nil, err
}
return &pb.RecallMessageResp{Seq: seq}, nil
}

// RegisterDevice 注册设备
func (*LogicExtServer) RegisterDevice(ctx context.Context, in *pb.RegisterDeviceReq) (*pb.RegisterDeviceResp, error) {
deviceId, err := app.DeviceApp.Register(ctx, in)


+ 5
- 0
internal/logic/app/friend_app.go Переглянути файл

@@ -56,3 +56,8 @@ func (*friendApp) SetFriend(ctx context.Context, userId int64, req *pb.SetFriend
func (*friendApp) SendToFriend(ctx context.Context, sender *pb.Sender, req *pb.SendMessageReq) (int64, error) {
return frienddomain.FriendService.SendToFriend(ctx, sender, req)
}

// RecallMessageSendToFriend 撤回消息发送至好友
func (*friendApp) RecallMessageSendToFriend(ctx context.Context, sender *pb.Sender, req *pb.RecallMessageReq) (int64, error) {
return frienddomain.FriendService.RecallMessageSendToFriend(ctx, sender, req)
}

+ 10
- 0
internal/logic/app/group_app.go Переглянути файл

@@ -148,3 +148,13 @@ func (*groupApp) SendMessage(ctx context.Context, sender *pb.Sender, req *pb.Sen

return group.SendMessage(ctx, sender, req)
}

// RecallSendMessage 撤回发送消息
func (*groupApp) RecallSendMessage(ctx context.Context, sender *pb.Sender, req *pb.RecallMessageReq) (int64, error) {
group, err := repo.GroupRepo.Get(req.ReceiverId)
if err != nil {
return 0, err
}

return group.RecallSendMessage(ctx, sender, req)
}

+ 25
- 0
internal/logic/app/message_app.go Переглянути файл

@@ -17,6 +17,11 @@ func (*messageApp) SendToUser(ctx context.Context, sender *pb.Sender, toUserId i
return service.MessageService.SendToUser(ctx, sender, toUserId, req)
}

// RecallMessageSendToUser 撤回消息发送给用户
func (*messageApp) RecallMessageSendToUser(ctx context.Context, sender *pb.Sender, toUserId int64, req *pb.RecallMessageReq, isRecallMessageUser bool) (int64, error) {
return service.MessageService.RecallMessageSendToUser(ctx, sender, toUserId, req, isRecallMessageUser)
}

// PushToUser 推送消息给用户
func (*messageApp) PushToUser(ctx context.Context, userId int64, code pb.PushCode, message proto.Message, isPersist bool) error {
return service.PushService.PushToUser(ctx, userId, code, message, isPersist)
@@ -57,3 +62,23 @@ func (s *messageApp) SendMessage(ctx context.Context, sender *pb.Sender, req *pb
}
return 0, nil
}

// RecallMessage 撤回消息
func (s *messageApp) RecallMessage(ctx context.Context, sender *pb.Sender, req *pb.RecallMessageReq) (int64, error) {
// 如果发送者是用户,需要补充用户的信息
service.MessageService.AddSenderInfo(sender)
switch req.ReceiverType {
// 消息接收者为用户
case pb.ReceiverType_RT_USER:
// 发送者为用户
if sender.SenderType == pb.SenderType_ST_USER {
return FriendApp.RecallMessageSendToFriend(ctx, sender, req)
} else {
return s.RecallMessageSendToUser(ctx, sender, req.ReceiverId, req, true)
}
// 消息接收者是群组
case pb.ReceiverType_RT_GROUP:
return GroupApp.RecallSendMessage(ctx, sender, req)
}
return 0, nil
}

+ 30
- 0
internal/logic/domain/friend/friend_service.go Переглянути файл

@@ -214,3 +214,33 @@ func (*friendService) SendToFriend(ctx context.Context, sender *pb.Sender, req *

return seq, nil
}

// RecallMessageSendToFriend 撤回消息发送至好友
func (*friendService) RecallMessageSendToFriend(ctx context.Context, sender *pb.Sender, req *pb.RecallMessageReq) (int64, error) {
//TODO::判断是否为好友
friend, err := FriendRepo.Get(sender.SenderId, req.ReceiverId)
if err != nil {
return 0, err
}
if friend == nil || friend.Status != FriendStatusAgree {
return 0, gerrors.ErrNotIsFriend
}

utils.FilePutContents("RecallMessageSendToFriend", utils.SerializeStr(map[string]interface{}{
"send": sender,
"req": req,
}))
// 发给发送者
seq, err := proxy.MessageProxy.RecallMessageSendToUser(ctx, sender, sender.SenderId, req, true)
if err != nil {
return 0, err
}

// 发给接收者
_, err = proxy.MessageProxy.RecallMessageSendToUser(ctx, sender, req.ReceiverId, req, false)
if err != nil {
return 0, err
}

return seq, nil
}

+ 36
- 1
internal/logic/domain/group/model/group.go Переглянути файл

@@ -79,7 +79,7 @@ func CreateGroup(userId int64, in *pb.CreateGroupReq) *Group {
group.Members = append(group.Members, GroupUser{
GroupId: group.Id,
UserId: userId,
MemberType: int(pb.MemberType_GMT_ADMIN),
MemberType: int(pb.MembertypeGmtAdmin),
CreateTime: now,
UpdateTime: now,
UpdateType: UpdateTypeUpdate,
@@ -161,6 +161,41 @@ func (g *Group) SendMessage(ctx context.Context, sender *pb.Sender, req *pb.Send
return userSeq, nil
}

// RecallSendMessage 撤回消息发送至群组
func (g *Group) RecallSendMessage(ctx context.Context, sender *pb.Sender, req *pb.RecallMessageReq) (int64, error) {
if sender.SenderType == pb.SenderType_ST_USER && !g.IsMember(sender.SenderId) {
logger.Sugar.Error(ctx, sender.SenderId, req.ReceiverId, "不在群组内")
return 0, gerrors.ErrNotInGroup
}

// 如果发送者是用户,将消息发送给发送者,获取用户seq
var userSeq int64
var err error
if sender.SenderType == pb.SenderType_ST_USER {
userSeq, err = proxy.MessageProxy.RecallMessageSendToUser(ctx, sender, sender.SenderId, req, true)
if err != nil {
return 0, err
}
}

go func() {
defer util.RecoverPanic()
// 将消息发送给群组用户,使用写扩散
for _, user := range g.Members {
// 前面已经发送过,这里不需要再发送
if sender.SenderType == pb.SenderType_ST_USER && user.UserId == sender.SenderId {
continue
}
_, err := proxy.MessageProxy.RecallMessageSendToUser(grpclib.NewAndCopyRequestId(ctx), sender, user.UserId, req, false)
if err != nil {
return
}
}
}()

return userSeq, nil
}

func (g *Group) IsMember(userId int64) bool {
for i := range g.Members {
if g.Members[i].UserId == userId {


+ 10
- 0
internal/logic/domain/message/repo/message_repo.go Переглянути файл

@@ -47,3 +47,13 @@ func (d *messageRepo) ListBySeq(userId, seq, limit int64) ([]model.Message, bool
}
return messages, count > limit, nil
}

// UpdateStatus 更新消息状态
func (d *messageRepo) UpdateStatus(senderId, seq int64, status int) (int64, error) {
db := db.DB.Model(&model.Message{}).Where("sender_id = ? and seq = ?", senderId, seq).
Update("status", status)
if db.Error != nil {
return 0, gerrors.WrapError(db.Error)
}
return db.RowsAffected, nil
}

+ 92
- 0
internal/logic/domain/message/service/message_service.go Переглянути файл

@@ -256,6 +256,98 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser
return seq, nil
}

// RecallMessageSendToUser 撤回消息用户
func (*messageService) RecallMessageSendToUser(ctx context.Context, sender *pb.Sender, toUserId int64, req *pb.RecallMessageReq, isRecallMessageUser bool) (int64, error) {
masterId, _ := grpclib.GetCtxMasterId(ctx)
logger.Logger.Debug("SendToUser",
zap.String("master_id", masterId),
zap.Int64("request_id", grpclib.GetCtxRequestId(ctx)),
zap.Int64("to_user_id", toUserId))
var (
seq int64 = 0
err error
)

//1、解析消息体内容,content值为撤回消息的req
msg := &pb.RECALL{}
err = proto.Unmarshal(req.MessageContent, msg)
if isRecallMessageUser {
//2、改变消息状态
_, err = repo.MessageRepo.UpdateStatus(sender.SenderId, msg.RecallSeq, int(pb.MessageStatus_MS_RECALL))
if err != nil {
return 0, err
}
}

//3、发送一条新的消息
if req.IsPersist {
seq, err = SeqService.GetUserNext(ctx, toUserId)
if err != nil {
return 0, err
}

selfMessage := model.Message{
UserId: toUserId,
RequestId: grpclib.GetCtxRequestId(ctx),
SenderType: int32(sender.SenderType),
SenderId: sender.SenderId,
ReceiverType: int32(req.ReceiverType),
ReceiverId: req.ReceiverId,
ToUserIds: model.FormatUserIds(req.ToUserIds),
Type: int(req.MessageType),
Content: req.MessageContent,
Seq: seq,
SendTime: util.UnunixMilliTime(req.SendTime),
Status: int32(pb.MessageStatus_MS_NORMAL),
}
err = repo.MessageRepo.Save(selfMessage)
if err != nil {
logger.Sugar.Error(err)
return 0, err
}

if sender.SenderType == pb.SenderType_ST_USER && sender.SenderId == toUserId {
// 用户需要增加自己的已经同步的序列号
err = repo.DeviceACKRepo.Set(sender.SenderId, sender.DeviceId, seq)
if err != nil {
return 0, err
}
}
}

message := pb.Message{
Sender: sender,
ReceiverType: req.ReceiverType,
ReceiverId: req.ReceiverId,
ToUserIds: req.ToUserIds,
MessageType: req.MessageType,
MessageContent: req.MessageContent,
Seq: seq,
SendTime: req.SendTime,
Status: pb.MessageStatus_MS_NORMAL,
}

// 查询用户在线设备
devices, err := proxy.DeviceProxy.ListOnlineByUserId(ctx, toUserId)
if err != nil {
logger.Sugar.Error(err)
return 0, err
}

for i := range devices {
if sender.DeviceId == devices[i].DeviceId {
// 消息不需要投递给发送消息的设备
continue
}
err = MessageService.SendToDevice(ctx, devices[i], &message)
if err != nil {
logger.Sugar.Error(err, zap.Any("SendToUser error", devices[i]), zap.Error(err))
}
}

return seq, nil
}

// SendToDevice 将消息发送给设备
func (*messageService) SendToDevice(ctx context.Context, device *pb.Device, message *pb.Message) error {
messageSend := pb.MessageSend{Message: message}


+ 1
- 0
internal/logic/proxy/message_proxy.go Переглянути файл

@@ -11,5 +11,6 @@ var MessageProxy messageProxy

type messageProxy interface {
SendToUser(ctx context.Context, sender *pb.Sender, toUserId int64, req *pb.SendMessageReq) (int64, error)
RecallMessageSendToUser(ctx context.Context, sender *pb.Sender, toUserId int64, req *pb.RecallMessageReq, isRecallMessageUser bool) (int64, error)
PushToUser(ctx context.Context, userId int64, code pb.PushCode, message proto.Message, isPersist bool) error
}

+ 184
- 117
pkg/pb/connect.ext.pb.go Переглянути файл

@@ -1,8 +1,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.14.0
// source: connect.ext.proto_back
// protoc-gen-go v1.28.1
// protoc v3.20.0--rc1
// source: connect.ext.proto

package pb

@@ -91,6 +91,7 @@ const (
MessageType_MT_LOCATION MessageType = 6 // 地理位置
MessageType_MT_COMMAND MessageType = 7 // 指令推送
MessageType_MT_CUSTOM MessageType = 8 // 自定义
MessageType_MT_RECALL MessageType = 9 // 撤回消息
)

// Enum value maps for MessageType.
@@ -105,6 +106,7 @@ var (
6: "MT_LOCATION",
7: "MT_COMMAND",
8: "MT_CUSTOM",
9: "MT_RECALL",
}
MessageType_value = map[string]int32{
"MT_UNKNOWN": 0,
@@ -116,6 +118,7 @@ var (
"MT_LOCATION": 6,
"MT_COMMAND": 7,
"MT_CUSTOM": 8,
"MT_RECALL": 9,
}
)

@@ -994,6 +997,54 @@ func (x *Custom) GetData() string {
return ""
}

// 撤回消息
type RECALL struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

RecallSeq int64 `protobuf:"varint,1,opt,name=recall_seq,json=recallSeq,proto3" json:"recall_seq,omitempty"` // 撤回消息seq
}

func (x *RECALL) Reset() {
*x = RECALL{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

func (x *RECALL) String() string {
return protoimpl.X.MessageStringOf(x)
}

func (*RECALL) ProtoMessage() {}

func (x *RECALL) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[10]
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 RECALL.ProtoReflect.Descriptor instead.
func (*RECALL) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{10}
}

func (x *RECALL) GetRecallSeq() int64 {
if x != nil {
return x.RecallSeq
}
return 0
}

// 上行数据
type Input struct {
state protoimpl.MessageState
@@ -1008,7 +1059,7 @@ type Input struct {
func (x *Input) Reset() {
*x = Input{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[10]
mi := &file_connect_ext_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1021,7 +1072,7 @@ func (x *Input) String() string {
func (*Input) ProtoMessage() {}

func (x *Input) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[10]
mi := &file_connect_ext_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1034,7 +1085,7 @@ func (x *Input) ProtoReflect() protoreflect.Message {

// Deprecated: Use Input.ProtoReflect.Descriptor instead.
func (*Input) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{10}
return file_connect_ext_proto_rawDescGZIP(), []int{11}
}

func (x *Input) GetType() PackageType {
@@ -1074,7 +1125,7 @@ type Output struct {
func (x *Output) Reset() {
*x = Output{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[11]
mi := &file_connect_ext_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1087,7 +1138,7 @@ func (x *Output) String() string {
func (*Output) ProtoMessage() {}

func (x *Output) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[11]
mi := &file_connect_ext_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1100,7 +1151,7 @@ func (x *Output) ProtoReflect() protoreflect.Message {

// Deprecated: Use Output.ProtoReflect.Descriptor instead.
func (*Output) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{11}
return file_connect_ext_proto_rawDescGZIP(), []int{12}
}

func (x *Output) GetType() PackageType {
@@ -1152,7 +1203,7 @@ type SignInInput struct {
func (x *SignInInput) Reset() {
*x = SignInInput{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[12]
mi := &file_connect_ext_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1165,7 +1216,7 @@ func (x *SignInInput) String() string {
func (*SignInInput) ProtoMessage() {}

func (x *SignInInput) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[12]
mi := &file_connect_ext_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1178,7 +1229,7 @@ func (x *SignInInput) ProtoReflect() protoreflect.Message {

// Deprecated: Use SignInInput.ProtoReflect.Descriptor instead.
func (*SignInInput) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{12}
return file_connect_ext_proto_rawDescGZIP(), []int{13}
}

func (x *SignInInput) GetDeviceId() int64 {
@@ -1214,7 +1265,7 @@ type SyncInput struct {
func (x *SyncInput) Reset() {
*x = SyncInput{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[13]
mi := &file_connect_ext_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1227,7 +1278,7 @@ func (x *SyncInput) String() string {
func (*SyncInput) ProtoMessage() {}

func (x *SyncInput) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[13]
mi := &file_connect_ext_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1240,7 +1291,7 @@ func (x *SyncInput) ProtoReflect() protoreflect.Message {

// Deprecated: Use SyncInput.ProtoReflect.Descriptor instead.
func (*SyncInput) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{13}
return file_connect_ext_proto_rawDescGZIP(), []int{14}
}

func (x *SyncInput) GetSeq() int64 {
@@ -1263,7 +1314,7 @@ type SyncOutput struct {
func (x *SyncOutput) Reset() {
*x = SyncOutput{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[14]
mi := &file_connect_ext_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1276,7 +1327,7 @@ func (x *SyncOutput) String() string {
func (*SyncOutput) ProtoMessage() {}

func (x *SyncOutput) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[14]
mi := &file_connect_ext_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1289,7 +1340,7 @@ func (x *SyncOutput) ProtoReflect() protoreflect.Message {

// Deprecated: Use SyncOutput.ProtoReflect.Descriptor instead.
func (*SyncOutput) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{14}
return file_connect_ext_proto_rawDescGZIP(), []int{15}
}

func (x *SyncOutput) GetMessages() []*Message {
@@ -1319,7 +1370,7 @@ type SubscribeRoomInput struct {
func (x *SubscribeRoomInput) Reset() {
*x = SubscribeRoomInput{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[15]
mi := &file_connect_ext_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1332,7 +1383,7 @@ func (x *SubscribeRoomInput) String() string {
func (*SubscribeRoomInput) ProtoMessage() {}

func (x *SubscribeRoomInput) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[15]
mi := &file_connect_ext_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1345,7 +1396,7 @@ func (x *SubscribeRoomInput) ProtoReflect() protoreflect.Message {

// Deprecated: Use SubscribeRoomInput.ProtoReflect.Descriptor instead.
func (*SubscribeRoomInput) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{15}
return file_connect_ext_proto_rawDescGZIP(), []int{16}
}

func (x *SubscribeRoomInput) GetRoomId() int64 {
@@ -1374,7 +1425,7 @@ type MessageSend struct {
func (x *MessageSend) Reset() {
*x = MessageSend{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[16]
mi := &file_connect_ext_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1387,7 +1438,7 @@ func (x *MessageSend) String() string {
func (*MessageSend) ProtoMessage() {}

func (x *MessageSend) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[16]
mi := &file_connect_ext_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1400,7 +1451,7 @@ func (x *MessageSend) ProtoReflect() protoreflect.Message {

// Deprecated: Use MessageSend.ProtoReflect.Descriptor instead.
func (*MessageSend) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{16}
return file_connect_ext_proto_rawDescGZIP(), []int{17}
}

func (x *MessageSend) GetMessage() *Message {
@@ -1423,7 +1474,7 @@ type MessageACK struct {
func (x *MessageACK) Reset() {
*x = MessageACK{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_ext_proto_msgTypes[17]
mi := &file_connect_ext_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1436,7 +1487,7 @@ func (x *MessageACK) String() string {
func (*MessageACK) ProtoMessage() {}

func (x *MessageACK) ProtoReflect() protoreflect.Message {
mi := &file_connect_ext_proto_msgTypes[17]
mi := &file_connect_ext_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1449,7 +1500,7 @@ func (x *MessageACK) ProtoReflect() protoreflect.Message {

// Deprecated: Use MessageACK.ProtoReflect.Descriptor instead.
func (*MessageACK) Descriptor() ([]byte, []int) {
return file_connect_ext_proto_rawDescGZIP(), []int{17}
return file_connect_ext_proto_rawDescGZIP(), []int{18}
}

func (x *MessageACK) GetDeviceAck() int64 {
@@ -1539,79 +1590,82 @@ var file_connect_ext_proto_rawDesc = []byte{
0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74,
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x1c, 0x0a,
0x06, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x5f, 0x0a, 0x05, 0x49,
0x6e, 0x70, 0x75, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54,
0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x8e, 0x01, 0x0a,
0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61,
0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63,
0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74,
0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x59, 0x0a,
0x0b, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x0a, 0x09,
0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65,
0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72,
0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x1d, 0x0a, 0x09, 0x53, 0x79, 0x6e, 0x63,
0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x03, 0x73, 0x65, 0x71, 0x22, 0x50, 0x0a, 0x0a, 0x53, 0x79, 0x6e, 0x63, 0x4f,
0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x27, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x19,
0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x22, 0x3f, 0x0a, 0x12, 0x53, 0x75, 0x62,
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12,
0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x73, 0x65, 0x71, 0x22, 0x34, 0x0a, 0x0b, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x25, 0x0a, 0x07, 0x6d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x22, 0x4e, 0x0a, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x43, 0x4b, 0x12, 0x1d,
0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x63, 0x6b, 0x12, 0x21, 0x0a,
0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65,
0x2a, 0x73, 0x0a, 0x0b, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,
0x0e, 0x0a, 0x0a, 0x50, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12,
0x0e, 0x0a, 0x0a, 0x50, 0x54, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x49, 0x4e, 0x10, 0x01, 0x12,
0x0b, 0x0a, 0x07, 0x50, 0x54, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c,
0x50, 0x54, 0x5f, 0x48, 0x45, 0x41, 0x52, 0x54, 0x42, 0x45, 0x41, 0x54, 0x10, 0x03, 0x12, 0x0e,
0x0a, 0x0a, 0x50, 0x54, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x04, 0x12, 0x15,
0x0a, 0x11, 0x50, 0x54, 0x5f, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x5f, 0x52,
0x4f, 0x4f, 0x4d, 0x10, 0x05, 0x2a, 0x90, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e,
0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x54, 0x5f, 0x54, 0x45, 0x58, 0x54,
0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x54, 0x5f, 0x46, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12,
0x0c, 0x0a, 0x08, 0x4d, 0x54, 0x5f, 0x56, 0x4f, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x0c, 0x0a,
0x08, 0x4d, 0x54, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x4d,
0x54, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x54, 0x5f, 0x4c,
0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x54, 0x5f,
0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x54, 0x5f,
0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x10, 0x08, 0x2a, 0x46, 0x0a, 0x0c, 0x52, 0x65, 0x63, 0x65,
0x69, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x54, 0x5f, 0x55,
0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x54, 0x5f, 0x55,
0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x54, 0x5f, 0x47, 0x52, 0x4f, 0x55,
0x50, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x54, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x10, 0x03,
0x2a, 0x49, 0x0a, 0x0a, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e,
0x0a, 0x0a, 0x53, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d,
0x0a, 0x09, 0x53, 0x54, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, 0x01, 0x12, 0x0b, 0x0a,
0x07, 0x53, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54,
0x5f, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45, 0x53, 0x53, 0x10, 0x03, 0x2a, 0x3d, 0x0a, 0x0d, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x0a,
0x4d, 0x53, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09,
0x4d, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4d,
0x53, 0x5f, 0x52, 0x45, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x42, 0x0d, 0x5a, 0x0b, 0x67, 0x69,
0x6d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x27, 0x0a, 0x06, 0x52,
0x45, 0x43, 0x41, 0x4c, 0x4c, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x63, 0x61, 0x6c, 0x6c, 0x5f,
0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x63, 0x61, 0x6c,
0x6c, 0x53, 0x65, 0x71, 0x22, 0x5f, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x23, 0x0a,
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x62,
0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79,
0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x8e, 0x01, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74,
0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f,
0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52,
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c,
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x59, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x49, 0x6e,
0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65,
0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74,
0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65,
0x6e, 0x22, 0x1d, 0x0a, 0x09, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x10,
0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x73, 0x65, 0x71,
0x22, 0x50, 0x0a, 0x0a, 0x53, 0x79, 0x6e, 0x63, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x27,
0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d,
0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f,
0x72, 0x65, 0x22, 0x3f, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52,
0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x6d,
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49,
0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03,
0x73, 0x65, 0x71, 0x22, 0x34, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65,
0x6e, 0x64, 0x12, 0x25, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4e, 0x0a, 0x0a, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x41, 0x43, 0x4b, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63,
0x65, 0x5f, 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x65, 0x76,
0x69, 0x63, 0x65, 0x41, 0x63, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76,
0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65,
0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x2a, 0x73, 0x0a, 0x0b, 0x50, 0x61, 0x63,
0x6b, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x54, 0x5f, 0x55,
0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x54, 0x5f, 0x53,
0x49, 0x47, 0x4e, 0x5f, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x54, 0x5f, 0x53,
0x59, 0x4e, 0x43, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x54, 0x5f, 0x48, 0x45, 0x41, 0x52,
0x54, 0x42, 0x45, 0x41, 0x54, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x54, 0x5f, 0x4d, 0x45,
0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x54, 0x5f, 0x53, 0x55,
0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x10, 0x05, 0x2a, 0x9f,
0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e,
0x0a, 0x0a, 0x4d, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b,
0x0a, 0x07, 0x4d, 0x54, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4d,
0x54, 0x5f, 0x46, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x54, 0x5f, 0x56,
0x4f, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x54, 0x5f, 0x49, 0x4d, 0x41,
0x47, 0x45, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x54, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10,
0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x54, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e,
0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44,
0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x54, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x10,
0x08, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x54, 0x5f, 0x52, 0x45, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x09,
0x2a, 0x46, 0x0a, 0x0c, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65,
0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00,
0x12, 0x0b, 0x0a, 0x07, 0x52, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0c, 0x0a,
0x08, 0x52, 0x54, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x52,
0x54, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x10, 0x03, 0x2a, 0x49, 0x0a, 0x0a, 0x53, 0x65, 0x6e, 0x64,
0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x5f, 0x55, 0x4e, 0x4b,
0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x5f, 0x53, 0x59, 0x53,
0x54, 0x45, 0x4d, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x5f, 0x55, 0x53, 0x45, 0x52,
0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x5f, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45, 0x53,
0x53, 0x10, 0x03, 0x2a, 0x3d, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74,
0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x53, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f,
0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41,
0x4c, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x53, 0x5f, 0x52, 0x45, 0x43, 0x41, 0x4c, 0x4c,
0x10, 0x02, 0x42, 0x0d, 0x5a, 0x0b, 0x67, 0x69, 0x6d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62,
0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
@@ -1627,7 +1681,7 @@ func file_connect_ext_proto_rawDescGZIP() []byte {
}

var file_connect_ext_proto_enumTypes = make([]protoimpl.EnumInfo, 5)
var file_connect_ext_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
var file_connect_ext_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_connect_ext_proto_goTypes = []interface{}{
(PackageType)(0), // 0: pb.PackageType
(MessageType)(0), // 1: pb.MessageType
@@ -1644,14 +1698,15 @@ var file_connect_ext_proto_goTypes = []interface{}{
(*Location)(nil), // 12: pb.Location
(*Command)(nil), // 13: pb.Command
(*Custom)(nil), // 14: pb.Custom
(*Input)(nil), // 15: pb.Input
(*Output)(nil), // 16: pb.Output
(*SignInInput)(nil), // 17: pb.SignInInput
(*SyncInput)(nil), // 18: pb.SyncInput
(*SyncOutput)(nil), // 19: pb.SyncOutput
(*SubscribeRoomInput)(nil), // 20: pb.SubscribeRoomInput
(*MessageSend)(nil), // 21: pb.MessageSend
(*MessageACK)(nil), // 22: pb.MessageACK
(*RECALL)(nil), // 15: pb.RECALL
(*Input)(nil), // 16: pb.Input
(*Output)(nil), // 17: pb.Output
(*SignInInput)(nil), // 18: pb.SignInInput
(*SyncInput)(nil), // 19: pb.SyncInput
(*SyncOutput)(nil), // 20: pb.SyncOutput
(*SubscribeRoomInput)(nil), // 21: pb.SubscribeRoomInput
(*MessageSend)(nil), // 22: pb.MessageSend
(*MessageACK)(nil), // 23: pb.MessageACK
}
var file_connect_ext_proto_depIdxs = []int32{
6, // 0: pb.Message.sender:type_name -> pb.Sender
@@ -1797,7 +1852,7 @@ func file_connect_ext_proto_init() {
}
}
file_connect_ext_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Input); i {
switch v := v.(*RECALL); i {
case 0:
return &v.state
case 1:
@@ -1809,7 +1864,7 @@ func file_connect_ext_proto_init() {
}
}
file_connect_ext_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Output); i {
switch v := v.(*Input); i {
case 0:
return &v.state
case 1:
@@ -1821,7 +1876,7 @@ func file_connect_ext_proto_init() {
}
}
file_connect_ext_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignInInput); i {
switch v := v.(*Output); i {
case 0:
return &v.state
case 1:
@@ -1833,7 +1888,7 @@ func file_connect_ext_proto_init() {
}
}
file_connect_ext_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncInput); i {
switch v := v.(*SignInInput); i {
case 0:
return &v.state
case 1:
@@ -1845,7 +1900,7 @@ func file_connect_ext_proto_init() {
}
}
file_connect_ext_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncOutput); i {
switch v := v.(*SyncInput); i {
case 0:
return &v.state
case 1:
@@ -1857,7 +1912,7 @@ func file_connect_ext_proto_init() {
}
}
file_connect_ext_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SubscribeRoomInput); i {
switch v := v.(*SyncOutput); i {
case 0:
return &v.state
case 1:
@@ -1869,7 +1924,7 @@ func file_connect_ext_proto_init() {
}
}
file_connect_ext_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageSend); i {
switch v := v.(*SubscribeRoomInput); i {
case 0:
return &v.state
case 1:
@@ -1881,6 +1936,18 @@ func file_connect_ext_proto_init() {
}
}
file_connect_ext_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageSend); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_connect_ext_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageACK); i {
case 0:
return &v.state
@@ -1899,7 +1966,7 @@ func file_connect_ext_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_connect_ext_proto_rawDesc,
NumEnums: 5,
NumMessages: 18,
NumMessages: 19,
NumExtensions: 0,
NumServices: 0,
},


+ 618
- 372
pkg/pb/logic.ext.pb.go
Різницю між файлами не показано, бо вона завелика
Переглянути файл


+ 8
- 2
pkg/proto/connect.ext.proto Переглянути файл

@@ -29,8 +29,8 @@ message Sender {
SenderType sender_type = 1; // 发送者类型,1:系统,2:用户,3:第三方业务系统
int64 sender_id = 2; // 发送者id
int64 device_id = 3; // 发送者设备id
string avatar_url = 4; // 昵称
string nickname = 5; // 头像
string avatar_url = 4; // 头像
string nickname = 5; // 昵称
string extra = 6; // 扩展字段
}

@@ -45,6 +45,7 @@ enum MessageType {
MT_LOCATION = 6; // 地理位置
MT_COMMAND = 7; // 指令推送
MT_CUSTOM = 8; // 自定义
MT_RECALL = 9; // 撤回消息
}

// 文本消息
@@ -101,6 +102,11 @@ message Custom {
string data = 1; // 自定义数据
}

// 撤回消息
message RECALL {
int64 recall_seq = 1; // 撤回消息seq
}

/************************************消息体定义结束************************************/

// 上行数据


+ 16
- 0
pkg/proto/logic.ext.proto Переглянути файл

@@ -11,6 +11,8 @@ service LogicExt {

// 发送消息
rpc SendMessage (SendMessageReq) returns (SendMessageResp);
// 撤回消息
rpc RecallMessage (RecallMessageReq) returns (RecallMessageResp);
// 推送消息到房间
rpc PushRoom(PushRoomReq)returns(Empty);

@@ -69,6 +71,20 @@ message SendMessageResp {
int64 seq = 1; // 消息序列号
}

message RecallMessageReq {
ReceiverType receiver_type = 1; // 接收者类型,1:user;2:group
int64 receiver_id = 2; // 用户id或者群组id
repeated int64 to_user_ids = 3; // 需要@的用户id列表
MessageType message_type = 4; // 消息类型
bytes message_content = 5; // 消息内容
int64 send_time = 6; // 消息发送时间戳,精确到毫秒
bool is_persist = 7; // 是否将消息持久化到数据库
string message_content_back = 8;
}
message RecallMessageResp {
int64 seq = 1; // 消息序列号
}

message PushRoomReq{
int64 room_id = 1; // 房间id
MessageType message_type = 2; // 消息类型


Завантаження…
Відмінити
Зберегти