syntax = "proto3";

package im_types;

option go_package = "./im_types";

import "data_type.proto";

// 发送单聊消息
message SingleChatReq {
  string SenderAddr = 1;    //发送者id
  string ReceiverAddr = 2;  //接收者id
  string SenderPuk = 3;     //发送者公钥
  string ReceiverPuk = 4;   //接收者公钥
  optional EnumMessageType MessageType = 5;   //消息类型
  bytes Content = 6;        //消息内容
}

// 单聊消息-用ID批量删除
message SingleDelByidReq {
  string SenderAddr = 1;    //发送者id
  string ReceiverAddr = 2;  //接收者id
  repeated int64 MessageId = 3; //批量删除的ID列表
}

// 单聊消息-用ID区间删除
message SingleDelSectionReq {
  string SenderAddr = 1;    //发送者id
  string ReceiverAddr = 2;  //接收者id
  int64 Min = 3; //最小
  int64 Max = 4; //最大
}

// 单聊消息-用ID区间标记已送达
message SingleSendReq {
  string SenderAddr = 1;    //发送者id
  string ReceiverAddr = 2;  //接收者id
  int64 Min = 3; //最小
  int64 Max = 4; //最大
}

// 单聊消息-用ID区间标记已读
message SingleReadReq {
  string SenderAddr = 1;    //发送者id
  string ReceiverAddr = 2;  //接收者id
  int64 Min = 3; //最小
  int64 Max = 4; //最大
}

// 单聊消息-用ID区间标记撤回
message SingleWithdrawReq {
  string SenderAddr = 1;    //发送者id
  string ReceiverAddr = 2;  //接收者id
  int64 Min = 3; //最小
  int64 Max = 4; //最大
}

// 单聊消息-清空
message SingleDelAllReq {
  string SenderAddr = 1;    //发送者id
  string ReceiverAddr = 2;  //接收者id
}

// 发送群聊消息
message GroupChatReq {
  string SenderAddr = 1;    //发送者id
  string GroupAddr = 2;  //群id
  optional EnumMessageType MessageType = 3;   //消息类型
  bytes Content = 4;        //消息内容
  string AtList = 5;         //AT成员列表，以逗号隔开，如果是at所有人就直接发一个all
}

//群聊消息-用ID批量删除
message GroupDelByidReq {
  string SenderAddr = 1;    //发送者id
  string GroupAddr = 2;  //群id
  repeated int64 MessageId = 3; //批量删除的ID列表
}

// 群聊消息-用ID区间删除
message GroupDelSectionReq {
  string SenderAddr = 1;    //发送者id
  string GroupAddr = 2;  //群id
  int64 Min = 3; //最小
  int64 Max = 4; //最大
}

// 群聊消息-用ID区间撤回
message GroupWithdrawReq {
  string SenderAddr = 1;    //发送者id
  string GroupAddr = 2;  //群id
  int64 Min = 3; //最小
  int64 Max = 4; //最大
}

// 群聊消息-清空
message GroupDelAllReq {
  string SenderAddr = 1;    //发送者id
  string GroupAddr = 2;  //群id
}

// 获取单聊天信息
message GetSingleChatMsgReq {
  string SenderAddr = 1;    //发送者id
  string ReceiverAddr = 2;  //接收者id
  int64 StartId = 3;        //起始ID，从后往前查，如填99，则返回99以前的不包括99
  int64 Count = 4;          //返回的条数
}

message GetSingleChatMsgRes {
  repeated SingleMsg Msgs = 1;    //单聊消息列表
}

// 获取群聊天信息
message GetGroupChatMsgReq {
  string GroupAddr = 1;    //群id
  int64 StartId = 2;        //起始ID，从后往前查，如填99，则返回99以前的不包括99
  int64 Count = 3;          //返回的条数
}

message GetGroupChatMsgRes {
  repeated GroupMsg Msgs = 1;    //群聊消息列表
}


