Browse Source

add batch send message

master
shenjiachi 1 month ago
parent
commit
f165f0dfb2
25 changed files with 14587 additions and 65 deletions
  1. +10
    -0
      app/db/im/model/group.go
  2. +16
    -16
      app/hdl/im/hdl_send_message.go
  3. +16
    -0
      app/md/im/md_group.go
  4. +2472
    -0
      app/pkg/pb/business.ext.pb.go
  5. +490
    -0
      app/pkg/pb/business.int.pb.go
  6. +131
    -0
      app/pkg/pb/common.ext.pb.go
  7. +2490
    -0
      app/pkg/pb/connect.ext.pb.go
  8. +403
    -0
      app/pkg/pb/connect.int.pb.go
  9. +4497
    -0
      app/pkg/pb/logic.ext.pb.go
  10. +1555
    -0
      app/pkg/pb/logic.int.pb.go
  11. +956
    -0
      app/pkg/pb/push.ext.pb.go
  12. +169
    -0
      app/pkg/proto/business.ext.proto
  13. +28
    -0
      app/pkg/proto/business.int.proto
  14. +5
    -0
      app/pkg/proto/common.ext.proto
  15. +236
    -0
      app/pkg/proto/connect.ext.proto
  16. +28
    -0
      app/pkg/proto/connect.int.proto
  17. +303
    -0
      app/pkg/proto/logic.ext.proto
  18. +102
    -0
      app/pkg/proto/logic.int.proto
  19. +95
    -0
      app/pkg/proto/push.ext.proto
  20. +383
    -0
      app/svc/im/svc_send_message.go
  21. +19
    -0
      app/utils/slice_and_string.go
  22. +66
    -17
      docs/docs.go
  23. +63
    -15
      docs/swagger.json
  24. +49
    -14
      docs/swagger.yaml
  25. +5
    -3
      go.mod

+ 10
- 0
app/db/im/model/group.go View File

@@ -25,3 +25,13 @@ type GroupUser struct {
CreateTime string // 创建时间
UpdateTime string // 更新时间
}

type GroupWithOwner struct {
GroupID int64 `json:"group_user.group_id"`
OwnerID int64 `json:"group_user.owner_id"`
}

type CustomerServiceWithUser struct {
CustomerServiceUID int64 `json:"customer_service.uid"`
UserIMID int64 `json:"user.id"`
}

+ 16
- 16
app/hdl/im/hdl_send_message.go View File

@@ -8,51 +8,51 @@ import (
)

// BatchSendGroupMessage
// @Summary Im-发送群组消息
// @Tags 发送群组消息
// @Description 发送群组消息
// @Summary Im-群发发送群组消息
// @Tags 群发发送群组消息
// @Description 群发发送群组消息
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.GroupListReq true "相关参数"
// @Success 200 {object} md.GroupListResp ""
// @param req body md.BatchSendGroupMessageReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/batchSendGroupMessage [POST]
func BatchSendGroupMessage(c *gin.Context) {
var req *md.GroupListReq
var req *md.BatchSendGroupMessageReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}
err, resp := svc.GroupList(*req)
err := svc.BatchSendGroupMessage(req)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}
e.OutSuc(c, resp, nil)
e.OutSuc(c, "success", nil)
}

// BatchSendUserMessage
// @Summary Im-发送用户消息
// @Tags 发送用户消息
// @Description 发送用户消息
// @Summary Im-群发发送用户消息
// @Tags 群发发送用户消息
// @Description 群发发送用户消息
// @Accept json
// @Produce json
// @param Authorization header string true "验证参数Bearer和token空格拼接"
// @param req body md.GroupListReq true "相关参数"
// @Success 200 {object} md.GroupListResp ""
// @param req body md.BatchSendUserMessageReq true "相关参数"
// @Success 200 {string} "success"
// @Failure 400 {object} md.Response "具体错误"
// @Router /api/im/batchSendUserMessage [POST]
func BatchSendUserMessage(c *gin.Context) {
var req *md.GroupListReq
var req *md.BatchSendUserMessageReq
if err1 := c.ShouldBindJSON(&req); err1 != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err1.Error())
return
}
err, resp := svc.GroupList(*req)
err := svc.BatchSendUserMessage(req)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}
e.OutSuc(c, resp, nil)
e.OutSuc(c, "success", nil)
}

+ 16
- 0
app/md/im/md_group.go View File

@@ -55,3 +55,19 @@ type GroupUserListResp struct {
Nickname string // 昵称
} `json:"list"`
}

type BatchSendGroupMessageReq struct {
SendKind int `json:"send_kind"` // 发送模式(1:指定群组 2:所有群组)
Kind int `json:"kind"` // 消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)
Content string `json:"content"` // 消息内容
SendCondition string `json:"send_condition"` // 发送条件 群 ID 以";"分割
NotCondition string `json:"not_condition"` // 不发送条件 群 ID 以";"分割
}

type BatchSendUserMessageReq struct {
SendKind int `json:"send_kind"` // 发送模式(1:所有用户 2:指定用户)
Kind int `json:"kind"` // 消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)
Content string `json:"content"` // 消息内容
SendCondition string `json:"send_condition"` // 发送条件 用户手机号 以";"分割
NotCondition string `json:"not_condition"` // 不发送条件 用户手机号 以";"分割
}

+ 2472
- 0
app/pkg/pb/business.ext.pb.go
File diff suppressed because it is too large
View File


+ 490
- 0
app/pkg/pb/business.int.pb.go View File

@@ -0,0 +1,490 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.20.0--rc2
// source: business.int.proto

package pb

import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
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 AuthReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
DeviceId int64 `protobuf:"varint,2,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
}

func (x *AuthReq) Reset() {
*x = AuthReq{}
if protoimpl.UnsafeEnabled {
mi := &file_business_int_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*AuthReq) ProtoMessage() {}

func (x *AuthReq) ProtoReflect() protoreflect.Message {
mi := &file_business_int_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 AuthReq.ProtoReflect.Descriptor instead.
func (*AuthReq) Descriptor() ([]byte, []int) {
return file_business_int_proto_rawDescGZIP(), []int{0}
}

func (x *AuthReq) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}

func (x *AuthReq) GetDeviceId() int64 {
if x != nil {
return x.DeviceId
}
return 0
}

func (x *AuthReq) GetToken() string {
if x != nil {
return x.Token
}
return ""
}

type GetUsersReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

UserIds map[int64]int32 `protobuf:"bytes,1,rep,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 用户id
}

func (x *GetUsersReq) Reset() {
*x = GetUsersReq{}
if protoimpl.UnsafeEnabled {
mi := &file_business_int_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*GetUsersReq) ProtoMessage() {}

func (x *GetUsersReq) ProtoReflect() protoreflect.Message {
mi := &file_business_int_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 GetUsersReq.ProtoReflect.Descriptor instead.
func (*GetUsersReq) Descriptor() ([]byte, []int) {
return file_business_int_proto_rawDescGZIP(), []int{1}
}

func (x *GetUsersReq) GetUserIds() map[int64]int32 {
if x != nil {
return x.UserIds
}
return nil
}

type GetUsersResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

Users map[int64]*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // 用户信息
}

func (x *GetUsersResp) Reset() {
*x = GetUsersResp{}
if protoimpl.UnsafeEnabled {
mi := &file_business_int_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*GetUsersResp) ProtoMessage() {}

func (x *GetUsersResp) ProtoReflect() protoreflect.Message {
mi := &file_business_int_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 GetUsersResp.ProtoReflect.Descriptor instead.
func (*GetUsersResp) Descriptor() ([]byte, []int) {
return file_business_int_proto_rawDescGZIP(), []int{2}
}

func (x *GetUsersResp) GetUsers() map[int64]*User {
if x != nil {
return x.Users
}
return nil
}

var File_business_int_proto protoreflect.FileDescriptor

var file_business_int_proto_rawDesc = []byte{
0x0a, 0x12, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x62, 0x75, 0x73, 0x69,
0x6e, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x55,
0x0a, 0x07, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65,
0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72,
0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 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, 0x82, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65,
0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x37, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74,
0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x1a, 0x3a,
0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x85, 0x01, 0x0a, 0x0c, 0x47,
0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x05, 0x75,
0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x2e,
0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x1a, 0x42,
0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e,
0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x32, 0x88, 0x01, 0x0a, 0x0b, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x49,
0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0b, 0x2e, 0x70, 0x62, 0x2e,
0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x12, 0x2a, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x2e,
0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e,
0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d,
0x0a, 0x08, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x2e,
0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62,
0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0d, 0x5a,
0x0b, 0x67, 0x69, 0x6d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}

var (
file_business_int_proto_rawDescOnce sync.Once
file_business_int_proto_rawDescData = file_business_int_proto_rawDesc
)

func file_business_int_proto_rawDescGZIP() []byte {
file_business_int_proto_rawDescOnce.Do(func() {
file_business_int_proto_rawDescData = protoimpl.X.CompressGZIP(file_business_int_proto_rawDescData)
})
return file_business_int_proto_rawDescData
}

var file_business_int_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_business_int_proto_goTypes = []interface{}{
(*AuthReq)(nil), // 0: pb.AuthReq
(*GetUsersReq)(nil), // 1: pb.GetUsersReq
(*GetUsersResp)(nil), // 2: pb.GetUsersResp
nil, // 3: pb.GetUsersReq.UserIdsEntry
nil, // 4: pb.GetUsersResp.UsersEntry
(*User)(nil), // 5: pb.User
(*GetUserReq)(nil), // 6: pb.GetUserReq
(*Empty)(nil), // 7: pb.Empty
(*GetUserResp)(nil), // 8: pb.GetUserResp
}
var file_business_int_proto_depIdxs = []int32{
3, // 0: pb.GetUsersReq.user_ids:type_name -> pb.GetUsersReq.UserIdsEntry
4, // 1: pb.GetUsersResp.users:type_name -> pb.GetUsersResp.UsersEntry
5, // 2: pb.GetUsersResp.UsersEntry.value:type_name -> pb.User
0, // 3: pb.BusinessInt.Auth:input_type -> pb.AuthReq
6, // 4: pb.BusinessInt.GetUser:input_type -> pb.GetUserReq
1, // 5: pb.BusinessInt.GetUsers:input_type -> pb.GetUsersReq
7, // 6: pb.BusinessInt.Auth:output_type -> pb.Empty
8, // 7: pb.BusinessInt.GetUser:output_type -> pb.GetUserResp
2, // 8: pb.BusinessInt.GetUsers:output_type -> pb.GetUsersResp
6, // [6:9] is the sub-list for method output_type
3, // [3:6] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}

func init() { file_business_int_proto_init() }
func file_business_int_proto_init() {
if File_business_int_proto != nil {
return
}
file_common_ext_proto_init()
file_business_ext_proto_init()
if !protoimpl.UnsafeEnabled {
file_business_int_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_business_int_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetUsersReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_business_int_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetUsersResp); 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_business_int_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_business_int_proto_goTypes,
DependencyIndexes: file_business_int_proto_depIdxs,
MessageInfos: file_business_int_proto_msgTypes,
}.Build()
File_business_int_proto = out.File
file_business_int_proto_rawDesc = nil
file_business_int_proto_goTypes = nil
file_business_int_proto_depIdxs = nil
}

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// BusinessIntClient is the client API for BusinessInt service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type BusinessIntClient interface {
// 权限校验
Auth(ctx context.Context, in *AuthReq, opts ...grpc.CallOption) (*Empty, error)
// 批量获取用户信息
GetUser(ctx context.Context, in *GetUserReq, opts ...grpc.CallOption) (*GetUserResp, error)
// 批量获取用户信息
GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersResp, error)
}

type businessIntClient struct {
cc grpc.ClientConnInterface
}

func NewBusinessIntClient(cc grpc.ClientConnInterface) BusinessIntClient {
return &businessIntClient{cc}
}

func (c *businessIntClient) Auth(ctx context.Context, in *AuthReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/pb.BusinessInt/Auth", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

func (c *businessIntClient) GetUser(ctx context.Context, in *GetUserReq, opts ...grpc.CallOption) (*GetUserResp, error) {
out := new(GetUserResp)
err := c.cc.Invoke(ctx, "/pb.BusinessInt/GetUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

func (c *businessIntClient) GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersResp, error) {
out := new(GetUsersResp)
err := c.cc.Invoke(ctx, "/pb.BusinessInt/GetUsers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

// BusinessIntServer is the server API for BusinessInt service.
// All implementations must embed UnimplementedBusinessIntServer
// for forward compatibility
type BusinessIntServer interface {
// 权限校验
Auth(context.Context, *AuthReq) (*Empty, error)
// 批量获取用户信息
GetUser(context.Context, *GetUserReq) (*GetUserResp, error)
// 批量获取用户信息
GetUsers(context.Context, *GetUsersReq) (*GetUsersResp, error)
}

// UnimplementedBusinessIntServer must be embedded to have forward compatible implementations.
type UnimplementedBusinessIntServer struct {
}

func (UnimplementedBusinessIntServer) Auth(context.Context, *AuthReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Auth not implemented")
}
func (UnimplementedBusinessIntServer) GetUser(context.Context, *GetUserReq) (*GetUserResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
}
func (UnimplementedBusinessIntServer) GetUsers(context.Context, *GetUsersReq) (*GetUsersResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUsers not implemented")
}

func RegisterBusinessIntServer(s grpc.ServiceRegistrar, srv BusinessIntServer) {
s.RegisterService(&BusinessInt_ServiceDesc, srv)
}

func _BusinessInt_Auth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AuthReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BusinessIntServer).Auth(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.BusinessInt/Auth",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BusinessIntServer).Auth(ctx, req.(*AuthReq))
}
return interceptor(ctx, in, info, handler)
}

func _BusinessInt_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BusinessIntServer).GetUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.BusinessInt/GetUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BusinessIntServer).GetUser(ctx, req.(*GetUserReq))
}
return interceptor(ctx, in, info, handler)
}

