From a1fc6e4e659e56c8658725b210676a6a306db764 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Tue, 20 Jun 2023 17:03:20 +0800 Subject: [PATCH] statistics --- internal/api/auth.go | 2 +- internal/api/group.go | 4 +- internal/api/route.go | 9 + internal/api/statistics.go | 30 ++ internal/api/user.go | 9 +- internal/rpc/statistics/statistics.go | 1 + internal/rpc/user/statistics.go | 23 ++ pkg/common/db/controller/user.go | 13 + pkg/common/db/relation/user_model.go | 23 ++ pkg/common/db/table/relation/user.go | 4 + pkg/proto/gen.cmd | 3 +- pkg/proto/gen.sh | 1 + pkg/proto/sdkws/sdkws.pb.go | 14 +- pkg/proto/statistics/statistics.pb.go | 66 +++++ pkg/proto/statistics/statistics.proto | 4 + pkg/proto/user/user.pb.go | 390 +++++++++++++++++++------- pkg/proto/user/user.proto | 14 +- 17 files changed, 502 insertions(+), 108 deletions(-) create mode 100644 internal/api/statistics.go create mode 100644 internal/rpc/statistics/statistics.go create mode 100644 internal/rpc/user/statistics.go create mode 100644 pkg/proto/statistics/statistics.pb.go create mode 100644 pkg/proto/statistics/statistics.proto diff --git a/internal/api/auth.go b/internal/api/auth.go index 6c3d51ccd..22e30b923 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -33,7 +33,7 @@ func (o *Auth) client(ctx context.Context) (auth.AuthClient, error) { } func (o *Auth) UserRegister(c *gin.Context) { - //a2r.Call(auth.AuthClient.UserRegister, o.client, c) // todo + //a2r.Call(auth.AuthClient.UserRegister, o.userClient, c) // todo } func (o *Auth) UserToken(c *gin.Context) { diff --git a/internal/api/group.go b/internal/api/group.go index 2701a2382..3b1829025 100644 --- a/internal/api/group.go +++ b/internal/api/group.go @@ -118,11 +118,11 @@ func (o *Group) GetGroupAbstractInfo(c *gin.Context) { } //func (g *Group) SetGroupMemberNickname(c *gin.Context) { -// a2r.Call(group.GroupClient.SetGroupMemberNickname, g.client, c) +// a2r.Call(group.GroupClient.SetGroupMemberNickname, g.userClient, c) //} // //func (g *Group) GetGroupAllMemberList(c *gin.Context) { -// a2r.Call(group.GroupClient.GetGroupAllMember, g.client, c) +// a2r.Call(group.GroupClient.GetGroupAllMember, g.userClient, c) //} func (o *Group) GetJoinedSuperGroupList(c *gin.Context) { diff --git a/internal/api/route.go b/internal/api/route.go index e642584c4..a5f907ac8 100644 --- a/internal/api/route.go +++ b/internal/api/route.go @@ -171,5 +171,14 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive conversationGroup.POST("/modify_conversation_field", c.ModifyConversationField) conversationGroup.POST("/set_conversations", c.SetConversations) } + + statisticsGroup := r.Group("/statistics") + { + s := NewStatistics(discov) + conversationGroup.Use(mw.GinParseToken(rdb)) + statisticsGroup.POST("/user_register", s.UserRegister) + + } + return r } diff --git a/internal/api/statistics.go b/internal/api/statistics.go new file mode 100644 index 000000000..998a3ce77 --- /dev/null +++ b/internal/api/statistics.go @@ -0,0 +1,30 @@ +package api + +import ( + "context" + "github.com/OpenIMSDK/Open-IM-Server/pkg/a2r" + "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry" + "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user" + "github.com/gin-gonic/gin" +) + +func NewStatistics(discov discoveryregistry.SvcDiscoveryRegistry) *Statistics { + return &Statistics{discov: discov} +} + +type Statistics struct { + discov discoveryregistry.SvcDiscoveryRegistry +} + +func (s *Statistics) userClient(ctx context.Context) (user.UserClient, error) { + conn, err := s.discov.GetConn(ctx, config.Config.RpcRegisterName.OpenImUserName) + if err != nil { + return nil, err + } + return user.NewUserClient(conn), nil +} + +func (s *Statistics) UserRegister(c *gin.Context) { + a2r.Call(user.UserClient.UserRegisterCount, s.userClient, c) +} diff --git a/internal/api/user.go b/internal/api/user.go index ada759d39..621ec476b 100644 --- a/internal/api/user.go +++ b/internal/api/user.go @@ -3,15 +3,13 @@ package api import ( "context" + "github.com/OpenIMSDK/Open-IM-Server/pkg/a2r" "github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp" "github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify" - "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" - "google.golang.org/grpc" - - "github.com/OpenIMSDK/Open-IM-Server/pkg/a2r" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" + "github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify" "github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry" + "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user" "github.com/gin-gonic/gin" ) @@ -26,7 +24,6 @@ func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User { type User struct { discov discoveryregistry.SvcDiscoveryRegistry - conn *grpc.ClientConn } func (u *User) client(ctx context.Context) (user.UserClient, error) { diff --git a/internal/rpc/statistics/statistics.go b/internal/rpc/statistics/statistics.go new file mode 100644 index 000000000..12c0dbc25 --- /dev/null +++ b/internal/rpc/statistics/statistics.go @@ -0,0 +1 @@ +package statistics diff --git a/internal/rpc/user/statistics.go b/internal/rpc/user/statistics.go new file mode 100644 index 000000000..036b09687 --- /dev/null +++ b/internal/rpc/user/statistics.go @@ -0,0 +1,23 @@ +package user + +import ( + "context" + "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" + pbuser "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user" + "time" +) + +func (s *userServer) UserRegisterCount(ctx context.Context, req *pbuser.UserRegisterCountReq) (*pbuser.UserRegisterCountResp, error) { + if req.Start > req.End { + return nil, errs.ErrArgs.Wrap("start > end") + } + total, err := s.CountTotal(ctx) + if err != nil { + return nil, err + } + count, err := s.CountRangeEverydayTotal(ctx, time.UnixMilli(req.Start), time.UnixMilli(req.End)) + if err != nil { + return nil, err + } + return &pbuser.UserRegisterCountResp{Total: total, Count: count}, nil +} diff --git a/pkg/common/db/controller/user.go b/pkg/common/db/controller/user.go index 72b1a9c49..d1346d311 100644 --- a/pkg/common/db/controller/user.go +++ b/pkg/common/db/controller/user.go @@ -2,6 +2,7 @@ package controller import ( "context" + "time" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" @@ -29,6 +30,10 @@ type UserDatabase interface { GetAllUserID(ctx context.Context) ([]string, error) //函数内部先查询db中是否存在,存在则什么都不做;不存在则插入 InitOnce(ctx context.Context, users []*relation.UserModel) (err error) + // 获取用户总数 + CountTotal(ctx context.Context) (int64, error) + // 获取范围内用户增量 + CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) } type userDatabase struct { @@ -128,3 +133,11 @@ func (u *userDatabase) IsExist(ctx context.Context, userIDs []string) (exist boo func (u *userDatabase) GetAllUserID(ctx context.Context) (userIDs []string, err error) { return u.userDB.GetAllUserID(ctx) } + +func (u *userDatabase) CountTotal(ctx context.Context) (count int64, err error) { + return u.userDB.CountTotal(ctx) +} + +func (u *userDatabase) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) { + return u.userDB.CountRangeEverydayTotal(ctx, start, end) +} diff --git a/pkg/common/db/relation/user_model.go b/pkg/common/db/relation/user_model.go index 0acef2b0d..385e65809 100644 --- a/pkg/common/db/relation/user_model.go +++ b/pkg/common/db/relation/user_model.go @@ -2,6 +2,8 @@ package relation import ( "context" + "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" + "time" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils" @@ -64,3 +66,24 @@ func (u *UserGorm) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) ( err = u.db(ctx).Model(&relation.UserModel{}).Where("user_id = ?", userID).Pluck("global_recv_msg_opt", &opt).Error return opt, err } + +func (u *UserGorm) CountTotal(ctx context.Context) (count int64, err error) { + err = u.db(ctx).Model(&relation.UserModel{}).Count(&count).Error + return count, errs.Wrap(err) +} + +func (u *UserGorm) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) { + var res []struct { + Date string `gorm:"column:date"` + Count int64 `gorm:"column:count"` + } + err := u.db(ctx).Model(&relation.UserModel{}).Select("DATE(create_time) AS date, count(1) AS count").Where("create_time >= ? and create_time < ?", start, end).Group("date").Find(&res).Error + if err != nil { + return nil, errs.Wrap(err) + } + v := make(map[string]int64) + for _, r := range res { + v[r.Date] = r.Count + } + return v, nil +} diff --git a/pkg/common/db/table/relation/user.go b/pkg/common/db/table/relation/user.go index 7eac8ab0f..35b52602f 100644 --- a/pkg/common/db/table/relation/user.go +++ b/pkg/common/db/table/relation/user.go @@ -51,4 +51,8 @@ type UserModelInterface interface { Page(ctx context.Context, pageNumber, showNumber int32) (users []*UserModel, count int64, err error) GetAllUserID(ctx context.Context) (userIDs []string, err error) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error) + // 获取用户总数 + CountTotal(ctx context.Context) (count int64, err error) + // 获取范围内用户增量 + CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) } diff --git a/pkg/proto/gen.cmd b/pkg/proto/gen.cmd index d9db71867..930a636ec 100644 --- a/pkg/proto/gen.cmd +++ b/pkg/proto/gen.cmd @@ -9,4 +9,5 @@ protoc --go_out=plugins=grpc:./push --go_opt=module=github.com/OpenIMSDK/Open-IM protoc --go_out=plugins=grpc:./sdkws --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws sdkws/sdkws.proto protoc --go_out=plugins=grpc:./third --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/third third/third.proto protoc --go_out=plugins=grpc:./user --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user user/user.proto -protoc --go_out=plugins=grpc:./wrapperspb --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb wrapperspb/wrapperspb.proto \ No newline at end of file +protoc --go_out=plugins=grpc:./wrapperspb --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb wrapperspb/wrapperspb.proto +protoc --go_out=plugins=grpc:./statistics --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/statistics statistics/statistics.proto \ No newline at end of file diff --git a/pkg/proto/gen.sh b/pkg/proto/gen.sh index 3eb68c181..930a636ec 100644 --- a/pkg/proto/gen.sh +++ b/pkg/proto/gen.sh @@ -10,3 +10,4 @@ protoc --go_out=plugins=grpc:./sdkws --go_opt=module=github.com/OpenIMSDK/Open-I protoc --go_out=plugins=grpc:./third --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/third third/third.proto protoc --go_out=plugins=grpc:./user --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user user/user.proto protoc --go_out=plugins=grpc:./wrapperspb --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb wrapperspb/wrapperspb.proto +protoc --go_out=plugins=grpc:./statistics --go_opt=module=github.com/OpenIMSDK/Open-IM-Server/pkg/proto/statistics statistics/statistics.proto \ No newline at end of file diff --git a/pkg/proto/sdkws/sdkws.pb.go b/pkg/proto/sdkws/sdkws.pb.go index dc548694c..a08a8857e 100644 --- a/pkg/proto/sdkws/sdkws.pb.go +++ b/pkg/proto/sdkws/sdkws.pb.go @@ -1796,6 +1796,7 @@ type OfflinePushInfo struct { Ex string `protobuf:"bytes,3,opt,name=ex,proto3" json:"ex"` IOSPushSound string `protobuf:"bytes,4,opt,name=iOSPushSound,proto3" json:"iOSPushSound"` IOSBadgeCount bool `protobuf:"varint,5,opt,name=iOSBadgeCount,proto3" json:"iOSBadgeCount"` + SignalInfo string `protobuf:"bytes,6,opt,name=signalInfo,proto3" json:"signalInfo"` } func (x *OfflinePushInfo) Reset() { @@ -1865,6 +1866,13 @@ func (x *OfflinePushInfo) GetIOSBadgeCount() bool { return false } +func (x *OfflinePushInfo) GetSignalInfo() string { + if x != nil { + return x.SignalInfo + } + return "" +} + type TipsComm struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5264,7 +5272,7 @@ var file_sdkws_sdkws_proto_rawDesc = []byte{ 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, + 0x01, 0x22, 0xb5, 0x01, 0x0a, 0x0f, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, @@ -5273,7 +5281,9 @@ var file_sdkws_sdkws_proto_rawDesc = []byte{ 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x4f, 0x53, 0x50, 0x75, 0x73, 0x68, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x4f, 0x53, 0x42, 0x61, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x4f, 0x53, 0x42, - 0x61, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x64, 0x0a, 0x08, 0x54, 0x69, 0x70, + 0x61, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x64, 0x0a, 0x08, 0x54, 0x69, 0x70, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x54, 0x69, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, diff --git a/pkg/proto/statistics/statistics.pb.go b/pkg/proto/statistics/statistics.pb.go new file mode 100644 index 000000000..6943736ec --- /dev/null +++ b/pkg/proto/statistics/statistics.pb.go @@ -0,0 +1,66 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.29.1 +// protoc v4.22.0 +// source: statistics/statistics.proto + +package statistics + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_statistics_statistics_proto protoreflect.FileDescriptor + +var file_statistics_statistics_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x4f, + 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x4f, + 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_statistics_statistics_proto_goTypes = []interface{}{} +var file_statistics_statistics_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_statistics_statistics_proto_init() } +func file_statistics_statistics_proto_init() { + if File_statistics_statistics_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_statistics_statistics_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_statistics_statistics_proto_goTypes, + DependencyIndexes: file_statistics_statistics_proto_depIdxs, + }.Build() + File_statistics_statistics_proto = out.File + file_statistics_statistics_proto_rawDesc = nil + file_statistics_statistics_proto_goTypes = nil + file_statistics_statistics_proto_depIdxs = nil +} diff --git a/pkg/proto/statistics/statistics.proto b/pkg/proto/statistics/statistics.proto new file mode 100644 index 000000000..70980edd3 --- /dev/null +++ b/pkg/proto/statistics/statistics.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package OpenIMServer.statistics; +option go_package = "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/statistics"; + diff --git a/pkg/proto/user/user.pb.go b/pkg/proto/user/user.pb.go index 38bc775ec..0dffdb0d3 100644 --- a/pkg/proto/user/user.pb.go +++ b/pkg/proto/user/user.pb.go @@ -1441,6 +1441,116 @@ func (x *GetGlobalRecvMessageOptResp) GetGlobalRecvMsgOpt() int32 { return 0 } +type UserRegisterCountReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` + End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` +} + +func (x *UserRegisterCountReq) Reset() { + *x = UserRegisterCountReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserRegisterCountReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserRegisterCountReq) ProtoMessage() {} + +func (x *UserRegisterCountReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[28] + 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 UserRegisterCountReq.ProtoReflect.Descriptor instead. +func (*UserRegisterCountReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{28} +} + +func (x *UserRegisterCountReq) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *UserRegisterCountReq) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +type UserRegisterCountResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` + Count map[string]int64 `protobuf:"bytes,2,rep,name=count,proto3" json:"count" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *UserRegisterCountResp) Reset() { + *x = UserRegisterCountResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserRegisterCountResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserRegisterCountResp) ProtoMessage() {} + +func (x *UserRegisterCountResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[29] + 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 UserRegisterCountResp.ProtoReflect.Descriptor instead. +func (*UserRegisterCountResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{29} +} + +func (x *UserRegisterCountResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *UserRegisterCountResp) GetCount() map[string]int64 { + if x != nil { + return x.Count + } + return nil +} + type AccountCheckRespSingleUserStatus struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1453,7 +1563,7 @@ type AccountCheckRespSingleUserStatus struct { func (x *AccountCheckRespSingleUserStatus) Reset() { *x = AccountCheckRespSingleUserStatus{} if protoimpl.UnsafeEnabled { - mi := &file_user_user_proto_msgTypes[28] + mi := &file_user_user_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1466,7 +1576,7 @@ func (x *AccountCheckRespSingleUserStatus) String() string { func (*AccountCheckRespSingleUserStatus) ProtoMessage() {} func (x *AccountCheckRespSingleUserStatus) ProtoReflect() protoreflect.Message { - mi := &file_user_user_proto_msgTypes[28] + mi := &file_user_user_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1665,62 +1775,84 @@ var file_user_user_proto_rawDesc = []byte{ 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, - 0x4f, 0x70, 0x74, 0x32, 0xb7, 0x06, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x66, 0x0a, 0x11, - 0x67, 0x65, 0x74, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x12, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x4f, 0x70, 0x65, - 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, - 0x65, 0x74, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x5d, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x4f, - 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x78, 0x0a, 0x17, 0x73, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, - 0x52, 0x65, 0x63, 0x76, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x12, 0x2d, - 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, - 0x65, 0x72, 0x2e, 0x73, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x2e, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x2e, 0x73, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x78, 0x0a, - 0x17, 0x67, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x12, 0x2d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, - 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x2e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, 0x47, + 0x4f, 0x70, 0x74, 0x22, 0x3e, 0x0a, 0x14, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x65, 0x6e, 0x64, 0x22, 0xb2, 0x01, 0x0a, 0x15, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x12, 0x49, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x38, + 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x9f, 0x07, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x12, 0x66, 0x0a, 0x11, 0x67, 0x65, 0x74, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x65, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, + 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5d, 0x0a, 0x0e, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x4f, 0x70, + 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x71, 0x1a, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x78, 0x0a, 0x17, 0x73, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, + 0x4f, 0x70, 0x74, 0x12, 0x2d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x2e, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x52, 0x65, 0x63, 0x76, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x78, 0x0a, 0x17, 0x67, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, + 0x65, 0x63, 0x76, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x12, 0x2d, 0x2e, + 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x67, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x2e, 0x2e, 0x4f, + 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x67, 0x65, 0x74, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x0c, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x22, 0x2e, 0x4f, + 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x1a, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x69, 0x0a, 0x12, 0x67, 0x65, 0x74, 0x50, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x69, 0x0a, 0x12, 0x67, 0x65, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x1a, 0x29, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x0c, 0x75, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, - 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x0c, 0x67, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x44, 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, - 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, - 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x42, 0x34, 0x5a, - 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, - 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x65, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x29, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x57, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x0c, 0x67, 0x65, 0x74, + 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x22, 0x2e, 0x4f, 0x70, 0x65, 0x6e, + 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x65, + 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, + 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x66, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, + 0x44, 0x4b, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x75, 0x73, 0x65, 0x72, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1735,7 +1867,7 @@ func file_user_user_proto_rawDescGZIP() []byte { return file_user_user_proto_rawDescData } -var file_user_user_proto_msgTypes = make([]protoimpl.MessageInfo, 29) +var file_user_user_proto_msgTypes = make([]protoimpl.MessageInfo, 32) var file_user_user_proto_goTypes = []interface{}{ (*GetAllUserIDReq)(nil), // 0: OpenIMServer.user.getAllUserIDReq (*GetAllUserIDResp)(nil), // 1: OpenIMServer.user.getAllUserIDResp @@ -1765,45 +1897,51 @@ var file_user_user_proto_goTypes = []interface{}{ (*UserRegisterResp)(nil), // 25: OpenIMServer.user.userRegisterResp (*GetGlobalRecvMessageOptReq)(nil), // 26: OpenIMServer.user.getGlobalRecvMessageOptReq (*GetGlobalRecvMessageOptResp)(nil), // 27: OpenIMServer.user.getGlobalRecvMessageOptResp - (*AccountCheckRespSingleUserStatus)(nil), // 28: OpenIMServer.user.accountCheckResp.singleUserStatus - (*sdkws.RequestPagination)(nil), // 29: OpenIMServer.sdkws.RequestPagination - (*sdkws.UserInfo)(nil), // 30: OpenIMServer.sdkws.UserInfo - (*conversation.Conversation)(nil), // 31: OpenIMServer.conversation.Conversation + (*UserRegisterCountReq)(nil), // 28: OpenIMServer.user.userRegisterCountReq + (*UserRegisterCountResp)(nil), // 29: OpenIMServer.user.userRegisterCountResp + (*AccountCheckRespSingleUserStatus)(nil), // 30: OpenIMServer.user.accountCheckResp.singleUserStatus + nil, // 31: OpenIMServer.user.userRegisterCountResp.CountEntry + (*sdkws.RequestPagination)(nil), // 32: OpenIMServer.sdkws.RequestPagination + (*sdkws.UserInfo)(nil), // 33: OpenIMServer.sdkws.UserInfo + (*conversation.Conversation)(nil), // 34: OpenIMServer.conversation.Conversation } var file_user_user_proto_depIdxs = []int32{ - 29, // 0: OpenIMServer.user.getAllUserIDReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 28, // 1: OpenIMServer.user.accountCheckResp.results:type_name -> OpenIMServer.user.accountCheckResp.singleUserStatus - 30, // 2: OpenIMServer.user.getDesignateUsersResp.usersInfo:type_name -> OpenIMServer.sdkws.UserInfo - 30, // 3: OpenIMServer.user.updateUserInfoReq.userInfo:type_name -> OpenIMServer.sdkws.UserInfo - 31, // 4: OpenIMServer.user.setConversationReq.conversation:type_name -> OpenIMServer.conversation.Conversation - 31, // 5: OpenIMServer.user.getConversationResp.conversation:type_name -> OpenIMServer.conversation.Conversation - 31, // 6: OpenIMServer.user.getConversationsResp.conversations:type_name -> OpenIMServer.conversation.Conversation - 31, // 7: OpenIMServer.user.getAllConversationsResp.conversations:type_name -> OpenIMServer.conversation.Conversation - 31, // 8: OpenIMServer.user.batchSetConversationsReq.conversations:type_name -> OpenIMServer.conversation.Conversation - 29, // 9: OpenIMServer.user.getPaginationUsersReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination - 30, // 10: OpenIMServer.user.getPaginationUsersResp.users:type_name -> OpenIMServer.sdkws.UserInfo - 30, // 11: OpenIMServer.user.userRegisterReq.users:type_name -> OpenIMServer.sdkws.UserInfo - 4, // 12: OpenIMServer.user.user.getDesignateUsers:input_type -> OpenIMServer.user.getDesignateUsersReq - 6, // 13: OpenIMServer.user.user.updateUserInfo:input_type -> OpenIMServer.user.updateUserInfoReq - 8, // 14: OpenIMServer.user.user.setGlobalRecvMessageOpt:input_type -> OpenIMServer.user.setGlobalRecvMessageOptReq - 26, // 15: OpenIMServer.user.user.getGlobalRecvMessageOpt:input_type -> OpenIMServer.user.getGlobalRecvMessageOptReq - 2, // 16: OpenIMServer.user.user.accountCheck:input_type -> OpenIMServer.user.accountCheckReq - 22, // 17: OpenIMServer.user.user.getPaginationUsers:input_type -> OpenIMServer.user.getPaginationUsersReq - 24, // 18: OpenIMServer.user.user.userRegister:input_type -> OpenIMServer.user.userRegisterReq - 0, // 19: OpenIMServer.user.user.getAllUserID:input_type -> OpenIMServer.user.getAllUserIDReq - 5, // 20: OpenIMServer.user.user.getDesignateUsers:output_type -> OpenIMServer.user.getDesignateUsersResp - 7, // 21: OpenIMServer.user.user.updateUserInfo:output_type -> OpenIMServer.user.updateUserInfoResp - 9, // 22: OpenIMServer.user.user.setGlobalRecvMessageOpt:output_type -> OpenIMServer.user.setGlobalRecvMessageOptResp - 27, // 23: OpenIMServer.user.user.getGlobalRecvMessageOpt:output_type -> OpenIMServer.user.getGlobalRecvMessageOptResp - 3, // 24: OpenIMServer.user.user.accountCheck:output_type -> OpenIMServer.user.accountCheckResp - 23, // 25: OpenIMServer.user.user.getPaginationUsers:output_type -> OpenIMServer.user.getPaginationUsersResp - 25, // 26: OpenIMServer.user.user.userRegister:output_type -> OpenIMServer.user.userRegisterResp - 1, // 27: OpenIMServer.user.user.getAllUserID:output_type -> OpenIMServer.user.getAllUserIDResp - 20, // [20:28] is the sub-list for method output_type - 12, // [12:20] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 32, // 0: OpenIMServer.user.getAllUserIDReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination + 30, // 1: OpenIMServer.user.accountCheckResp.results:type_name -> OpenIMServer.user.accountCheckResp.singleUserStatus + 33, // 2: OpenIMServer.user.getDesignateUsersResp.usersInfo:type_name -> OpenIMServer.sdkws.UserInfo + 33, // 3: OpenIMServer.user.updateUserInfoReq.userInfo:type_name -> OpenIMServer.sdkws.UserInfo + 34, // 4: OpenIMServer.user.setConversationReq.conversation:type_name -> OpenIMServer.conversation.Conversation + 34, // 5: OpenIMServer.user.getConversationResp.conversation:type_name -> OpenIMServer.conversation.Conversation + 34, // 6: OpenIMServer.user.getConversationsResp.conversations:type_name -> OpenIMServer.conversation.Conversation + 34, // 7: OpenIMServer.user.getAllConversationsResp.conversations:type_name -> OpenIMServer.conversation.Conversation + 34, // 8: OpenIMServer.user.batchSetConversationsReq.conversations:type_name -> OpenIMServer.conversation.Conversation + 32, // 9: OpenIMServer.user.getPaginationUsersReq.pagination:type_name -> OpenIMServer.sdkws.RequestPagination + 33, // 10: OpenIMServer.user.getPaginationUsersResp.users:type_name -> OpenIMServer.sdkws.UserInfo + 33, // 11: OpenIMServer.user.userRegisterReq.users:type_name -> OpenIMServer.sdkws.UserInfo + 31, // 12: OpenIMServer.user.userRegisterCountResp.count:type_name -> OpenIMServer.user.userRegisterCountResp.CountEntry + 4, // 13: OpenIMServer.user.user.getDesignateUsers:input_type -> OpenIMServer.user.getDesignateUsersReq + 6, // 14: OpenIMServer.user.user.updateUserInfo:input_type -> OpenIMServer.user.updateUserInfoReq + 8, // 15: OpenIMServer.user.user.setGlobalRecvMessageOpt:input_type -> OpenIMServer.user.setGlobalRecvMessageOptReq + 26, // 16: OpenIMServer.user.user.getGlobalRecvMessageOpt:input_type -> OpenIMServer.user.getGlobalRecvMessageOptReq + 2, // 17: OpenIMServer.user.user.accountCheck:input_type -> OpenIMServer.user.accountCheckReq + 22, // 18: OpenIMServer.user.user.getPaginationUsers:input_type -> OpenIMServer.user.getPaginationUsersReq + 24, // 19: OpenIMServer.user.user.userRegister:input_type -> OpenIMServer.user.userRegisterReq + 0, // 20: OpenIMServer.user.user.getAllUserID:input_type -> OpenIMServer.user.getAllUserIDReq + 28, // 21: OpenIMServer.user.user.userRegisterCount:input_type -> OpenIMServer.user.userRegisterCountReq + 5, // 22: OpenIMServer.user.user.getDesignateUsers:output_type -> OpenIMServer.user.getDesignateUsersResp + 7, // 23: OpenIMServer.user.user.updateUserInfo:output_type -> OpenIMServer.user.updateUserInfoResp + 9, // 24: OpenIMServer.user.user.setGlobalRecvMessageOpt:output_type -> OpenIMServer.user.setGlobalRecvMessageOptResp + 27, // 25: OpenIMServer.user.user.getGlobalRecvMessageOpt:output_type -> OpenIMServer.user.getGlobalRecvMessageOptResp + 3, // 26: OpenIMServer.user.user.accountCheck:output_type -> OpenIMServer.user.accountCheckResp + 23, // 27: OpenIMServer.user.user.getPaginationUsers:output_type -> OpenIMServer.user.getPaginationUsersResp + 25, // 28: OpenIMServer.user.user.userRegister:output_type -> OpenIMServer.user.userRegisterResp + 1, // 29: OpenIMServer.user.user.getAllUserID:output_type -> OpenIMServer.user.getAllUserIDResp + 29, // 30: OpenIMServer.user.user.userRegisterCount:output_type -> OpenIMServer.user.userRegisterCountResp + 22, // [22:31] is the sub-list for method output_type + 13, // [13:22] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_user_user_proto_init() } @@ -2149,6 +2287,30 @@ func file_user_user_proto_init() { } } file_user_user_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserRegisterCountReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserRegisterCountResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AccountCheckRespSingleUserStatus); i { case 0: return &v.state @@ -2167,7 +2329,7 @@ func file_user_user_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_user_proto_rawDesc, NumEnums: 0, - NumMessages: 29, + NumMessages: 32, NumExtensions: 0, NumServices: 1, }, @@ -2209,6 +2371,8 @@ type UserClient interface { UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) // 获取所有用户ID GetAllUserID(ctx context.Context, in *GetAllUserIDReq, opts ...grpc.CallOption) (*GetAllUserIDResp, error) + // 获取用户总数和指定时间段内的用户增量 + UserRegisterCount(ctx context.Context, in *UserRegisterCountReq, opts ...grpc.CallOption) (*UserRegisterCountResp, error) } type userClient struct { @@ -2291,6 +2455,15 @@ func (c *userClient) GetAllUserID(ctx context.Context, in *GetAllUserIDReq, opts return out, nil } +func (c *userClient) UserRegisterCount(ctx context.Context, in *UserRegisterCountReq, opts ...grpc.CallOption) (*UserRegisterCountResp, error) { + out := new(UserRegisterCountResp) + err := c.cc.Invoke(ctx, "/OpenIMServer.user.user/userRegisterCount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // UserServer is the server API for User service. type UserServer interface { // 获取指定的用户信息 全字段 @@ -2309,6 +2482,8 @@ type UserServer interface { UserRegister(context.Context, *UserRegisterReq) (*UserRegisterResp, error) // 获取所有用户ID GetAllUserID(context.Context, *GetAllUserIDReq) (*GetAllUserIDResp, error) + // 获取用户总数和指定时间段内的用户增量 + UserRegisterCount(context.Context, *UserRegisterCountReq) (*UserRegisterCountResp, error) } // UnimplementedUserServer can be embedded to have forward compatible implementations. @@ -2339,6 +2514,9 @@ func (*UnimplementedUserServer) UserRegister(context.Context, *UserRegisterReq) func (*UnimplementedUserServer) GetAllUserID(context.Context, *GetAllUserIDReq) (*GetAllUserIDResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAllUserID not implemented") } +func (*UnimplementedUserServer) UserRegisterCount(context.Context, *UserRegisterCountReq) (*UserRegisterCountResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserRegisterCount not implemented") +} func RegisterUserServer(s *grpc.Server, srv UserServer) { s.RegisterService(&_User_serviceDesc, srv) @@ -2488,6 +2666,24 @@ func _User_GetAllUserID_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _User_UserRegisterCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UserRegisterCountReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).UserRegisterCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OpenIMServer.user.user/UserRegisterCount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).UserRegisterCount(ctx, req.(*UserRegisterCountReq)) + } + return interceptor(ctx, in, info, handler) +} + var _User_serviceDesc = grpc.ServiceDesc{ ServiceName: "OpenIMServer.user.user", HandlerType: (*UserServer)(nil), @@ -2524,6 +2720,10 @@ var _User_serviceDesc = grpc.ServiceDesc{ MethodName: "getAllUserID", Handler: _User_GetAllUserID_Handler, }, + { + MethodName: "userRegisterCount", + Handler: _User_UserRegisterCount_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/user.proto", diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index e02b32b08..ae0e9c1c3 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -126,13 +126,23 @@ message userRegisterResp { message getGlobalRecvMessageOptReq{ - string userID = 1; + string userID = 1; } message getGlobalRecvMessageOptResp{ int32 globalRecvMsgOpt = 1; } +message userRegisterCountReq { + int64 start = 1; + int64 end = 2; +} + +message userRegisterCountResp { + int64 total = 1; + map count = 2; +} + service user { //获取指定的用户信息 全字段 rpc getDesignateUsers(getDesignateUsersReq) returns(getDesignateUsersResp); @@ -150,5 +160,7 @@ service user { rpc userRegister(userRegisterReq) returns (userRegisterResp); //获取所有用户ID rpc getAllUserID(getAllUserIDReq) returns (getAllUserIDResp); + // 获取用户总数和指定时间段内的用户增量 + rpc userRegisterCount(userRegisterCountReq)returns(userRegisterCountResp); }