func _BusinessInt_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUsersReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BusinessIntServer).GetUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.BusinessInt/GetUsers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BusinessIntServer).GetUsers(ctx, req.(*GetUsersReq))
}
return interceptor(ctx, in, info, handler)
}

// BusinessInt_ServiceDesc is the grpc.ServiceDesc for BusinessInt service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BusinessInt_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pb.BusinessInt",
HandlerType: (*BusinessIntServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Auth",
Handler: _BusinessInt_Auth_Handler,
},
{
MethodName: "GetUser",
Handler: _BusinessInt_GetUser_Handler,
},
{
MethodName: "GetUsers",
Handler: _BusinessInt_GetUsers_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "business.int.proto",
}

+ 131
- 0
app/pkg/pb/common.ext.pb.go View File

@@ -0,0 +1,131 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.14.0
// source: common.ext.proto_back

package pb

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 Empty struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}

func (x *Empty) Reset() {
*x = Empty{}
if protoimpl.UnsafeEnabled {
mi := &file_common_ext_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*Empty) ProtoMessage() {}

func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_common_ext_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 Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_common_ext_proto_rawDescGZIP(), []int{0}
}

var File_common_ext_proto protoreflect.FileDescriptor

var file_common_ext_proto_rawDesc = []byte{
0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42,
0x0d, 0x5a, 0x0b, 0x67, 0x69, 0x6d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
file_common_ext_proto_rawDescOnce sync.Once
file_common_ext_proto_rawDescData = file_common_ext_proto_rawDesc
)

func file_common_ext_proto_rawDescGZIP() []byte {
file_common_ext_proto_rawDescOnce.Do(func() {
file_common_ext_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_ext_proto_rawDescData)
})
return file_common_ext_proto_rawDescData
}

var file_common_ext_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_common_ext_proto_goTypes = []interface{}{
(*Empty)(nil), // 0: pb.Empty
}
var file_common_ext_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}

func init() { file_common_ext_proto_init() }
func file_common_ext_proto_init() {
if File_common_ext_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_common_ext_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Empty); 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_common_ext_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_common_ext_proto_goTypes,
DependencyIndexes: file_common_ext_proto_depIdxs,
MessageInfos: file_common_ext_proto_msgTypes,
}.Build()
File_common_ext_proto = out.File
file_common_ext_proto_rawDesc = nil
file_common_ext_proto_goTypes = nil
file_common_ext_proto_depIdxs = nil
}

+ 2490
- 0
app/pkg/pb/connect.ext.pb.go
File diff suppressed because it is too large
View File


+ 403
- 0
app/pkg/pb/connect.int.pb.go View File

@@ -0,0 +1,403 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.20.0--rc2
// source: connect.int.proto

package pb

import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
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 DeliverMessageReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

DeviceId int64 `protobuf:"varint,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` // 设备id
MessageSend *MessageSend `protobuf:"bytes,2,opt,name=message_send,json=messageSend,proto3" json:"message_send,omitempty"` // 数据
}

func (x *DeliverMessageReq) Reset() {
*x = DeliverMessageReq{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_int_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*DeliverMessageReq) ProtoMessage() {}

func (x *DeliverMessageReq) ProtoReflect() protoreflect.Message {
mi := &file_connect_int_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 DeliverMessageReq.ProtoReflect.Descriptor instead.
func (*DeliverMessageReq) Descriptor() ([]byte, []int) {
return file_connect_int_proto_rawDescGZIP(), []int{0}
}

func (x *DeliverMessageReq) GetDeviceId() int64 {
if x != nil {
return x.DeviceId
}
return 0
}

func (x *DeliverMessageReq) GetMessageSend() *MessageSend {
if x != nil {
return x.MessageSend
}
return nil
}

// 房间推送
type PushRoomMsg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

RoomId int64 `protobuf:"varint,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"` // 设备id
MessageSend *MessageSend `protobuf:"bytes,2,opt,name=message_send,json=messageSend,proto3" json:"message_send,omitempty"` // 数据
}

func (x *PushRoomMsg) Reset() {
*x = PushRoomMsg{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_int_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*PushRoomMsg) ProtoMessage() {}

func (x *PushRoomMsg) ProtoReflect() protoreflect.Message {
mi := &file_connect_int_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 PushRoomMsg.ProtoReflect.Descriptor instead.
func (*PushRoomMsg) Descriptor() ([]byte, []int) {
return file_connect_int_proto_rawDescGZIP(), []int{1}
}

func (x *PushRoomMsg) GetRoomId() int64 {
if x != nil {
return x.RoomId
}
return 0
}

func (x *PushRoomMsg) GetMessageSend() *MessageSend {
if x != nil {
return x.MessageSend
}
return nil
}

// 房间推送
type PushAllMsg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

MessageSend *MessageSend `protobuf:"bytes,2,opt,name=message_send,json=messageSend,proto3" json:"message_send,omitempty"` // 数据
}

func (x *PushAllMsg) Reset() {
*x = PushAllMsg{}
if protoimpl.UnsafeEnabled {
mi := &file_connect_int_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*PushAllMsg) ProtoMessage() {}

func (x *PushAllMsg) ProtoReflect() protoreflect.Message {
mi := &file_connect_int_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 PushAllMsg.ProtoReflect.Descriptor instead.
func (*PushAllMsg) Descriptor() ([]byte, []int) {
return file_connect_int_proto_rawDescGZIP(), []int{2}
}

func (x *PushAllMsg) GetMessageSend() *MessageSend {
if x != nil {
return x.MessageSend
}
return nil
}

var File_connect_int_proto protoreflect.FileDescriptor

var file_connect_int_proto_rawDesc = []byte{
0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65,
0x63, 0x74, 0x2e, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x64, 0x0a, 0x11,
0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65,
0x71, 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, 0x32,
0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65,
0x6e, 0x64, 0x22, 0x5a, 0x0a, 0x0b, 0x50, 0x75, 0x73, 0x68, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, 0x73,
0x67, 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, 0x32, 0x0a, 0x0c, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e,
0x64, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x64, 0x22, 0x40,
0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x41, 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x12, 0x32, 0x0a, 0x0c,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53,
0x65, 0x6e, 0x64, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x64,
0x32, 0x40, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x74, 0x12, 0x32,
0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x42, 0x0d, 0x5a, 0x0b, 0x67, 0x69, 0x6d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62,
0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
file_connect_int_proto_rawDescOnce sync.Once
file_connect_int_proto_rawDescData = file_connect_int_proto_rawDesc
)

func file_connect_int_proto_rawDescGZIP() []byte {
file_connect_int_proto_rawDescOnce.Do(func() {
file_connect_int_proto_rawDescData = protoimpl.X.CompressGZIP(file_connect_int_proto_rawDescData)
})
return file_connect_int_proto_rawDescData
}

var file_connect_int_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_connect_int_proto_goTypes = []interface{}{
(*DeliverMessageReq)(nil), // 0: pb.DeliverMessageReq
(*PushRoomMsg)(nil), // 1: pb.PushRoomMsg
(*PushAllMsg)(nil), // 2: pb.PushAllMsg
(*MessageSend)(nil), // 3: pb.MessageSend
(*Empty)(nil), // 4: pb.Empty
}
var file_connect_int_proto_depIdxs = []int32{
3, // 0: pb.DeliverMessageReq.message_send:type_name -> pb.MessageSend
3, // 1: pb.PushRoomMsg.message_send:type_name -> pb.MessageSend
3, // 2: pb.PushAllMsg.message_send:type_name -> pb.MessageSend
0, // 3: pb.ConnectInt.DeliverMessage:input_type -> pb.DeliverMessageReq
4, // 4: pb.ConnectInt.DeliverMessage:output_type -> pb.Empty
4, // [4:5] is the sub-list for method output_type
3, // [3:4] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}

func init() { file_connect_int_proto_init() }
func file_connect_int_proto_init() {
if File_connect_int_proto != nil {
return
}
file_common_ext_proto_init()
file_connect_ext_proto_init()
if !protoimpl.UnsafeEnabled {
file_connect_int_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeliverMessageReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_connect_int_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushRoomMsg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_connect_int_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PushAllMsg); 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_connect_int_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_connect_int_proto_goTypes,
DependencyIndexes: file_connect_int_proto_depIdxs,
MessageInfos: file_connect_int_proto_msgTypes,
}.Build()
File_connect_int_proto = out.File
file_connect_int_proto_rawDesc = nil
file_connect_int_proto_goTypes = nil
file_connect_int_proto_depIdxs = nil
}

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// ConnectIntClient is the client API for ConnectInt service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ConnectIntClient interface {
// 消息投递
DeliverMessage(ctx context.Context, in *DeliverMessageReq, opts ...grpc.CallOption) (*Empty, error)
}

type connectIntClient struct {
cc grpc.ClientConnInterface
}

func NewConnectIntClient(cc grpc.ClientConnInterface) ConnectIntClient {
return &connectIntClient{cc}
}

func (c *connectIntClient) DeliverMessage(ctx context.Context, in *DeliverMessageReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/pb.ConnectInt/DeliverMessage", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

// ConnectIntServer is the server API for ConnectInt service.
// All implementations must embed UnimplementedConnectIntServer
// for forward compatibility
type ConnectIntServer interface {
// 消息投递
DeliverMessage(context.Context, *DeliverMessageReq) (*Empty, error)
}

// UnimplementedConnectIntServer must be embedded to have forward compatible implementations.
type UnimplementedConnectIntServer struct {
}

func (UnimplementedConnectIntServer) DeliverMessage(context.Context, *DeliverMessageReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeliverMessage not implemented")
}

// UnsafeConnectIntServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ConnectIntServer will
// result in compilation errors.
type UnsafeConnectIntServer interface {
}

func RegisterConnectIntServer(s grpc.ServiceRegistrar, srv ConnectIntServer) {
s.RegisterService(&ConnectInt_ServiceDesc, srv)
}

func _ConnectInt_DeliverMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeliverMessageReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConnectIntServer).DeliverMessage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.ConnectInt/DeliverMessage",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConnectIntServer).DeliverMessage(ctx, req.(*DeliverMessageReq))
}
return interceptor(ctx, in, info, handler)
}

// ConnectInt_ServiceDesc is the grpc.ServiceDesc for ConnectInt service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ConnectInt_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pb.ConnectInt",
HandlerType: (*ConnectIntServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "DeliverMessage",
Handler: _ConnectInt_DeliverMessage_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "connect.int.proto",
}

+ 4497
- 0
app/pkg/pb/logic.ext.pb.go
File diff suppressed because it is too large
View File


+ 1555
- 0
app/pkg/pb/logic.int.pb.go
File diff suppressed because it is too large
View File


+ 956
- 0
app/pkg/pb/push.ext.pb.go View File

@@ -0,0 +1,956 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.20.0--rc2
// source: push.ext.proto

package pb

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 PushCode int32

const (
PushCode_PC_ADD_DEFAULT PushCode = 0
PushCode_PC_ADD_FRIEND PushCode = 100 // 添加好友请求
PushCode_PC_AGREE_ADD_FRIEND PushCode = 101 // 同意添加好友
PushCode_PC_UPDATE_GROUP PushCode = 110 // 更新群组
PushCode_PC_ADD_GROUP_MEMBERS PushCode = 120 // 添加群组成员
PushCode_PC_REMOVE_GROUP_MEMBER PushCode = 121 // 移除群组成员
PushCode_PC_BANNED_GROUP_MEMBER PushCode = 122 // 禁言群组成员
PushCode_PC_REMOVE_BANNED_GROUP_MEMBER PushCode = 123 // 取消禁言群组成员
PushCode_PC_UPDATE_GROUP_MEMBER PushCode = 124 // 更新群组成员信息
)

// Enum value maps for PushCode.
var (
PushCode_name = map[int32]string{
0: "PC_ADD_DEFAULT",
100: "PC_ADD_FRIEND",
101: "PC_AGREE_ADD_FRIEND",
110: "PC_UPDATE_GROUP",
120: "PC_ADD_GROUP_MEMBERS",
121: "PC_REMOVE_GROUP_MEMBER",
122: "PC_BANNED_GROUP_MEMBER",
123: "PC_REMOVE_BANNED_GROUP_MEMBER",
124: "PC_UPDATE_GROUP_MEMBER",
}
PushCode_value = map[string]int32{
"PC_ADD_DEFAULT": 0,
"PC_ADD_FRIEND": 100,
"PC_AGREE_ADD_FRIEND": 101,
"PC_UPDATE_GROUP": 110,
"PC_ADD_GROUP_MEMBERS": 120,
"PC_REMOVE_GROUP_MEMBER": 121,
"PC_BANNED_GROUP_MEMBER": 122,
"PC_REMOVE_BANNED_GROUP_MEMBER": 123,
"PC_UPDATE_GROUP_MEMBER": 124,
}
)

func (x PushCode) Enum() *PushCode {
p := new(PushCode)
*p = x
return p
}

func (x PushCode) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (PushCode) Descriptor() protoreflect.EnumDescriptor {
return file_push_ext_proto_enumTypes[0].Descriptor()
}

func (PushCode) Type() protoreflect.EnumType {
return &file_push_ext_proto_enumTypes[0]
}

func (x PushCode) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}

// Deprecated: Use PushCode.Descriptor instead.
func (PushCode) EnumDescriptor() ([]byte, []int) {
return file_push_ext_proto_rawDescGZIP(), []int{0}
}

// 推送码 PC_ADD_FRIEND = 100
type AddFriendPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

FriendId int64 `protobuf:"varint,1,opt,name=friend_id,json=friendId,proto3" json:"friend_id,omitempty"` // 好友id
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` // 昵称
AvatarUrl string `protobuf:"bytes,3,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` // 头像
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` // 描述
}

func (x *AddFriendPush) Reset() {
*x = AddFriendPush{}
if protoimpl.UnsafeEnabled {
mi := &file_push_ext_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*AddFriendPush) ProtoMessage() {}

func (x *AddFriendPush) ProtoReflect() protoreflect.Message {
mi := &file_push_ext_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 AddFriendPush.ProtoReflect.Descriptor instead.
func (*AddFriendPush) Descriptor() ([]byte, []int) {
return file_push_ext_proto_rawDescGZIP(), []int{0}
}

func (x *AddFriendPush) GetFriendId() int64 {
if x != nil {
return x.FriendId
}
return 0
}

func (x *AddFriendPush) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}

func (x *AddFriendPush) GetAvatarUrl() string {
if x != nil {
return x.AvatarUrl
}
return ""
}

func (x *AddFriendPush) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}

// 推送码 PC_AGREE_ADD_FRIEND = 101
type AgreeAddFriendPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

FriendId int64 `protobuf:"varint,1,opt,name=friend_id,json=friendId,proto3" json:"friend_id,omitempty"` // 好友id
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` // 昵称
AvatarUrl string `protobuf:"bytes,3,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` // 头像
}

func (x *AgreeAddFriendPush) Reset() {
*x = AgreeAddFriendPush{}
if protoimpl.UnsafeEnabled {
mi := &file_push_ext_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*AgreeAddFriendPush) ProtoMessage() {}

func (x *AgreeAddFriendPush) ProtoReflect() protoreflect.Message {
mi := &file_push_ext_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 AgreeAddFriendPush.ProtoReflect.Descriptor instead.
func (*AgreeAddFriendPush) Descriptor() ([]byte, []int) {
return file_push_ext_proto_rawDescGZIP(), []int{1}
}

func (x *AgreeAddFriendPush) GetFriendId() int64 {
if x != nil {
return x.FriendId
}
return 0
}

func (x *AgreeAddFriendPush) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}

func (x *AgreeAddFriendPush) GetAvatarUrl() string {
if x != nil {
return x.AvatarUrl
}
return ""
}

// 更新群组 PC_UPDATE_GROUP = 110
type UpdateGroupPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

OptId int64 `protobuf:"varint,1,opt,name=opt_id,json=optId,proto3" json:"opt_id,omitempty"` // 操作人用户id
OptName string `protobuf:"bytes,2,opt,name=opt_name,json=optName,proto3" json:"opt_name,omitempty"` // 操作人昵称
OptAvatarUrl string `protobuf:"bytes,3,opt,name=opt_avatar_url,json=optAvatarUrl,proto3" json:"opt_avatar_url,omitempty"` // 操作人头像
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // 群组名称
AvatarUrl string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` // 群组头像
Introduction string `protobuf:"bytes,6,opt,name=introduction,proto3" json:"introduction,omitempty"` // 群组简介
IsUpdateIntroduction bool `protobuf:"varint,7,opt,name=isUpdateIntroduction,proto3" json:"isUpdateIntroduction,omitempty"` // 是否更新群组简介
Extra string `protobuf:"bytes,8,opt,name=extra,proto3" json:"extra,omitempty"` // 附加字段
}

func (x *UpdateGroupPush) Reset() {
*x = UpdateGroupPush{}
if protoimpl.UnsafeEnabled {
mi := &file_push_ext_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*UpdateGroupPush) ProtoMessage() {}

func (x *UpdateGroupPush) ProtoReflect() protoreflect.Message {
mi := &file_push_ext_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 UpdateGroupPush.ProtoReflect.Descriptor instead.
func (*UpdateGroupPush) Descriptor() ([]byte, []int) {
return file_push_ext_proto_rawDescGZIP(), []int{2}
}

func (x *UpdateGroupPush) GetOptId() int64 {
if x != nil {
return x.OptId
}
return 0
}

func (x *UpdateGroupPush) GetOptName() string {
if x != nil {
return x.OptName
}
return ""
}

func (x *UpdateGroupPush) GetOptAvatarUrl() string {
if x != nil {
return x.OptAvatarUrl
}
return ""
}

func (x *UpdateGroupPush) GetName() string {
if x != nil {
return x.Name
}
return ""
}

func (x *UpdateGroupPush) GetAvatarUrl() string {
if x != nil {
return x.AvatarUrl
}
return ""
}

func (x *UpdateGroupPush) GetIntroduction() string {
if x != nil {
return x.Introduction
}
return ""
}

func (x *UpdateGroupPush) GetIsUpdateIntroduction() bool {
if x != nil {
return x.IsUpdateIntroduction
}
return false
}

func (x *UpdateGroupPush) GetExtra() string {
if x != nil {
return x.Extra
}
return ""
}

// 添加群组成员 PC_AGREE_ADD_GROUPS = 120
type AddGroupMembersPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

OptId int64 `protobuf:"varint,1,opt,name=opt_id,json=optId,proto3" json:"opt_id,omitempty"` // 操作人用户id
OptName string `protobuf:"bytes,2,opt,name=opt_name,json=optName,proto3" json:"opt_name,omitempty"` // 操作人昵称
Members []*GroupMember `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"` // 群组成员
}

func (x *AddGroupMembersPush) Reset() {
*x = AddGroupMembersPush{}
if protoimpl.UnsafeEnabled {
mi := &file_push_ext_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*AddGroupMembersPush) ProtoMessage() {}

func (x *AddGroupMembersPush) ProtoReflect() protoreflect.Message {
mi := &file_push_ext_proto_msgTypes[3]
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 AddGroupMembersPush.ProtoReflect.Descriptor instead.
func (*AddGroupMembersPush) Descriptor() ([]byte, []int) {
return file_push_ext_proto_rawDescGZIP(), []int{3}
}

func (x *AddGroupMembersPush) GetOptId() int64 {
if x != nil {
return x.OptId
}
return 0
}

func (x *AddGroupMembersPush) GetOptName() string {
if x != nil {
return x.OptName
}
return ""
}

func (x *AddGroupMembersPush) GetMembers() []*GroupMember {
if x != nil {
return x.Members
}
return nil
}

// 删除群组成员 PC_REMOVE_GROUP_MEMBER = 121
type RemoveGroupMemberPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

OptId int64 `protobuf:"varint,1,opt,name=opt_id,json=optId,proto3" json:"opt_id,omitempty"` // 操作人用户id
OptName string `protobuf:"bytes,2,opt,name=opt_name,json=optName,proto3" json:"opt_name,omitempty"` // 操作人昵称
DeletedUserId int64 `protobuf:"varint,3,opt,name=deleted_user_id,json=deletedUserId,proto3" json:"deleted_user_id,omitempty"` // 被删除的成员id
DeletedUserName string `protobuf:"bytes,4,opt,name=deleted_user_name,json=deletedUserName,proto3" json:"deleted_user_name,omitempty"` // 被删除的成员昵称
}

func (x *RemoveGroupMemberPush) Reset() {
*x = RemoveGroupMemberPush{}
if protoimpl.UnsafeEnabled {
mi := &file_push_ext_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*RemoveGroupMemberPush) ProtoMessage() {}

func (x *RemoveGroupMemberPush) ProtoReflect() protoreflect.Message {
mi := &file_push_ext_proto_msgTypes[4]
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 RemoveGroupMemberPush.ProtoReflect.Descriptor instead.
func (*RemoveGroupMemberPush) Descriptor() ([]byte, []int) {
return file_push_ext_proto_rawDescGZIP(), []int{4}
}

func (x *RemoveGroupMemberPush) GetOptId() int64 {
if x != nil {
return x.OptId
}
return 0
}

func (x *RemoveGroupMemberPush) GetOptName() string {
if x != nil {
return x.OptName
}
return ""
}

func (x *RemoveGroupMemberPush) GetDeletedUserId() int64 {
if x != nil {
return x.DeletedUserId
}
return 0
}

func (x *RemoveGroupMemberPush) GetDeletedUserName() string {
if x != nil {
return x.DeletedUserName
}
return ""
}

// 禁言群组成员 PC_BANNED_GROUP_MEMBER = 122
type BannedGroupMemberPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

OptId int64 `protobuf:"varint,1,opt,name=opt_id,json=optId,proto3" json:"opt_id,omitempty"` // 操作人用户id
OptName string `protobuf:"bytes,2,opt,name=opt_name,json=optName,proto3" json:"opt_name,omitempty"` // 操作人昵称
BannedUserId int64 `protobuf:"varint,3,opt,name=banned_user_id,json=bannedUserId,proto3" json:"banned_user_id,omitempty"` // 被禁言的成员id
BannedUserName string `protobuf:"bytes,4,opt,name=banned_user_name,json=bannedUserName,proto3" json:"banned_user_name,omitempty"` // 被禁言的成员昵称
}

func (x *BannedGroupMemberPush) Reset() {
*x = BannedGroupMemberPush{}
if protoimpl.UnsafeEnabled {
mi := &file_push_ext_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*BannedGroupMemberPush) ProtoMessage() {}

func (x *BannedGroupMemberPush) ProtoReflect() protoreflect.Message {
mi := &file_push_ext_proto_msgTypes[5]
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 BannedGroupMemberPush.ProtoReflect.Descriptor instead.
func (*BannedGroupMemberPush) Descriptor() ([]byte, []int) {
return file_push_ext_proto_rawDescGZIP(), []int{5}
}

func (x *BannedGroupMemberPush) GetOptId() int64 {
if x != nil {
return x.OptId
}
return 0
}

func (x *BannedGroupMemberPush) GetOptName() string {
if x != nil {
return x.OptName
}
return ""
}

func (x *BannedGroupMemberPush) GetBannedUserId() int64 {
if x != nil {
return x.BannedUserId
}
return 0
}

func (x *BannedGroupMemberPush) GetBannedUserName() string {
if x != nil {
return x.BannedUserName
}
return ""
}

// 取消禁言群组成员 PC_REMOVE_BANNED_GROUP_MEMBER = 123
type RemoveBannedGroupMemberPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

OptId int64 `protobuf:"varint,1,opt,name=opt_id,json=optId,proto3" json:"opt_id,omitempty"` // 操作人用户id
OptName string `protobuf:"bytes,2,opt,name=opt_name,json=optName,proto3" json:"opt_name,omitempty"` // 操作人昵称
RemoveBannedUserId int64 `protobuf:"varint,3,opt,name=remove_banned_user_id,json=removeBannedUserId,proto3" json:"remove_banned_user_id,omitempty"` // 被解禁言的成员id
RemoveBannedUserName string `protobuf:"bytes,4,opt,name=remove_banned_user_name,json=removeBannedUserName,proto3" json:"remove_banned_user_name,omitempty"` // 被解禁言的成员昵称
}

func (x *RemoveBannedGroupMemberPush) Reset() {
*x = RemoveBannedGroupMemberPush{}
if protoimpl.UnsafeEnabled {
mi := &file_push_ext_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*RemoveBannedGroupMemberPush) ProtoMessage() {}

func (x *RemoveBannedGroupMemberPush) ProtoReflect() protoreflect.Message {
mi := &file_push_ext_proto_msgTypes[6]
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 RemoveBannedGroupMemberPush.ProtoReflect.Descriptor instead.
func (*RemoveBannedGroupMemberPush) Descriptor() ([]byte, []int) {
return file_push_ext_proto_rawDescGZIP(), []int{6}
}

func (x *RemoveBannedGroupMemberPush) GetOptId() int64 {
if x != nil {
return x.OptId
}
return 0
}

func (x *RemoveBannedGroupMemberPush) GetOptName() string {
if x != nil {
return x.OptName
}
return ""
}

func (x *RemoveBannedGroupMemberPush) GetRemoveBannedUserId() int64 {
if x != nil {
return x.RemoveBannedUserId
}
return 0
}

func (x *RemoveBannedGroupMemberPush) GetRemoveBannedUserName() string {
if x != nil {
return x.RemoveBannedUserName
}
return ""
}

// 修改群组成员身份 PC_UPDATE_GROUP_MEMBER = 124
type UpdateMemberPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields

OptId int64 `protobuf:"varint,1,opt,name=opt_id,json=optId,proto3" json:"opt_id,omitempty"` // 操作人用户id
OptName string `protobuf:"bytes,2,opt,name=opt_name,json=optName,proto3" json:"opt_name,omitempty"` // 操作人昵称
UpdateUserId int64 `protobuf:"varint,3,opt,name=update_user_id,json=updateUserId,proto3" json:"update_user_id,omitempty"` // 被修改的成员id
UpdateUserName string `protobuf:"bytes,4,opt,name=update_user_name,json=updateUserName,proto3" json:"update_user_name,omitempty"` // 被修改的成员昵称
UpdateUserMemberType int32 `protobuf:"varint,5,opt,name=update_user_member_type,json=updateUserMemberType,proto3" json:"update_user_member_type,omitempty"` // 被修改的成员身份类型
}

func (x *UpdateMemberPush) Reset() {
*x = UpdateMemberPush{}
if protoimpl.UnsafeEnabled {
mi := &file_push_ext_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}

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

func (*UpdateMemberPush) ProtoMessage() {}

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

func (x *UpdateMemberPush) GetOptId() int64 {
if x != nil {
return x.OptId
}
return 0
}

func (x *UpdateMemberPush) GetOptName() string {
if x != nil {
return x.OptName
}
return ""
}

func (x *UpdateMemberPush) GetUpdateUserId() int64 {
if x != nil {
return x.UpdateUserId
}
return 0
}

func (x *UpdateMemberPush) GetUpdateUserName() string {
if x != nil {
return x.UpdateUserName
}
return ""
}

func (x *UpdateMemberPush) GetUpdateUserMemberType() int32 {
if x != nil {
return x.UpdateUserMemberType
}
return 0
}

var File_push_ext_proto protoreflect.FileDescriptor

var file_push_ext_proto_rawDesc = []byte{
0x0a, 0x0e, 0x70, 0x75, 0x73, 0x68, 0x2e, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x02, 0x70, 0x62, 0x1a, 0x0f, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69,
0x65, 0x6e, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e,
0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65,
0x6e, 0x64, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x12,
0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x22, 0x6c, 0x0a, 0x12, 0x41, 0x67, 0x72, 0x65, 0x65, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69,
0x65, 0x6e, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e,
0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65,
0x6e, 0x64, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x22,
0x8a, 0x02, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50,
0x75, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x70, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70,
0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70,
0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x5f, 0x61, 0x76, 0x61,
0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f,
0x70, 0x74, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x22,
0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x14, 0x69, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e,
0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08,
0x52, 0x14, 0x69, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x74, 0x72, 0x6f, 0x64,
0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18,
0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, 0x72, 0x0a, 0x13,
0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x50,
0x75, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x70, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70,
0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70,
0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x72, 0x6f, 0x75,
0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73,
0x22, 0x9d, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x70,
0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x70, 0x74, 0x49,
0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0f,
0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, 0x73,
0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f,
0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
0x22, 0x99, 0x01, 0x0a, 0x15, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x70,
0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x70, 0x74, 0x49,
0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e,
0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03,
0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72,
0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65,
0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x62, 0x61,
0x6e, 0x6e, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xb9, 0x01, 0x0a,
0x1b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06,
0x6f, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x70,
0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x31,
0x0a, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f,
0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x72,
0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49,
0x64, 0x12, 0x35, 0x0a, 0x17, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x6e, 0x6e,
0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x14, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64,
0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xcb, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x15, 0x0a,
0x06, 0x6f, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f,
0x70, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x24, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55,
0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x35, 0x0a, 0x17, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d,
0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05,
0x52, 0x14, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62,
0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x2a, 0xf0, 0x01, 0x0a, 0x08, 0x50, 0x75, 0x73, 0x68, 0x43,
0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x43, 0x5f, 0x41, 0x44, 0x44, 0x5f, 0x44, 0x45,
0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x43, 0x5f, 0x41, 0x44,
0x44, 0x5f, 0x46, 0x52, 0x49, 0x45, 0x4e, 0x44, 0x10, 0x64, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x43,
0x5f, 0x41, 0x47, 0x52, 0x45, 0x45, 0x5f, 0x41, 0x44, 0x44, 0x5f, 0x46, 0x52, 0x49, 0x45, 0x4e,
0x44, 0x10, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x50, 0x43, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45,
0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x6e, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x43, 0x5f, 0x41,
0x44, 0x44, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x53,
0x10, 0x78, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x43, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f,
0x47, 0x52, 0x4f, 0x55, 0x50, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x79, 0x12, 0x1a,
0x0a, 0x16, 0x50, 0x43, 0x5f, 0x42, 0x41, 0x4e, 0x4e, 0x45, 0x44, 0x5f, 0x47, 0x52, 0x4f, 0x55,
0x50, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x7a, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x43,
0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x42, 0x41, 0x4e, 0x4e, 0x45, 0x44, 0x5f, 0x47,
0x52, 0x4f, 0x55, 0x50, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x7b, 0x12, 0x1a, 0x0a,
0x16, 0x50, 0x43, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50,
0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x7c, 0x42, 0x0d, 0x5a, 0x0b, 0x67, 0x69, 0x6d,
0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
file_push_ext_proto_rawDescOnce sync.Once
file_push_ext_proto_rawDescData = file_push_ext_proto_rawDesc
)

func file_push_ext_proto_rawDescGZIP() []byte {
file_push_ext_proto_rawDescOnce.Do(func() {
file_push_ext_proto_rawDescData = protoimpl.X.CompressGZIP(file_push_ext_proto_rawDescData)
})
return file_push_ext_proto_rawDescData
}

var file_push_ext_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_push_ext_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_push_ext_proto_goTypes = []interface{}{
(PushCode)(0), // 0: pb.PushCode
(*AddFriendPush)(nil), // 1: pb.AddFriendPush
(*AgreeAddFriendPush)(nil), // 2: pb.AgreeAddFriendPush
(*UpdateGroupPush)(nil), // 3: pb.UpdateGroupPush
(*AddGroupMembersPush)(nil), // 4: pb.AddGroupMembersPush
(*RemoveGroupMemberPush)(nil), // 5: pb.RemoveGroupMemberPush
(*BannedGroupMemberPush)(nil), // 6: pb.BannedGroupMemberPush
(*RemoveBannedGroupMemberPush)(nil), // 7: pb.RemoveBannedGroupMemberPush
(*UpdateMemberPush)(nil), // 8: pb.UpdateMemberPush
(*GroupMember)(nil), // 9: pb.GroupMember
}
var file_push_ext_proto_depIdxs = []int32{
9, // 0: pb.AddGroupMembersPush.members:type_name -> pb.GroupMember
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}

func init() { file_push_ext_proto_init() }
func file_push_ext_proto_init() {
if File_push_ext_proto != nil {
return
}
file_logic_ext_proto_init()
if !protoimpl.UnsafeEnabled {
file_push_ext_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddFriendPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_push_ext_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AgreeAddFriendPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_push_ext_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateGroupPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_push_ext_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddGroupMembersPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_push_ext_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RemoveGroupMemberPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_push_ext_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BannedGroupMemberPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_push_ext_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RemoveBannedGroupMemberPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_push_ext_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateMemberPush); 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_push_ext_proto_rawDesc,
NumEnums: 1,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_push_ext_proto_goTypes,
DependencyIndexes: file_push_ext_proto_depIdxs,
EnumInfos: file_push_ext_proto_enumTypes,
MessageInfos: file_push_ext_proto_msgTypes,
}.Build()
File_push_ext_proto = out.File
file_push_ext_proto_rawDesc = nil
file_push_ext_proto_goTypes = nil
file_push_ext_proto_depIdxs = nil
}

+ 169
- 0
app/pkg/proto/business.ext.proto View File

@@ -0,0 +1,169 @@
syntax = "proto3";
package pb;
option go_package = "egg-im/pkg/pb/";

import "common.ext.proto";

service BusinessExt {
// 登录
rpc SignIn (SignInReq) returns (SignInResp);
// 获取用户信息
rpc GetUser (GetUserReq) returns (GetUserResp);
// 更新用户信息
rpc UpdateUser (UpdateUserReq) returns (Empty);
// 搜索用户(这里简单数据库实现,生产环境建议使用ES)
rpc SearchUser (SearchUserReq) returns (SearchUserResp);
// 上传文件至云端
rpc CloudUploadFile (CloudUploadFileReq) returns (CloudUploadFileResp);
// 获取表情
rpc EmoticonList (Empty) returns (EmoticonListResp);
// 判断是否为好友关系
rpc IsFriends (IsFriendsReq) returns (IsFriendsResp);
// 投诉群
rpc ComplainGroup (ComplainGroupReq) returns (Empty);
// 发布群公告
rpc PublishGroupNotice (PublishGroupNoticeReq) returns (Empty);
// 查看群公告
rpc ViewGroupNotice (ViewGroupNoticeReq) returns (ViewGroupNoticeResp);
// 点赞群公告
rpc LikeGroupNotice (LikeGroupNoticeReq) returns (Empty);
// 取消点赞群公告
rpc CancelLikeGroupNotice (CancelLikeGroupNoticeReq) returns (Empty);
}

message LikeGroupNoticeReq {
int64 group_id = 1;
}

message CancelLikeGroupNoticeReq {
int64 group_id = 1;
}

message ViewGroupNoticeReq {
int64 group_id = 1;
}

message ViewGroupNoticeResp {
int64 group_id = 1;
int64 user_id = 2; //发布用户id
string content = 3; //公告内容
int64 like_nums = 4; //点赞数量
int64 read_nums = 5; //阅读数量
GroupNoticePublishType publish_type = 6; // 发布方式
string publish_time = 7; // 发布时间
bool is_like = 8; // 是否点赞
}

message PublishGroupNoticeReq {
int64 group_id = 1;
int64 user_id = 2; //发布用户id
GroupNoticePublishType publish_type = 3; // 发布方式
string content = 4; // 发布内容
}

message ComplainGroupReq {
int64 group_id = 1;
ComplainType complain_type = 2; // 投诉类型
string text = 3; // 投诉内容
repeated string image_list = 4; // 图片
}

// 投诉类型
enum ComplainType {
CT_UNKNOWN = 0; // 未知
CT_GAMBLE = 1; // 存在赌博行为
MT_DEFRAUD = 2; // 存在骗钱行为
MT_HARASS = 3; // 不当信息骚扰
MT_RUMOUR = 4; // 传播谣言
MT_COUNTERFEIT_GOODS_INFO = 5; // 发布假冒商品信息
MT_VIOLATION_OF_MINORS = 6; // 侵犯未成年人权益
MT_OTHER = 7; // 其他
}

// 群公告发布方式
enum GroupNoticePublishType {
UNKNOWN_PUBLISH = 0; // 未知
ONLY_PUBLISH = 1; // 仅发布
PUBLISH_AND_NOTICE = 2; // 发布并通知
NOTICE_AND_TOP_UP = 3; // 存在骗钱行为
}


message IsFriendsReq {
string user_phone = 1;
string friend_phone = 2;
}

message IsFriendsResp {
int64 is_friend = 1;
User user = 2; // 用户信息
}

message Emoticon {
string name = 1; // 名称
string img_url = 2; // 图片地址
string memo = 3; // 备注
int32 sort = 4; // 排序
}
message EmoticonListResp {
repeated Emoticon emoticons = 1;
}
message SignInReq {
string phone_number = 1; // 手机号
string code = 2; // 验证码
int64 device_id = 3; // 设备id
string push_alia = 4; // 极光推送-别名
string nickname = 5; // 昵称
string avatar_url = 6; // 头像地址
}
message SignInResp {
bool is_new = 1; // 是否是新用户
int64 user_id = 2; // 用户id
string token = 3; // token
}
message CloudUploadFileReq {
string dir = 1; // 目录名
string file_name = 2; // 上传原文件名称
string file_size = 3; // 文件大小
}
message CloudUploadFileResp {
string method = 1; // 请求方式
string host = 2; // 域名
string key = 3; // key
string token = 4; // token
}

message User {
int64 user_id = 1; // 用户id
string nickname = 2; // 昵称
int32 sex = 3; // 性别
string avatar_url = 4; // 头像地址
string extra = 5; // 附加字段
int64 create_time = 6; // 创建时间
int64 update_time = 7; // 更新时间
int64 is_auto_added_friends = 8; // 是否自动被添加好友
string phone_number = 9; // 手机号
}

message GetUserReq {
int64 user_id = 1; // 用户id
string phone = 2; // 用户手机号
}
message GetUserResp {
User user = 1; // 用户信息
}

message UpdateUserReq {
string nickname = 1; // 昵称
int32 sex = 2; // 性别
string avatar_url = 3; // 头像地址
string extra = 4; // 附加字段
}

message SearchUserReq{
string key = 1;
}
message SearchUserResp{
repeated User users = 1;
}


+ 28
- 0
app/pkg/proto/business.int.proto View File

@@ -0,0 +1,28 @@
syntax = "proto3";
package pb;
option go_package = "egg-im/pkg/pb/";

import "common.ext.proto";
import "business.ext.proto";

service BusinessInt {
// 权限校验
rpc Auth (AuthReq) returns (Empty);
// 批量获取用户信息
rpc GetUser (GetUserReq) returns (GetUserResp);
// 批量获取用户信息
rpc GetUsers (GetUsersReq) returns (GetUsersResp);
}

message AuthReq {
int64 user_id = 1;
int64 device_id = 2;
string token = 3;
}

message GetUsersReq {
map<int64, int32> user_ids = 1; // 用户id
}
message GetUsersResp {
map<int64, User> users = 1; // 用户信息
}

+ 5
- 0
app/pkg/proto/common.ext.proto View File

@@ -0,0 +1,5 @@
syntax = "proto3";
package pb;
option go_package = "egg-im/pkg/pb/";

message Empty{}

+ 236
- 0
app/pkg/proto/connect.ext.proto View File

@@ -0,0 +1,236 @@
syntax = "proto3";
package pb;
option go_package = "egg-im/pkg/pb/";

enum PackageType {
PT_UNKNOWN = 0; // 未知
PT_SIGN_IN = 1; // 设备登录请求
PT_SYNC = 2; // 消息同步触发
PT_HEARTBEAT = 3; // 心跳
PT_MESSAGE = 4; // 消息投递
PT_SUBSCRIBE_ROOM = 5; // 订阅房间
}

/************************************消息体定义开始************************************/
// 单条消息投递内容(估算大约100个字节),todo 通知栏提醒
message Message {
Sender sender = 1; // 发送者
ReceiverType receiver_type = 2; // 接收者类型,1:user;2:group
int64 receiver_id = 3; // 用户id或者群组id
repeated int64 to_user_ids = 4; // 需要@的用户id列表
MessageType message_type = 5; // 消息类型
bytes message_content = 6; // 消息内容
int64 seq = 7; // 用户消息发送序列号
int64 send_time = 8; // 消息发送时间戳,精确到毫秒
MessageStatus status = 9; // 消息状态
}

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 extra = 6; // 扩展字段
}

// 消息类型
enum MessageType {
MT_UNKNOWN = 0; // 未知
MT_TEXT = 1; // 文本
MT_FACE = 2; // 表情
MT_VOICE = 3; // 语音消息
MT_IMAGE = 4; // 图片
MT_FILE = 5; // 文件
MT_LOCATION = 6; // 地理位置
MT_COMMAND = 7; // 指令推送
MT_CUSTOM = 8; // 自定义
MT_RECALL = 9; // 撤回消息
MT_RED_PACKAGE = 10; // 红包消息
}

// 红包类型
enum RedPacketType {
RPT_UNKNOWN = 0; // 未知
RPT_FRIEND = 1; // 好友红包
RPT_GROUP_NORMAL = 2; // 群组普通红包
RPT_GROUP_LUCK = 3; // 群组手气红包
RPT_GROUP_SPECIALLY = 4; // 群组专属红包
RPT_SYSTEM_FOR = 5; // 系统红包
}

// 红包消息类型
enum RedPacketMessageType {
RMT_UNKNOWN = 0; // 未知
RMT_SEND = 1; // 发红包
RMT_GRAB = 2; // 抢红包
}

// 红包状态类型
enum RedPacketStatusType {
RPS_NOT_DRAW = 0; // 未领取
RPS_DRAWING = 1; // 领取中
RPS_DRAW_OVER = 2; // 领取完
RPS_EXPIRE = 3; //已过期
}

// 文本消息
message Text {
string text = 1; // 文本消息内容
}

// 表情消息
message Face {
int64 face_id = 1;
string face_url = 2;
}

// 语音消息
message Voice {
string id = 1; // 语音包id
int32 size = 2; // 语音包大小
int32 duration = 3; // 语音时长
string url = 4; // 语音文件URL
}

// 图片消息
message Image {
string id = 1; // 图片id
int32 width = 2; // 图片宽度
int32 height = 3; // 图片长度
string url = 4; // 图片URL
string thumbnail_url = 5; // 图片缩略图url
}

// 文件消息
message File {
int64 id = 12; // 文件id
string name = 13; // 文件名
int64 size = 14; // 文件大小
string url = 15; // 文件url
int32 width = 16; // 文件宽度
int32 height = 17; // 文件长度
string thumbnail_url = 18; // 文件缩略图url
}

// 地理位置消息
message Location {
string desc = 1; // 描述
double latitude = 2; // 经度
double longitude = 3; // 纬度
}

// Command 指令推送,1000以下,IM内部用,1000以上,留给业务用
message Command {
int32 code = 1; // 指令码
bytes data = 2; // 数据内容
}

// 自定义消息
message Custom {
string data = 1; // 自定义数据
}

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


// 红包消息
message RED_PACKAGE {
RedPacketMessageType red_message_type = 1;// 红包消息类型
RedPacketType red_packet_type = 2; // 红包类型
string red_packet_content = 3; // 红包文字内容
float red_packet_amount = 6; // 红包金额
int32 red_packet_nums = 5; // 红包数量
float red_packet_balance_amount = 7; // 红包余额
int64 received_user_id = 8; // 领取用户id
float received_user_amount = 9; // 领取用户金额
string received_user_nickname = 10; // 领取用户昵称
RedPacketStatusType red_packet_status_type = 11; // 领取状态
int64 red_packet_id = 12; // 红包id
int64 send_red_packet_uid = 13; // 红包发送者uid
string send_red_packet_nickname = 14; // 红包发送者昵称
string send_red_packet_avatar_url = 15; // 红包发送者头像
string red_packet_small_content = 16; // 红包小文字内容
string red_packet_cover = 17; // 红包封面
}

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

// 上行数据
message Input {
PackageType type = 1; // 包的类型
int64 request_id = 2; // 请求id
bytes data = 3; // 数据
}

// 下行数据
message Output {
PackageType type = 1; // 包的类型
int64 request_id = 2; // 请求id
int32 code = 3; // 错误码
string message = 4; // 错误信息
bytes data = 5; // 数据
}

// 设备登录,package_type:1
message SignInInput {
int64 device_id = 1; // 设备id
int64 user_id = 2; // 用户id
string token = 3; // 秘钥
}

// 消息同步请求,package_type:2
message SyncInput {
int64 seq = 1; // 客户端已经同步的序列号
}
// 消息同步响应,package_type:2
message SyncOutput {
repeated Message messages = 1; // 消息列表
bool has_more = 2; // 是否有更多数据
}

// 订阅房间请求
message SubscribeRoomInput {
int64 room_id = 1; // 房间ID,如果为0,取消房间订阅
int64 seq = 2; // 消息消息序列号,
}

enum ReceiverType {
RT_UNKNOWN = 0; // 未知
RT_USER = 1; // 用户
RT_GROUP = 2; // 群组
RT_ROOM = 3; // 房间
}

// 消息投递,package_type:4
message MessageSend {
Message message = 1; // 消息
}

enum SenderType {
ST_UNKNOWN = 0; // 未知的
ST_SYSTEM = 1; // IM系统
ST_USER = 2; // 用户
ST_BUSINESS = 3; // 业务方
}

enum MessageStatus {
MS_UNKNOWN = 0; // 未知的
MS_NORMAL = 1; // 正常的
MS_RECALL = 2; // 撤回
}

// 投递消息回执,package_type:4
message MessageACK {
int64 device_ack = 2; // 设备收到消息的确认号
int64 receive_time = 3; // 消息接收时间戳,精确到毫秒
}

// 群组用户状态
enum GroupUserStatusType {
GROUP_USER_STATUS_NORMAL = 0; // 正常
GROUP_USER_STATUS_Banned = 1; // 禁言
}

+ 28
- 0
app/pkg/proto/connect.int.proto View File

@@ -0,0 +1,28 @@
syntax = "proto3";
package pb;
option go_package = "egg-im/pkg/pb/";

import "common.ext.proto";
import "connect.ext.proto";

service ConnectInt {
// 消息投递
rpc DeliverMessage (DeliverMessageReq) returns (Empty);
}

message DeliverMessageReq {
int64 device_id = 1; // 设备id
MessageSend message_send = 2; // 数据
}

// 房间推送
message PushRoomMsg{
int64 room_id = 1; // 设备id
MessageSend message_send = 2; // 数据
}

// 房间推送
message PushAllMsg{
MessageSend message_send = 2; // 数据
}


+ 303
- 0
app/pkg/proto/logic.ext.proto View File

@@ -0,0 +1,303 @@
syntax = "proto3";
package pb;
option go_package = "egg-im/pkg/pb/";

import "business.ext.proto";
import "common.ext.proto";
import "connect.ext.proto";

service LogicExt {
// 注册设备
rpc RegisterDevice (RegisterDeviceReq) returns (RegisterDeviceResp);

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

// 发送红包
rpc SendRedPacket (SendRedPacketReq) returns (SendRedPacketResp);

// 添加好友
rpc AddFriend (AddFriendReq) returns (Empty);
// 同意添加好友
rpc AgreeAddFriend (AgreeAddFriendReq) returns (Empty);
// 删除好友
rpc DeleteFriend (DeleteFriendReq) returns (Empty);
// 设置好友信息
rpc SetFriend (SetFriendReq) returns (SetFriendResp);
// 获取好友列表
rpc GetFriends (Empty) returns (GetFriendsResp);

// 创建群组
rpc CreateGroup (CreateGroupReq) returns (CreateGroupResp);
// 更新群组
rpc UpdateGroup (UpdateGroupReq) returns (Empty);
// 获取群组信息
rpc GetGroup (GetGroupReq) returns (GetGroupResp);
// 获取用户加入的所有群组
rpc GetGroups (Empty) returns (GetGroupsResp);

// 添加群组成员
rpc AddGroupMembers (AddGroupMembersReq) returns (AddGroupMembersResp);
// 更新群组成员信息
rpc UpdateGroupMember (UpdateGroupMemberReq) returns (Empty);
// 删除群组成员
rpc DeleteGroupMember (DeleteGroupMemberReq) returns (Empty);
// 获取群组成员
rpc GetGroupMembers (GetGroupMembersReq) returns (GetGroupMembersResp);
// 设置禁言
rpc SetGroupBannedMembers (SetGroupMemberBannedReq) returns (SetGroupMemberBannedResp);
// 取消禁言
rpc SetGroupRemoveBannedMembers (SetGroupMemberRemoveBannedReq) returns (Empty);
// 获取群组禁言成员
rpc GetGroupBannedMembers (GetGroupBannedMembersReq) returns (GetGroupBannedMembersResp);
// 设置是否加好友
rpc SetGroupAddFriend (SetGroupAddFriendReq) returns (Empty);
}

message RegisterDeviceReq {
int32 type = 2; // 设备类型
string brand = 3; // 厂商
string model = 4; // 机型
string system_version = 5; // 系统版本
string sdk_version = 6; // sdk版本号
}
message RegisterDeviceResp {
int64 device_id = 1; // 设备id
}

message SendMessageReq {
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 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 SendRedPacketReq {
ReceiverType receiver_type = 1; // 接收者类型,1:user;2:group
int64 receiver_id = 2; // 用户id或者群组id
MessageType message_type = 3; // 消息类型
bytes message_content = 4; // 消息内容
int64 send_time = 5; // 消息发送时间戳,精确到毫秒
repeated int64 to_user_ids = 6; // 红包给到哪些用户(专属红包)
string message_content_back = 7;
}
message SendRedPacketResp {
int64 seq = 1; // 消息序列号
}

message PushRoomReq{
int64 room_id = 1; // 房间id
MessageType message_type = 2; // 消息类型
bytes message_content = 3; // 消息内容
int64 send_time = 4; // 消息发送时间戳,精确到毫秒
bool is_persist = 5; // 是否将消息持久化
bool is_priority = 6; // 是否优先推送
}

message AddFriendReq {
int64 friend_id = 1; // 用户id
string remarks = 2; // 备注
string description = 3; // 描述
}

message DeleteFriendReq {
int64 user_id = 1; // 用户id
}


message AgreeAddFriendReq {
int64 user_id = 1; // 用户id
string remarks = 2; // 备注
}

message SetFriendReq {
int64 friend_id = 1; // 好友id
string remarks = 2; // 备注
string extra = 8; // 附加字段
}
message SetFriendResp {
int64 friend_id = 1; // 好友id
string remarks = 2; // 备注
string extra = 8; // 附加字段
}

message Friend {
int64 user_id = 1; // 用户id
string phone_number = 2; // 电话号码
string nickname = 3; // 昵称
int32 sex = 4; // 性别
string avatar_url = 5; // 头像地址
string user_extra = 6; // 用户附加字段
string remarks = 7; // 备注
string extra = 8; // 附加字段
}
message GetFriendsResp {
repeated Friend friends = 1;
}

message CreateGroupReq {
string name = 1; // 名称
string avatar_url = 2; // 头像
string introduction = 3; // 简介
string extra = 4; // 附加字段
repeated int64 member_ids = 5; // 群组成员ID列表
}
message CreateGroupResp {
int64 group_id = 1; // 群组id
}

message UpdateGroupReq {
int64 group_id = 1; // 群组id
string avatar_url = 2; // 头像
string name = 3; // 名称
string introduction = 4; // 简介
string extra = 5; // 附加字段
}

message GetGroupReq {
int64 group_id = 1;
}
message GetGroupResp {
Group group = 1;
MemberType member_type = 2;
GroupUserStatusType group_user_status_type = 3;
GroupNotice group_notice = 4; //群公告
}

message GroupNotice {
string content = 1; //公告内容
GroupNoticePublishType publish_type = 2; // 发布方式
string publish_time = 3; // 发布时间
}


message Group {
int64 group_id = 1; // 群组id
string name = 2; // 名称
string avatar_url = 3; // 头像
string introduction = 4; // 简介
int32 user_mum = 5; // 用户数
int32 is_all_member_banned = 6; // 是否全员禁言(1:是 2:否)
int32 is_all_add_friend = 10; // 是否允许加好友(1:是 2:否)
string extra = 7; // 附加字段
int64 create_time = 8; // 创建时间
int64 update_time = 9; // 更新时间
}

message GetGroupsResp {
repeated Group groups = 1;
}

message AddGroupMembersReq {
int64 group_id = 1; // 群组id
repeated int64 user_ids = 2; // 用户id列表
}
message AddGroupMembersResp {
repeated int64 user_ids = 1; // 已经在群组的用户id列表
}

enum MemberType {
GMT_UNKNOWN = 0; // 未知
GMT_ADMIN = 1; // 群主
GMT_MEMBER = 2; // 成员
GMT_MANAGE = 3; // 管理员
}

message UpdateGroupMemberReq {
int64 group_id = 1; // 群组id
int64 user_id = 2; // 用户id
MemberType member_type = 3; // 成员类型
string remarks = 4; // 备注
string extra = 5; // 附加字段
}

message DeleteGroupMemberReq {
int64 group_id = 1; // 群组id
int64 user_id = 2; // 用户id
}

message GetGroupMembersReq {
int64 group_id = 1;
int64 limit = 2;
}
message GetGroupMembersResp {
repeated GroupMember members = 1;
}
message GroupMember {
int64 user_id = 1;
string nickname = 2; // 昵称
int32 sex = 3; // 性别
string avatar_url = 4; // 头像地址
string user_extra = 5; // 用户附加字段
MemberType member_type = 6; // 成员类型
string remarks = 7; // 备注
string extra = 8; // 群组成员附加字段
int32 status = 9; // 状态
}

message SetGroupMemberBannedReq {
int64 group_id = 1; // 群组id
repeated int64 user_ids = 2; // 用户id列表
AllMemberBannedType is_all_member_banned = 3; // 全员禁言(1:是 2:否)
}

message SetGroupMemberRemoveBannedReq {
int64 group_id = 1; // 群组id
repeated int64 remove_user_ids = 2; // 解除用户id列表
}

enum AllMemberBannedType {
UNKNOWN_All_Member_Banned = 0; // 未知
YES_All_Member_Banned = 1; // 是-全员禁言
NOT_All_Member_Banned = 2; // 否-全员禁言
}

message SetGroupMemberBannedResp {
AllMemberBannedType is_all_member_banned = 3; // 全员禁言(1:是 2:否)
repeated GroupMember members = 1; //禁言人员列表
}

message GetGroupBannedMembersReq {
int64 group_id = 1;
}

message GetGroupBannedMembersResp {
repeated GroupMember members = 1;
}

enum AllAddFriendType {
UNKNOWN_All_Add_Friend = 0; // 未知
YES_All_Add_Friend = 1; // 是-允许加好友
NOT_All_Add_Friend = 2; // 否-禁止加好友
}
message SetGroupAddFriendReq {
int64 group_id = 1; // 群组id
AllAddFriendType is_all_add_friend = 2; // 是否允许加好友(1:是 2:否)
}


+ 102
- 0
app/pkg/proto/logic.int.proto View File

@@ -0,0 +1,102 @@
syntax = "proto3";
package pb;
option go_package = "egg-im/pkg/pb/";

import "common.ext.proto";
import "connect.ext.proto";
import "logic.ext.proto";

service LogicInt {
// 登录
rpc ConnSignIn (ConnSignInReq) returns (Empty);
// 消息同步
rpc Sync (SyncReq) returns (SyncResp);
// 设备收到消息回执
rpc MessageACK (MessageACKReq) returns (Empty);
// 设备离线
rpc Offline (OfflineReq) returns (Empty);
// 订阅房间
rpc SubscribeRoom(SubscribeRoomReq)returns(Empty);
// 发送消息
rpc SendMessage (SendMessageReq) returns (SendMessageResp);
// 推送消息到房间
rpc PushRoom(PushRoomReq)returns(Empty);
// 全服推送
rpc PushAll(PushAllReq)returns(Empty);

// 获取设备信息
rpc GetDevice (GetDeviceReq) returns (GetDeviceResp);
// 服务停止
rpc ServerStop (ServerStopReq) returns (Empty);
}

message ConnSignInReq {
int64 device_id = 1; // 设备id
int64 user_id = 2; // 用户id
string token = 3; // 秘钥
string conn_addr = 4; // 服务器地址
string client_addr = 5; // 客户端地址
}

message SyncReq {
int64 user_id = 1; // 用户id
int64 device_id = 2; // 设备id
int64 seq = 3; // 客户端已经同步的序列号
}
message SyncResp {
repeated Message messages = 1; // 消息列表
bool has_more = 2; // 是否有更多数据
}

message MessageACKReq {
int64 user_id = 1; // 用户id
int64 device_id = 2; // 设备id
int64 device_ack = 3; // 设备收到消息的确认号
int64 receive_time = 4; // 消息接收时间戳,精确到毫秒
}

message OfflineReq {
int64 user_id = 1; // 用户id
int64 device_id = 2; // 设备id
string client_addr = 3; // 客户端地址
}

message SubscribeRoomReq{
int64 user_id = 1; // 用户id
int64 device_id = 2; // 设备id
int64 room_id = 3; // 房间id
int64 seq = 4; // 消息序列号
string conn_addr = 5; // 服务器地址
}

message PushAllReq{
MessageType message_type = 1; // 消息类型
bytes message_content = 2; // 消息内容
int64 send_time = 3; // 消息发送时间戳,精确到毫秒
}

message GetDeviceReq {
int64 device_id = 1;
}
message GetDeviceResp {
Device device = 1;
}

message Device {
int64 device_id = 1; // 设备id
int64 user_id = 2; // 用户id
int32 type = 3; // 设备类型,1:Android;2:IOS;3:Windows; 4:MacOS;5:Web
string brand = 4; // 手机厂商
string model = 5; // 机型
string system_version = 6; // 系统版本
string sdk_version = 7; // SDK版本
int32 status = 8; // 在线状态,0:不在线;1:在线
string conn_addr = 9; // 服务端连接地址
string client_addr = 10; // 客户端地址
int64 create_time = 11; // 创建时间
int64 update_time = 12; // 更新时间
}

message ServerStopReq {
string conn_addr = 1;
}

+ 95
- 0
app/pkg/proto/push.ext.proto View File

@@ -0,0 +1,95 @@
syntax = "proto3";
package pb;
option go_package = "egg-im/pkg/pb/";

import "logic.ext.proto";

enum PushCode {
PC_ADD_DEFAULT = 0;

PC_ADD_FRIEND = 100; // 添加好友请求

PC_AGREE_ADD_FRIEND = 101; // 同意添加好友

PC_UPDATE_GROUP = 110; // 更新群组

PC_ADD_GROUP_MEMBERS = 120; // 添加群组成员

PC_REMOVE_GROUP_MEMBER = 121; // 移除群组成员

PC_BANNED_GROUP_MEMBER = 122; // 禁言群组成员

PC_REMOVE_BANNED_GROUP_MEMBER = 123; // 取消禁言群组成员

PC_UPDATE_GROUP_MEMBER = 124; // 更新群组成员信息

}

// 推送码 PC_ADD_FRIEND = 100
message AddFriendPush {
int64 friend_id = 1; // 好友id
string nickname = 2; // 昵称
string avatar_url = 3; // 头像
string description = 4; // 描述
}

// 推送码 PC_AGREE_ADD_FRIEND = 101
message AgreeAddFriendPush {
int64 friend_id = 1; // 好友id
string nickname = 2; // 昵称
string avatar_url = 3; // 头像
}

// 更新群组 PC_UPDATE_GROUP = 110
message UpdateGroupPush {
int64 opt_id = 1; // 操作人用户id
string opt_name = 2; // 操作人昵称
string opt_avatar_url = 3; // 操作人头像
string name = 4; // 群组名称
string avatar_url = 5; // 群组头像
string introduction = 6; // 群组简介
bool isUpdateIntroduction = 7; // 是否更新群组简介
string extra = 8; // 附加字段
}

// 添加群组成员 PC_AGREE_ADD_GROUPS = 120
message AddGroupMembersPush {
int64 opt_id = 1; // 操作人用户id
string opt_name = 2; // 操作人昵称
repeated GroupMember members = 3; // 群组成员
}

// 删除群组成员 PC_REMOVE_GROUP_MEMBER = 121
message RemoveGroupMemberPush {
int64 opt_id = 1; // 操作人用户id
string opt_name = 2; // 操作人昵称
int64 deleted_user_id = 3; // 被删除的成员id
string deleted_user_name = 4; // 被删除的成员昵称
}

// 禁言群组成员 PC_BANNED_GROUP_MEMBER = 122
message BannedGroupMemberPush {
int64 opt_id = 1; // 操作人用户id
string opt_name = 2; // 操作人昵称
int64 banned_user_id = 3; // 被禁言的成员id
string banned_user_name = 4; // 被禁言的成员昵称
}


// 取消禁言群组成员 PC_REMOVE_BANNED_GROUP_MEMBER = 123
message RemoveBannedGroupMemberPush {
int64 opt_id = 1; // 操作人用户id
string opt_name = 2; // 操作人昵称
int64 remove_banned_user_id = 3; // 被解禁言的成员id
string remove_banned_user_name = 4; // 被解禁言的成员昵称
}

// 修改群组成员身份 PC_UPDATE_GROUP_MEMBER = 124
message UpdateMemberPush {
int64 opt_id = 1; // 操作人用户id
string opt_name = 2; // 操作人昵称
int64 update_user_id = 3; // 被修改的成员id
string update_user_name = 4; // 被修改的成员昵称
int32 update_user_member_type = 5; // 被修改的成员身份类型
}


+ 383
- 0
app/svc/im/svc_send_message.go View File

@@ -0,0 +1,383 @@
package svc

import (
"applet/app/db"
"applet/app/db/im/model"
md "applet/app/md/im"
"applet/app/pkg/pb"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement"
model2 "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md"
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit"
"fmt"
"math"
"strings"
"time"
)

func BatchSendGroupMessage(req *md.BatchSendGroupMessageReq) error {
now := time.Now()
record := model2.ImGroupBatchSendMessageRecords{
SendKind: req.SendKind,
Kind: req.Kind,
Content: req.Content,
SendTime: now.Format("2006-01-02 15:04:05"),
State: 1,
SendCondition: req.SendCondition,
NotCondition: req.NotCondition,
CreateTime: now.Format("2006-01-02 15:04:05"),
UpdateTime: now.Format("2006-01-02 15:04:05"),
}

recordsDb := implement.NewImGroupBatchSendMessageRecordsDb(db.Db)
recordID, err := recordsDb.ImGroupBatchSendMessageRecordsInsert(&record)
if err != nil {
return err
}
go DealGroupMessage(recordID, req)
return nil
}

func BatchSendUserMessage(req *md.BatchSendUserMessageReq) error {
now := time.Now()
record := model2.ImUserBatchSendMessageRecords{
SendKind: req.SendKind,
Kind: req.Kind,
Content: req.Content,
SendTime: now.Format("2006-01-02 15:04:05"),
State: 1,
SendCondition: req.SendCondition,
NotCondition: req.NotCondition,
CreateTime: now.Format("2006-01-02 15:04:05"),
UpdateTime: now.Format("2006-01-02 15:04:05"),
}

recordsDb := implement.NewImUserBatchSendMessageRecordsDb(db.Db)
recordID, err := recordsDb.ImUserBatchSendMessageRecordsInsert(&record)
if err != nil {
return err
}
go DealUserMessage(recordID, req)
return nil
}

func DealGroupMessage(recordID int, req *md.BatchSendGroupMessageReq) {
var groupIDs []string
var err error
recordsDb := implement.NewImGroupBatchSendMessageRecordsDb(db.Db)
ch, err := rabbit.Cfg.Pool.GetChannel()
if err != nil {
BatchSendGroupMessageSetFailed(recordID)
return
}
defer ch.Release()
if req.SendKind == 2 {
// 1.发送给所有群聊
page := 1
limit := 100

for {
var groupWithOwners []model.GroupWithOwner
// 1.1 分批查询所有群聊ID 和 群主 ID
err = db.DbIm.Table("group").
Join("INNER", "group_user", "group.id = group_user.group_id").
Where("group_user.member_type = 1").
Limit(limit, (page-1)*limit).
Find(&groupWithOwners)
if err != nil {
fmt.Println("DealGroupMessage_ERR:::::", err.Error())
BatchSendGroupMessageSetFailed(recordID)
return
}
for _, groupWithOwner := range groupWithOwners {
data := md2.IMEggEnergyStructForBatchSendMessageData{
ReceiverType: int(pb.ReceiverType_RT_GROUP),
MessageType: req.Kind,
SendId: groupWithOwner.OwnerID,
ReceiveIMId: groupWithOwner.GroupID,
Content: req.Content,
}
// 1.2 逐个推送到 mq
ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData)
// 1.3 记录推送的群ID
groupIDs = append(groupIDs, utils.Int64ToStr(groupWithOwner.GroupID))
}
if len(groupWithOwners) < limit {
break
}
page++
}
} else {
var sendCondition, notCondition []string
if req.SendCondition != "" {
sendCondition = strings.Split(req.SendCondition, ";")
}
if req.NotCondition != "" {
notCondition = strings.Split(req.NotCondition, ";")
}
// 1.1 去掉发送条件中存在的不发送条件中的内容
if len(notCondition) != 0 && len(sendCondition) != 0 {
sendCondition = utils.DiffArray(sendCondition, notCondition)
}
if len(sendCondition) != 0 {
var groupUsers []model.GroupUser
err = db.DbIm.Table("group_user").
In("group_id", sendCondition).
Where("member_type = 1").
Find(&groupUsers)
if err != nil {
fmt.Println("DealGroupMessage_ERR:::::", err.Error())
BatchSendGroupMessageSetFailed(recordID)
return
}
for _, groupUser := range groupUsers {
data := md2.IMEggEnergyStructForBatchSendMessageData{
ReceiverType: int(pb.ReceiverType_RT_GROUP),
MessageType: req.Kind,
SendId: groupUser.UserId,
ReceiveIMId: groupUser.GroupId,
Content: req.Content,
}
// 1.2 逐个推送到 mq
ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData)
groupIDs = sendCondition
}
} else if len(notCondition) != 0 && len(sendCondition) == 0 {
var groupUsers []model.GroupUser
err = db.DbIm.Table("group_user").
NotIn("group_id", sendCondition).
Where("member_type = 1").
Find(&groupUsers)
if err != nil {
fmt.Println("DealGroupMessage_ERR:::::", err.Error())
BatchSendGroupMessageSetFailed(recordID)
return
}
for _, groupUser := range groupUsers {
data := md2.IMEggEnergyStructForBatchSendMessageData{
ReceiverType: int(pb.ReceiverType_RT_GROUP),
MessageType: req.Kind,
SendId: groupUser.UserId,
ReceiveIMId: groupUser.GroupId,
Content: req.Content,
}
// 1.2 逐个推送到 mq
ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData)
// 1.3 记录推送的群ID
groupIDs = append(groupIDs, utils.Int64ToStr(groupUser.GroupId))
}
}
}
m := model2.ImGroupBatchSendMessageRecords{}
groupIDsStr := strings.Join(groupIDs, ";")
m.GroupId = groupIDsStr
_, err1 := recordsDb.ImGroupBatchSendMessageRecordsUpdate(recordID, &m, "group_id")
if err1 != nil {
fmt.Println("DealGroupMessage_ERR:::::", err1.Error())
return
}
}

func DealUserMessage(recordID int, req *md.BatchSendUserMessageReq) {
var userIDs []string
var userIMIDs []string
var err error
recordsDb := implement.NewImUserBatchSendMessageRecordsDb(db.Db)
userDb := implement.NewUserDb(db.Db)
ch, err := rabbit.Cfg.Pool.GetChannel()
if err != nil {
BatchSendGroupMessageSetFailed(recordID)
return
}
defer ch.Release()
if req.SendKind == 1 {
// 1. 发送给所有用户
page := 1
limit := 100
for {
var tempUserIds []string
var phoneIds []string
users, _, err := userDb.UserFindAndCount(0, "", "", 0, page, limit)
if err != nil {
fmt.Println("DealUserMessage_ERR:::::", err.Error())
BatchSendUserMessageSetFailed(recordID)
return
}
for _, user := range *users {
tempUserIds = append(tempUserIds, utils.Int64ToStr(user.Id))
phoneIds = append(phoneIds, user.Phone)
}
userIDs = append(userIDs, tempUserIds...)
var customerServiceWithUsers []model.CustomerServiceWithUser
err = db.DbIm.Table("user").
Join("INNER", "customer_service", "customer_service.id = user.customer_id").
In("phone", phoneIds).
Where("customer_service.state = 1").
Find(&customerServiceWithUsers)
if err != nil {
fmt.Println("DealUserMessage_ERR:::::", err.Error())
BatchSendUserMessageSetFailed(recordID)
return
}
for _, customerServiceWithUser := range customerServiceWithUsers {
data := md2.IMEggEnergyStructForBatchSendMessageData{
ReceiverType: int(pb.ReceiverType_RT_GROUP),
MessageType: req.Kind,
SendId: customerServiceWithUser.CustomerServiceUID,
ReceiveIMId: customerServiceWithUser.UserIMID,
Content: req.Content,
}
// 1.2 逐个推送到 mq
ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData)
// 1.3 记录推送的用户IM ID
userIMIDs = append(userIMIDs, utils.Int64ToStr(customerServiceWithUser.UserIMID))
}
if len(*users) < limit {
break
}
page++
}
} else {
// 2.发送给指定用户
var sendCondition, notCondition []string
if req.SendCondition != "" {
sendCondition = strings.Split(req.SendCondition, ";")
}
if req.NotCondition != "" {
notCondition = strings.Split(req.NotCondition, ";")
}
// 1.1 去掉发送条件中存在的不发送条件中的内容
if len(notCondition) != 0 && len(sendCondition) != 0 {
sendCondition = utils.DiffArray(sendCondition, notCondition)
}
if len(sendCondition) != 0 {
limit := 100
page := 1
conditionLen := len(sendCondition)
for {
tempPhoneList := sendCondition[limit*(page-1) : int(math.Min(float64(limit*page), float64(conditionLen)))]
var customerServiceWithUsers []model.CustomerServiceWithUser
err = db.DbIm.Table("user").
Join("INNER", "customer_service", "customer_service.id = user.customer_id").
In("phone", tempPhoneList).
Where("customer_service.state = 1").
Find(&customerServiceWithUsers)
if err != nil {
fmt.Println("DealUserMessage_ERR:::::", err.Error())
BatchSendUserMessageSetFailed(recordID)
return
}
for _, customerServiceWithUser := range customerServiceWithUsers {
data := md2.IMEggEnergyStructForBatchSendMessageData{
ReceiverType: int(pb.ReceiverType_RT_GROUP),
MessageType: req.Kind,
SendId: customerServiceWithUser.CustomerServiceUID,
ReceiveIMId: customerServiceWithUser.UserIMID,
Content: req.Content,
}
// 1.2 逐个推送到 mq
ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData)
// 1.3 记录推送的群ID
userIMIDs = append(userIMIDs, utils.Int64ToStr(customerServiceWithUser.UserIMID))
}
users, err := userDb.UserFindByParams(map[string]interface{}{
"key": "phone",
"value": tempPhoneList,
})
if err != nil {
fmt.Println("DealUserMessage_ERR:::::", err.Error())
BatchSendUserMessageSetFailed(recordID)
return
}
for _, user := range users {
userIDs = append(userIDs, utils.Int64ToStr(user.Id))
}
page++
if limit*(page-1) > conditionLen {
break
}
}

} else if len(notCondition) != 0 && len(sendCondition) == 0 {
page := 1
limit := 100
for {
var tempUserIds []string
var phoneIds []string
temp := map[string]interface{}{
"key": "phone",
"value": notCondition,
}
users, _, err := userDb.UserFindNotInByParamsByPage(page, limit, temp)
if err != nil {
fmt.Println("DealUserMessage_ERR:::::", err.Error())
BatchSendUserMessageSetFailed(recordID)
return
}
for _, user := range users {
tempUserIds = append(tempUserIds, utils.Int64ToStr(user.Id))
phoneIds = append(phoneIds, user.Phone)
}
userIDs = append(userIDs, tempUserIds...)
var customerServiceWithUsers []model.CustomerServiceWithUser
err = db.DbIm.Table("user").
Join("INNER", "customer_service", "customer_service.id = user.customer_id").
In("phone", phoneIds).
Where("customer_service.state = 1").
Find(&customerServiceWithUsers)
for _, customerServiceWithUser := range customerServiceWithUsers {
data := md2.IMEggEnergyStructForBatchSendMessageData{
ReceiverType: int(pb.ReceiverType_RT_GROUP),
MessageType: req.Kind,
SendId: customerServiceWithUser.CustomerServiceUID,
ReceiveIMId: customerServiceWithUser.UserIMID,
Content: req.Content,
}
// 1.2 逐个推送到 mq
ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData)
// 1.3 记录推送的用户IM ID
userIMIDs = append(userIMIDs, utils.Int64ToStr(customerServiceWithUser.UserIMID))
}
if len(users) < limit {
break
}
page++
}
}
}
m := model2.ImUserBatchSendMessageRecords{}
uIDStr := strings.Join(userIDs, ";")
m.Uid = uIDStr
userIMIdStr := strings.Join(userIMIDs, ";")
m.ImUid = userIMIdStr
_, err1 := recordsDb.ImUserBatchSendMessageRecordsUpdate(recordID, &m, "im_uid", "uid")
if err1 != nil {
fmt.Println("DealUserMessage_ERR:::::", err1.Error())
return
}
}

func BatchSendUserMessageSetFailed(recordID int) {
recordsDb := implement.NewImUserBatchSendMessageRecordsDb(db.Db)
m := model2.ImUserBatchSendMessageRecords{
State: 2,
}
_, err := recordsDb.ImUserBatchSendMessageRecordsUpdate(recordID, &m)
if err != nil {
fmt.Println("DealUserMessage_ERR:::::", err.Error())
return
}
}

func BatchSendGroupMessageSetFailed(recordID int) {
recordsDb := implement.NewImGroupBatchSendMessageRecordsDb(db.Db)
m := model2.ImGroupBatchSendMessageRecords{
State: 2,
}
_, err := recordsDb.ImGroupBatchSendMessageRecordsUpdate(recordID, &m)
if err != nil {
fmt.Println("DealGroupMessage_ERR:::::", err.Error())
return
}
}

+ 19
- 0
app/utils/slice_and_string.go View File

@@ -45,3 +45,22 @@ func SliceJoin(sep string, elems ...interface{}) string {
sep = strings.Replace(fmt.Sprint(elems), " ", sep, -1)
return sep[1 : len(sep)-1]
}

func DiffArray(a []string, b []string) []string {
var diffArray []string
temp := map[string]struct{}{}

for _, val := range b {
if _, ok := temp[val]; !ok {
temp[val] = struct{}{}
}
}

for _, val := range a {
if _, ok := temp[val]; !ok {
diffArray = append(diffArray, val)
}
}

return diffArray
}

+ 66
- 17
docs/docs.go View File

@@ -1,5 +1,4 @@
// Code generated by swaggo/swag. DO NOT EDIT.

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs

import "github.com/swaggo/swag"
@@ -1353,9 +1352,7 @@ const docTemplate = `{
"name": "req",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
"schema": {}
}
],
"responses": {
@@ -1602,7 +1599,7 @@ const docTemplate = `{
},
"/api/im/batchSendGroupMessage": {
"post": {
"description": "发送群组消息",
"description": "群发发送群组消息",
"consumes": [
"application/json"
],
@@ -1610,9 +1607,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
"发送群组消息"
"群发发送群组消息"
],
"summary": "Im-发送群组消息",
"summary": "Im-群发发送群组消息",
"parameters": [
{
"type": "string",
@@ -1627,15 +1624,15 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.GroupListReq"
"$ref": "#/definitions/md.BatchSendGroupMessageReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"description": "success",
"schema": {
"$ref": "#/definitions/md.GroupListResp"
"type": "string"
}
},
"400": {
@@ -1649,7 +1646,7 @@ const docTemplate = `{
},
"/api/im/batchSendUserMessage": {
"post": {
"description": "发送用户消息",
"description": "群发发送用户消息",
"consumes": [
"application/json"
],
@@ -1657,9 +1654,9 @@ const docTemplate = `{
"application/json"
],
"tags": [
"发送用户消息"
"群发发送用户消息"
],
"summary": "Im-发送用户消息",
"summary": "Im-群发发送用户消息",
"parameters": [
{
"type": "string",
@@ -1674,15 +1671,15 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.GroupListReq"
"$ref": "#/definitions/md.BatchSendUserMessageReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"description": "success",
"schema": {
"$ref": "#/definitions/md.GroupListResp"
"type": "string"
}
},
"400": {
@@ -7409,6 +7406,56 @@ const docTemplate = `{
}
}
},
"md.BatchSendGroupMessageReq": {
"type": "object",
"properties": {
"content": {
"description": "消息内容",
"type": "string"
},
"kind": {
"description": "消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)",
"type": "integer"
},
"not_condition": {
"description": "不发送条件 群 ID 以\";\"分割",
"type": "string"
},
"send_condition": {
"description": "发送条件 群 ID 以\";\"分割",
"type": "string"
},
"send_kind": {
"description": "发送模式(1:指定群组 2:所有群组)",
"type": "integer"
}
}
},
"md.BatchSendUserMessageReq": {
"type": "object",
"properties": {
"content": {
"description": "消息内容",
"type": "string"
},
"kind": {
"description": "消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)",
"type": "integer"
},
"not_condition": {
"description": "不发送条件 用户手机号 以\";\"分割",
"type": "string"
},
"send_condition": {
"description": "发送条件 用户手机号 以\";\"分割",
"type": "string"
},
"send_kind": {
"description": "发送模式(1:所有用户 2:指定用户)",
"type": "integer"
}
}
},
"md.CloudBundleBaseResp": {
"type": "object",
"properties": {
@@ -12218,6 +12265,8 @@ var SwaggerInfo = &swag.Spec{
Description: "管理后台接口文档",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {


+ 63
- 15
docs/swagger.json View File

@@ -1345,9 +1345,7 @@
"name": "req",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
"schema": {}
}
],
"responses": {
@@ -1594,7 +1592,7 @@
},
"/api/im/batchSendGroupMessage": {
"post": {
"description": "发送群组消息",
"description": "群发发送群组消息",
"consumes": [
"application/json"
],
@@ -1602,9 +1600,9 @@
"application/json"
],
"tags": [
"发送群组消息"
"群发发送群组消息"
],
"summary": "Im-发送群组消息",
"summary": "Im-群发发送群组消息",
"parameters": [
{
"type": "string",
@@ -1619,15 +1617,15 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.GroupListReq"
"$ref": "#/definitions/md.BatchSendGroupMessageReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"description": "success",
"schema": {
"$ref": "#/definitions/md.GroupListResp"
"type": "string"
}
},
"400": {
@@ -1641,7 +1639,7 @@
},
"/api/im/batchSendUserMessage": {
"post": {
"description": "发送用户消息",
"description": "群发发送用户消息",
"consumes": [
"application/json"
],
@@ -1649,9 +1647,9 @@
"application/json"
],
"tags": [
"发送用户消息"
"群发发送用户消息"
],
"summary": "Im-发送用户消息",
"summary": "Im-群发发送用户消息",
"parameters": [
{
"type": "string",
@@ -1666,15 +1664,15 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/md.GroupListReq"
"$ref": "#/definitions/md.BatchSendUserMessageReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"description": "success",
"schema": {
"$ref": "#/definitions/md.GroupListResp"
"type": "string"
}
},
"400": {
@@ -7401,6 +7399,56 @@
}
}
},
"md.BatchSendGroupMessageReq": {
"type": "object",
"properties": {
"content": {
"description": "消息内容",
"type": "string"
},
"kind": {
"description": "消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)",
"type": "integer"
},
"not_condition": {
"description": "不发送条件 群 ID 以\";\"分割",
"type": "string"
},
"send_condition": {
"description": "发送条件 群 ID 以\";\"分割",
"type": "string"
},
"send_kind": {
"description": "发送模式(1:指定群组 2:所有群组)",
"type": "integer"
}
}
},
"md.BatchSendUserMessageReq": {
"type": "object",
"properties": {
"content": {
"description": "消息内容",
"type": "string"
},
"kind": {
"description": "消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)",
"type": "integer"
},
"not_condition": {
"description": "不发送条件 用户手机号 以\";\"分割",
"type": "string"
},
"send_condition": {
"description": "发送条件 用户手机号 以\";\"分割",
"type": "string"
},
"send_kind": {
"description": "发送模式(1:所有用户 2:指定用户)",
"type": "integer"
}
}
},
"md.CloudBundleBaseResp": {
"type": "object",
"properties": {


+ 49
- 14
docs/swagger.yaml View File

@@ -740,6 +740,42 @@ definitions:
description: 微信号
type: string
type: object
md.BatchSendGroupMessageReq:
properties:
content:
description: 消息内容
type: string
kind:
description: 消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)
type: integer
not_condition:
description: 不发送条件 群 ID 以";"分割
type: string
send_condition:
description: 发送条件 群 ID 以";"分割
type: string
send_kind:
description: 发送模式(1:指定群组 2:所有群组)
type: integer
type: object
md.BatchSendUserMessageReq:
properties:
content:
description: 消息内容
type: string
kind:
description: 消息类型(0未知 1文本 2表情 3语音消息 4图片 5文件 6地理位置 7指令推送 8自定义 9撤回消息 10红包消息)
type: integer
not_condition:
description: 不发送条件 用户手机号 以";"分割
type: string
send_condition:
description: 发送条件 用户手机号 以";"分割
type: string
send_kind:
description: 发送模式(1:所有用户 2:指定用户)
type: integer
type: object
md.CloudBundleBaseResp:
properties:
android_logo:
@@ -4958,8 +4994,7 @@ paths:
in: body
name: req
required: true
schema:
type: object
schema: {}
produces:
- application/json
responses:
@@ -5127,7 +5162,7 @@ paths:
post:
consumes:
- application/json
description: 发送群组消息
description: 群发发送群组消息
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
@@ -5139,26 +5174,26 @@ paths:
name: req
required: true
schema:
$ref: '#/definitions/md.GroupListReq'
$ref: '#/definitions/md.BatchSendGroupMessageReq'
produces:
- application/json
responses:
"200":
description: OK
description: success
schema:
$ref: '#/definitions/md.GroupListResp'
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: Im-发送群组消息
summary: Im-群发发送群组消息
tags:
- 发送群组消息
- 群发发送群组消息
/api/im/batchSendUserMessage:
post:
consumes:
- application/json
description: 发送用户消息
description: 群发发送用户消息
parameters:
- description: 验证参数Bearer和token空格拼接
in: header
@@ -5170,21 +5205,21 @@ paths:
name: req
required: true
schema:
$ref: '#/definitions/md.GroupListReq'
$ref: '#/definitions/md.BatchSendUserMessageReq'
produces:
- application/json
responses:
"200":
description: OK
description: success
schema:
$ref: '#/definitions/md.GroupListResp'
type: string
"400":
description: 具体错误
schema:
$ref: '#/definitions/md.Response'
summary: Im-发送用户消息
summary: Im-群发发送用户消息
tags:
- 发送用户消息
- 群发发送用户消息
/api/im/deleteEmoticon:
post:
consumes:


+ 5
- 3
go.mod View File

@@ -33,8 +33,8 @@ require (
)

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241127063655-6ff35d2075d5
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241126134228-b1047bfb8475
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241127101621-1959e539cc1f
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241127101803-8cd39f7b84b2
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5
github.com/360EntSecGroup-Skylar/excelize v1.4.1
@@ -45,6 +45,8 @@ require (
github.com/olivere/elastic/v7 v7.0.32
github.com/shopspring/decimal v1.3.1
github.com/tidwall/gjson v1.14.1
google.golang.org/grpc v1.32.0
google.golang.org/protobuf v1.33.0
)

require (
@@ -109,7 +111,7 @@ require (
golang.org/x/tools v0.20.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.4.0 // indirect
google.golang.org/protobuf v1.34.0 // indirect
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.0.1-2020.1.4 // indirect
xorm.io/builder v0.3.13 // indirect


Loading…
Cancel
Save