From f5f2bc166f5b5b9ac6777ec6f7cc3b2b47bed53c Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Sun, 5 Jun 2022 01:40:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=B2=AE=E8=8D=89=E7=89=88?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=A7=B0=E5=8F=B7=EF=BC=8C=E7=B2=BE?= =?UTF-8?q?=E8=8B=B1=E5=8D=95=E4=BD=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pb/gen.bat | 5 + app/pb/mq/gen.bat | 1 - app/pb/mq/mq.pb.go | 467 ++- app/pb/mq/mq.proto | 28 + app/pb/vars/vars.pb.go | 312 ++ app/pb/vars/vars.proto | 45 + app/user_center/gen-model.bat | 2 +- app/user_center/model/gift_model.go | 4 +- app/user_center/model/gift_model_gen.go | 9 +- app/user_center/model/rank_and_score.go | 46 +- app/user_center/model/rank_pvp_model.go | 4 +- app/user_center/model/rank_pvp_model_gen.go | 8 +- app/user_center/model/statistics_pvp_model.go | 50 +- .../model/statistics_pvp_model_gen.go | 4 +- app/user_center/model/user_check_in_model.go | 4 +- .../model/user_check_in_model_gen.go | 4 +- app/user_center/model/user_coin_model_gen.go | 4 +- app/user_center/model/user_elite_model.go | 132 + app/user_center/model/user_elite_model_gen.go | 100 + app/user_center/model/user_gift_model_gen.go | 4 +- .../model/user_integral_model_gen.go | 4 +- app/user_center/model/user_model_gen.go | 4 +- .../model/user_nobility_model_gen.go | 4 +- app/user_center/model/user_platform_model.go | 48 +- .../model/user_platform_model_gen.go | 29 +- app/user_center/model/user_title_model.go | 140 + app/user_center/model/user_title_model_gen.go | 101 + .../model/zhg_user_details_model.go | 59 + .../model/zhg_user_details_model_gen.go | 85 + app/user_center/rpc/etc/user_center-dev.yaml | 105 +- .../internal/common/coin_manager/manager.go | 153 + .../common/integral_manager/manager.go | 132 - .../rpc/internal/common/reward_pool/pool.go | 21 +- app/user_center/rpc/internal/config/config.go | 139 +- .../rpc/internal/config/config_game.go | 136 + .../internal/logic/coin/change_coin_logic.go | 41 + .../logic/coin/get_user_coin_logic.go | 40 + .../logic/coin/transfer_user_coin_logic.go | 44 + .../logic/draw_pool/increase_welfare_logic.go | 30 - .../logic/gift/user_buy_nobility_logic.go | 12 +- .../logic/gift/user_send_gift_logic.go | 31 +- .../rpc/internal/logic/gift/util.go | 21 +- .../internal/logic/gift_collect/collector.go | 4 +- .../logic/gift_collect/collector_bilibili.go | 4 +- .../logic/integral/change_integral_logic.go | 46 - .../logic/integral/get_user_integral_logic.go | 40 - .../integral/transfer_user_integral_logic.go | 41 - .../platform_user/platform_user_retrieve.go | 6 +- .../logic/platform_user/retrieve_bilibili.go | 2 +- .../rpc/internal/logic/rank/rank_job.go | 139 +- .../rpc/internal/logic/rank/rank_pvp_logic.go | 2 +- .../logic/rank/user_rank_pvp_logic.go | 7 +- .../statistics/stat_pvp_first_blood_logic.go | 74 - .../logic/statistics/stat_pvp_kill_logic.go | 86 - .../logic/statistics/stat_pvp_report_logic.go | 325 +- .../logic/user/get_user_details_logic.go | 124 + .../user/retrieve_platform_user_logic.go | 55 +- .../logic/user/user_check_in_logic.go | 44 +- .../rpc/internal/logic/zhg/buy_elite_logic.go | 60 + .../rpc/internal/logic/zhg/buy_title_logic.go | 67 + .../internal/logic/zhg/change_elite_logic.go | 66 + .../internal/logic/zhg/change_title_logic.go | 68 + .../internal/logic/zhg/give_elite_logic.go | 55 + .../internal/logic/zhg/give_title_logic.go | 56 + .../rpc/internal/mq/reward_pool.go | 32 + app/user_center/rpc/internal/mq/user.go | 42 + .../rpc/internal/server/user_center_server.go | 91 +- .../rpc/internal/svc/service_context.go | 91 +- app/user_center/rpc/pb/generate.go | 2 +- app/user_center/rpc/pb/user_center.pb.go | 3124 ++++++++++------- app/user_center/rpc/pb/user_center.proto | 291 +- app/user_center/rpc/pb/user_center_grpc.pb.go | 460 ++- app/user_center/rpc/user_center.go | 8 +- app/user_center/rpc/usercenter/user_center.go | 184 +- common/nerr/err_code.go | 61 +- common/timex/expire.go | 28 + go.mod | 7 +- go.sum | 82 +- 78 files changed, 5537 insertions(+), 2949 deletions(-) create mode 100644 app/pb/gen.bat delete mode 100644 app/pb/mq/gen.bat create mode 100644 app/pb/vars/vars.pb.go create mode 100644 app/pb/vars/vars.proto create mode 100644 app/user_center/model/user_elite_model.go create mode 100644 app/user_center/model/user_elite_model_gen.go create mode 100644 app/user_center/model/user_title_model.go create mode 100644 app/user_center/model/user_title_model_gen.go create mode 100644 app/user_center/model/zhg_user_details_model.go create mode 100644 app/user_center/model/zhg_user_details_model_gen.go create mode 100644 app/user_center/rpc/internal/common/coin_manager/manager.go delete mode 100644 app/user_center/rpc/internal/common/integral_manager/manager.go create mode 100644 app/user_center/rpc/internal/config/config_game.go create mode 100644 app/user_center/rpc/internal/logic/coin/change_coin_logic.go create mode 100644 app/user_center/rpc/internal/logic/coin/get_user_coin_logic.go create mode 100644 app/user_center/rpc/internal/logic/coin/transfer_user_coin_logic.go delete mode 100644 app/user_center/rpc/internal/logic/draw_pool/increase_welfare_logic.go delete mode 100644 app/user_center/rpc/internal/logic/integral/change_integral_logic.go delete mode 100644 app/user_center/rpc/internal/logic/integral/get_user_integral_logic.go delete mode 100644 app/user_center/rpc/internal/logic/integral/transfer_user_integral_logic.go delete mode 100644 app/user_center/rpc/internal/logic/statistics/stat_pvp_first_blood_logic.go delete mode 100644 app/user_center/rpc/internal/logic/statistics/stat_pvp_kill_logic.go create mode 100644 app/user_center/rpc/internal/logic/user/get_user_details_logic.go create mode 100644 app/user_center/rpc/internal/logic/zhg/buy_elite_logic.go create mode 100644 app/user_center/rpc/internal/logic/zhg/buy_title_logic.go create mode 100644 app/user_center/rpc/internal/logic/zhg/change_elite_logic.go create mode 100644 app/user_center/rpc/internal/logic/zhg/change_title_logic.go create mode 100644 app/user_center/rpc/internal/logic/zhg/give_elite_logic.go create mode 100644 app/user_center/rpc/internal/logic/zhg/give_title_logic.go create mode 100644 app/user_center/rpc/internal/mq/reward_pool.go create mode 100644 app/user_center/rpc/internal/mq/user.go create mode 100644 common/timex/expire.go diff --git a/app/pb/gen.bat b/app/pb/gen.bat new file mode 100644 index 0000000..dcd3e70 --- /dev/null +++ b/app/pb/gen.bat @@ -0,0 +1,5 @@ +protoc --go_opt=paths=source_relative ^ + --go-grpc_opt=paths=source_relative ^ + --go-grpc_opt=require_unimplemented_servers=false ^ + --go_out=. --go-grpc_out=. --proto_path=. ^ + ./vars/*.proto ./mq/*.proto \ No newline at end of file diff --git a/app/pb/mq/gen.bat b/app/pb/mq/gen.bat deleted file mode 100644 index 944bcfd..0000000 --- a/app/pb/mq/gen.bat +++ /dev/null @@ -1 +0,0 @@ -protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_opt=require_unimplemented_servers=false --go_out=. --go-grpc_out=. --proto_path=. mq.proto \ No newline at end of file diff --git a/app/pb/mq/mq.pb.go b/app/pb/mq/mq.pb.go index 8e19624..2c71559 100644 --- a/app/pb/mq/mq.pb.go +++ b/app/pb/mq/mq.pb.go @@ -2,13 +2,14 @@ // versions: // protoc-gen-go v1.27.1 // protoc v3.19.4 -// source: mq.proto +// source: mq/mq.proto package pbMq import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + vars "live-service/app/pb/vars" reflect "reflect" sync "sync" ) @@ -56,11 +57,11 @@ func (x Platform) String() string { } func (Platform) Descriptor() protoreflect.EnumDescriptor { - return file_mq_proto_enumTypes[0].Descriptor() + return file_mq_mq_proto_enumTypes[0].Descriptor() } func (Platform) Type() protoreflect.EnumType { - return &file_mq_proto_enumTypes[0] + return &file_mq_mq_proto_enumTypes[0] } func (x Platform) Number() protoreflect.EnumNumber { @@ -69,7 +70,134 @@ func (x Platform) Number() protoreflect.EnumNumber { // Deprecated: Use Platform.Descriptor instead. func (Platform) EnumDescriptor() ([]byte, []int) { - return file_mq_proto_rawDescGZIP(), []int{0} + return file_mq_mq_proto_rawDescGZIP(), []int{0} +} + +type MqGuardBuy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` + LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"` + Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` + Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` + GuardLevel int32 `protobuf:"varint,5,opt,name=guardLevel,proto3" json:"guardLevel,omitempty"` + Num int32 `protobuf:"varint,6,opt,name=num,proto3" json:"num,omitempty"` + Price int64 `protobuf:"varint,7,opt,name=price,proto3" json:"price,omitempty"` + GiftId int64 `protobuf:"varint,8,opt,name=giftId,proto3" json:"giftId,omitempty"` + GiftName string `protobuf:"bytes,9,opt,name=giftName,proto3" json:"giftName,omitempty"` + StartTime int64 `protobuf:"varint,10,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime int64 `protobuf:"varint,11,opt,name=endTime,proto3" json:"endTime,omitempty"` +} + +func (x *MqGuardBuy) Reset() { + *x = MqGuardBuy{} + if protoimpl.UnsafeEnabled { + mi := &file_mq_mq_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MqGuardBuy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MqGuardBuy) ProtoMessage() {} + +func (x *MqGuardBuy) ProtoReflect() protoreflect.Message { + mi := &file_mq_mq_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 MqGuardBuy.ProtoReflect.Descriptor instead. +func (*MqGuardBuy) Descriptor() ([]byte, []int) { + return file_mq_mq_proto_rawDescGZIP(), []int{0} +} + +func (x *MqGuardBuy) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *MqGuardBuy) GetLiveRoomId() int64 { + if x != nil { + return x.LiveRoomId + } + return 0 +} + +func (x *MqGuardBuy) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *MqGuardBuy) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + +func (x *MqGuardBuy) GetGuardLevel() int32 { + if x != nil { + return x.GuardLevel + } + return 0 +} + +func (x *MqGuardBuy) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *MqGuardBuy) GetPrice() int64 { + if x != nil { + return x.Price + } + return 0 +} + +func (x *MqGuardBuy) GetGiftId() int64 { + if x != nil { + return x.GiftId + } + return 0 +} + +func (x *MqGuardBuy) GetGiftName() string { + if x != nil { + return x.GiftName + } + return "" +} + +func (x *MqGuardBuy) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *MqGuardBuy) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 } type MqDanmaku struct { @@ -88,7 +216,7 @@ type MqDanmaku struct { func (x *MqDanmaku) Reset() { *x = MqDanmaku{} if protoimpl.UnsafeEnabled { - mi := &file_mq_proto_msgTypes[0] + mi := &file_mq_mq_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -101,7 +229,7 @@ func (x *MqDanmaku) String() string { func (*MqDanmaku) ProtoMessage() {} func (x *MqDanmaku) ProtoReflect() protoreflect.Message { - mi := &file_mq_proto_msgTypes[0] + mi := &file_mq_mq_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -114,7 +242,7 @@ func (x *MqDanmaku) ProtoReflect() protoreflect.Message { // Deprecated: Use MqDanmaku.ProtoReflect.Descriptor instead. func (*MqDanmaku) Descriptor() ([]byte, []int) { - return file_mq_proto_rawDescGZIP(), []int{0} + return file_mq_mq_proto_rawDescGZIP(), []int{1} } func (x *MqDanmaku) GetPlatform() string { @@ -178,7 +306,7 @@ type MqGift struct { func (x *MqGift) Reset() { *x = MqGift{} if protoimpl.UnsafeEnabled { - mi := &file_mq_proto_msgTypes[1] + mi := &file_mq_mq_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -191,7 +319,7 @@ func (x *MqGift) String() string { func (*MqGift) ProtoMessage() {} func (x *MqGift) ProtoReflect() protoreflect.Message { - mi := &file_mq_proto_msgTypes[1] + mi := &file_mq_mq_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -204,7 +332,7 @@ func (x *MqGift) ProtoReflect() protoreflect.Message { // Deprecated: Use MqGift.ProtoReflect.Descriptor instead. func (*MqGift) Descriptor() ([]byte, []int) { - return file_mq_proto_rawDescGZIP(), []int{1} + return file_mq_mq_proto_rawDescGZIP(), []int{2} } func (x *MqGift) GetPlatform() string { @@ -287,7 +415,7 @@ type MqRewardPool struct { func (x *MqRewardPool) Reset() { *x = MqRewardPool{} if protoimpl.UnsafeEnabled { - mi := &file_mq_proto_msgTypes[2] + mi := &file_mq_mq_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -300,7 +428,7 @@ func (x *MqRewardPool) String() string { func (*MqRewardPool) ProtoMessage() {} func (x *MqRewardPool) ProtoReflect() protoreflect.Message { - mi := &file_mq_proto_msgTypes[2] + mi := &file_mq_mq_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -313,7 +441,7 @@ func (x *MqRewardPool) ProtoReflect() protoreflect.Message { // Deprecated: Use MqRewardPool.ProtoReflect.Descriptor instead. func (*MqRewardPool) Descriptor() ([]byte, []int) { - return file_mq_proto_rawDescGZIP(), []int{2} + return file_mq_mq_proto_rawDescGZIP(), []int{3} } func (x *MqRewardPool) GetWelfarePool() int64 { @@ -365,92 +493,229 @@ func (x *MqRewardPool) GetAllRewards() int64 { return 0 } -var File_mq_proto protoreflect.FileDescriptor +// 用户金币变动通知 +type MqUserCoinChanged struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` + Reason vars.UserCoinChangedReason `protobuf:"varint,4,opt,name=reason,proto3,enum=pb.vars.UserCoinChangedReason" json:"reason,omitempty"` // 变动原因 + Change int64 `protobuf:"varint,10,opt,name=change,proto3" json:"change,omitempty"` // 变动量 + Current int64 `protobuf:"varint,11,opt,name=current,proto3" json:"current,omitempty"` // 当前量 +} + +func (x *MqUserCoinChanged) Reset() { + *x = MqUserCoinChanged{} + if protoimpl.UnsafeEnabled { + mi := &file_mq_mq_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MqUserCoinChanged) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MqUserCoinChanged) ProtoMessage() {} + +func (x *MqUserCoinChanged) ProtoReflect() protoreflect.Message { + mi := &file_mq_mq_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 MqUserCoinChanged.ProtoReflect.Descriptor instead. +func (*MqUserCoinChanged) Descriptor() ([]byte, []int) { + return file_mq_mq_proto_rawDescGZIP(), []int{4} +} + +func (x *MqUserCoinChanged) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *MqUserCoinChanged) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *MqUserCoinChanged) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *MqUserCoinChanged) GetReason() vars.UserCoinChangedReason { + if x != nil { + return x.Reason + } + return vars.UserCoinChangedReason(0) +} -var file_mq_proto_rawDesc = []byte{ - 0x0a, 0x08, 0x6d, 0x71, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xa5, - 0x01, 0x0a, 0x09, 0x4d, 0x71, 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x6b, 0x75, 0x12, 0x1a, 0x0a, 0x08, +func (x *MqUserCoinChanged) GetChange() int64 { + if x != nil { + return x.Change + } + return 0 +} + +func (x *MqUserCoinChanged) GetCurrent() int64 { + if x != nil { + return x.Current + } + return 0 +} + +var File_mq_mq_proto protoreflect.FileDescriptor + +var file_mq_mq_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x6d, 0x71, 0x2f, 0x6d, 0x71, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, + 0x62, 0x1a, 0x0f, 0x76, 0x61, 0x72, 0x73, 0x2f, 0x76, 0x61, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xa4, 0x02, 0x0a, 0x0a, 0x4d, 0x71, 0x47, 0x75, 0x61, 0x72, 0x64, 0x42, 0x75, + 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, + 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x75, 0x61, 0x72, 0x64, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x67, 0x75, 0x61, 0x72, 0x64, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, + 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa5, 0x01, 0x0a, 0x09, 0x4d, 0x71, + 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x6b, 0x75, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, + 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x22, 0xe0, 0x01, 0x0a, 0x06, 0x4d, 0x71, 0x47, 0x69, 0x66, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, - 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, - 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe0, 0x01, 0x0a, 0x06, 0x4d, 0x71, 0x47, 0x69, 0x66, - 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, - 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, - 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, - 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x22, 0xf2, 0x01, 0x0a, 0x0c, 0x4d, 0x71, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x77, 0x65, - 0x6c, 0x66, 0x61, 0x72, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0b, 0x77, 0x65, 0x6c, 0x66, 0x61, 0x72, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x08, - 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, - 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x69, 0x74, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, - 0x69, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x69, 0x66, 0x74, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x69, - 0x66, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, - 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, - 0x6f, 0x74, 0x68, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e, - 0x0a, 0x0a, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2a, 0x39, - 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0c, 0x0a, 0x08, 0x62, 0x69, - 0x6c, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x68, 0x75, 0x79, 0x61, - 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x64, 0x6f, 0x75, 0x79, 0x75, 0x10, 0x02, 0x12, 0x0a, 0x0a, - 0x06, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x10, 0x03, 0x42, 0x07, 0x5a, 0x05, 0x2f, 0x70, 0x62, - 0x4d, 0x71, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, + 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, + 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, + 0x50, 0x61, 0x69, 0x64, 0x22, 0xf2, 0x01, 0x0a, 0x0c, 0x4d, 0x71, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x77, 0x65, 0x6c, 0x66, 0x61, 0x72, 0x65, + 0x50, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x77, 0x65, 0x6c, 0x66, + 0x61, 0x72, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x69, 0x66, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x69, 0x66, 0x74, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f, 0x74, + 0x68, 0x65, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x6c, 0x6c, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, + 0x6c, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x22, 0xc9, 0x01, 0x0a, 0x11, 0x4d, 0x71, + 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x62, + 0x2e, 0x76, 0x61, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x2a, 0x39, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x12, 0x0c, 0x0a, 0x08, 0x62, 0x69, 0x6c, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x10, 0x00, 0x12, + 0x08, 0x0a, 0x04, 0x68, 0x75, 0x79, 0x61, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x64, 0x6f, 0x75, + 0x79, 0x75, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x10, 0x03, + 0x42, 0x07, 0x5a, 0x05, 0x2f, 0x70, 0x62, 0x4d, 0x71, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( - file_mq_proto_rawDescOnce sync.Once - file_mq_proto_rawDescData = file_mq_proto_rawDesc + file_mq_mq_proto_rawDescOnce sync.Once + file_mq_mq_proto_rawDescData = file_mq_mq_proto_rawDesc ) -func file_mq_proto_rawDescGZIP() []byte { - file_mq_proto_rawDescOnce.Do(func() { - file_mq_proto_rawDescData = protoimpl.X.CompressGZIP(file_mq_proto_rawDescData) +func file_mq_mq_proto_rawDescGZIP() []byte { + file_mq_mq_proto_rawDescOnce.Do(func() { + file_mq_mq_proto_rawDescData = protoimpl.X.CompressGZIP(file_mq_mq_proto_rawDescData) }) - return file_mq_proto_rawDescData -} - -var file_mq_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_mq_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_mq_proto_goTypes = []interface{}{ - (Platform)(0), // 0: pb.Platform - (*MqDanmaku)(nil), // 1: pb.MqDanmaku - (*MqGift)(nil), // 2: pb.MqGift - (*MqRewardPool)(nil), // 3: pb.MqRewardPool -} -var file_mq_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_mq_proto_init() } -func file_mq_proto_init() { - if File_mq_proto != nil { + return file_mq_mq_proto_rawDescData +} + +var file_mq_mq_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_mq_mq_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_mq_mq_proto_goTypes = []interface{}{ + (Platform)(0), // 0: pb.Platform + (*MqGuardBuy)(nil), // 1: pb.MqGuardBuy + (*MqDanmaku)(nil), // 2: pb.MqDanmaku + (*MqGift)(nil), // 3: pb.MqGift + (*MqRewardPool)(nil), // 4: pb.MqRewardPool + (*MqUserCoinChanged)(nil), // 5: pb.MqUserCoinChanged + (vars.UserCoinChangedReason)(0), // 6: pb.vars.UserCoinChangedReason +} +var file_mq_mq_proto_depIdxs = []int32{ + 6, // 0: pb.MqUserCoinChanged.reason:type_name -> pb.vars.UserCoinChangedReason + 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_mq_mq_proto_init() } +func file_mq_mq_proto_init() { + if File_mq_mq_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_mq_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_mq_mq_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MqGuardBuy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mq_mq_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MqDanmaku); i { case 0: return &v.state @@ -462,7 +727,7 @@ func file_mq_proto_init() { return nil } } - file_mq_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_mq_mq_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MqGift); i { case 0: return &v.state @@ -474,7 +739,7 @@ func file_mq_proto_init() { return nil } } - file_mq_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_mq_mq_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MqRewardPool); i { case 0: return &v.state @@ -486,24 +751,36 @@ func file_mq_proto_init() { return nil } } + file_mq_mq_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MqUserCoinChanged); 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_mq_proto_rawDesc, + RawDescriptor: file_mq_mq_proto_rawDesc, NumEnums: 1, - NumMessages: 3, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_mq_proto_goTypes, - DependencyIndexes: file_mq_proto_depIdxs, - EnumInfos: file_mq_proto_enumTypes, - MessageInfos: file_mq_proto_msgTypes, + GoTypes: file_mq_mq_proto_goTypes, + DependencyIndexes: file_mq_mq_proto_depIdxs, + EnumInfos: file_mq_mq_proto_enumTypes, + MessageInfos: file_mq_mq_proto_msgTypes, }.Build() - File_mq_proto = out.File - file_mq_proto_rawDesc = nil - file_mq_proto_goTypes = nil - file_mq_proto_depIdxs = nil + File_mq_mq_proto = out.File + file_mq_mq_proto_rawDesc = nil + file_mq_mq_proto_goTypes = nil + file_mq_mq_proto_depIdxs = nil } diff --git a/app/pb/mq/mq.proto b/app/pb/mq/mq.proto index 39f6162..f52b0f8 100644 --- a/app/pb/mq/mq.proto +++ b/app/pb/mq/mq.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package pb; +import "vars/vars.proto"; + option go_package = "/pbMq"; enum Platform { @@ -11,6 +13,20 @@ enum Platform { douyin = 3; // 抖音 } +message MqGuardBuy { + string platform = 1; + int64 liveRoomId = 2; + int64 uid = 3; + string uname = 4; + int32 guardLevel = 5; + int32 num = 6; + int64 price = 7; + int64 giftId = 8; + string giftName = 9; + int64 startTime = 10; + int64 endTime = 11; +} + message MqDanmaku { string platform = 1; int64 liveRoomId = 2; @@ -40,4 +56,16 @@ message MqRewardPool { int64 battleReward = 5; // 战斗奖池 int64 otherReward = 6; // 其它奖池 int64 allRewards = 10; // 所有奖池 +} + +// 用户金币变动通知 +message MqUserCoinChanged { + int64 userId = 1; + string username = 2; + string avatar = 3; + + pb.vars.UserCoinChangedReason reason = 4; // 变动原因 + + int64 change = 10; // 变动量 + int64 current = 11; // 当前量 } \ No newline at end of file diff --git a/app/pb/vars/vars.pb.go b/app/pb/vars/vars.pb.go new file mode 100644 index 0000000..ded2ffc --- /dev/null +++ b/app/pb/vars/vars.pb.go @@ -0,0 +1,312 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.19.4 +// source: vars/vars.proto + +package pbVars + +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 UserCoinChangedReason int32 + +const ( + ///// 消费 + UserCoinChangedReason_Pay UserCoinChangedReason = 0 // 通用消费 + UserCoinChangedReason_BuyBattleFood UserCoinChangedReason = 1 // 购买粮草 + UserCoinChangedReason_BuyEliteUnit UserCoinChangedReason = 2 // 购买精英单位 + UserCoinChangedReason_BuyTitle UserCoinChangedReason = 3 // 购买称号 + ///// 礼物 + UserCoinChangedReason_SendGift UserCoinChangedReason = 4 // 赠送礼物 + UserCoinChangedReason_BuyNobility UserCoinChangedReason = 5 // 购买贵族 + ///// 领取 + UserCoinChangedReason_DrawGiftPack UserCoinChangedReason = 10 // 领取礼包 + UserCoinChangedReason_CheckIn UserCoinChangedReason = 11 // 签到打卡 + ///// 游戏事件 + UserCoinChangedReason_EventRankSubmit UserCoinChangedReason = 20 // 排行榜结算变动 + UserCoinChangedReason_EventBattleEnd UserCoinChangedReason = 21 // 战局结束奖励 + ///// 其它事件 + UserCoinChangedReason_Transfer UserCoinChangedReason = 30 // 转账 +) + +// Enum value maps for UserCoinChangedReason. +var ( + UserCoinChangedReason_name = map[int32]string{ + 0: "Pay", + 1: "BuyBattleFood", + 2: "BuyEliteUnit", + 3: "BuyTitle", + 4: "SendGift", + 5: "BuyNobility", + 10: "DrawGiftPack", + 11: "CheckIn", + 20: "EventRankSubmit", + 21: "EventBattleEnd", + 30: "Transfer", + } + UserCoinChangedReason_value = map[string]int32{ + "Pay": 0, + "BuyBattleFood": 1, + "BuyEliteUnit": 2, + "BuyTitle": 3, + "SendGift": 4, + "BuyNobility": 5, + "DrawGiftPack": 10, + "CheckIn": 11, + "EventRankSubmit": 20, + "EventBattleEnd": 21, + "Transfer": 30, + } +) + +func (x UserCoinChangedReason) Enum() *UserCoinChangedReason { + p := new(UserCoinChangedReason) + *p = x + return p +} + +func (x UserCoinChangedReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UserCoinChangedReason) Descriptor() protoreflect.EnumDescriptor { + return file_vars_vars_proto_enumTypes[0].Descriptor() +} + +func (UserCoinChangedReason) Type() protoreflect.EnumType { + return &file_vars_vars_proto_enumTypes[0] +} + +func (x UserCoinChangedReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserCoinChangedReason.Descriptor instead. +func (UserCoinChangedReason) EnumDescriptor() ([]byte, []int) { + return file_vars_vars_proto_rawDescGZIP(), []int{0} +} + +type Goods int32 + +const ( + Goods_Title Goods = 0 // 称号 + Goods_Elite Goods = 1 // 精英单位 +) + +// Enum value maps for Goods. +var ( + Goods_name = map[int32]string{ + 0: "Title", + 1: "Elite", + } + Goods_value = map[string]int32{ + "Title": 0, + "Elite": 1, + } +) + +func (x Goods) Enum() *Goods { + p := new(Goods) + *p = x + return p +} + +func (x Goods) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Goods) Descriptor() protoreflect.EnumDescriptor { + return file_vars_vars_proto_enumTypes[1].Descriptor() +} + +func (Goods) Type() protoreflect.EnumType { + return &file_vars_vars_proto_enumTypes[1] +} + +func (x Goods) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Goods.Descriptor instead. +func (Goods) EnumDescriptor() ([]byte, []int) { + return file_vars_vars_proto_rawDescGZIP(), []int{1} +} + +type RankType int32 + +const ( + RankType_Unknown RankType = 0 + RankType_Damage RankType = 1 // 伤害榜 + RankType_DeDamage RankType = 2 // 受伤榜 + RankType_General RankType = 3 // 名将榜 + RankType_DeGeneral RankType = 4 // 落马榜 + RankType_KillUnit RankType = 5 // 小兵击杀 + RankType_DeKillUnit RankType = 6 // 小兵被杀 + RankType_KillPlayer RankType = 7 // 击杀玩家 + RankType_DeKillPlayer RankType = 8 // 被杀榜 + RankType_Win RankType = 9 // 获胜榜 + RankType_Lost RankType = 10 // 战败榜 + RankType_FirstBlood RankType = 11 // 一血榜 + RankType_DeFirstBlood RankType = 12 // 被拿一血榜 +) + +// Enum value maps for RankType. +var ( + RankType_name = map[int32]string{ + 0: "Unknown", + 1: "Damage", + 2: "DeDamage", + 3: "General", + 4: "DeGeneral", + 5: "KillUnit", + 6: "DeKillUnit", + 7: "KillPlayer", + 8: "DeKillPlayer", + 9: "Win", + 10: "Lost", + 11: "FirstBlood", + 12: "DeFirstBlood", + } + RankType_value = map[string]int32{ + "Unknown": 0, + "Damage": 1, + "DeDamage": 2, + "General": 3, + "DeGeneral": 4, + "KillUnit": 5, + "DeKillUnit": 6, + "KillPlayer": 7, + "DeKillPlayer": 8, + "Win": 9, + "Lost": 10, + "FirstBlood": 11, + "DeFirstBlood": 12, + } +) + +func (x RankType) Enum() *RankType { + p := new(RankType) + *p = x + return p +} + +func (x RankType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RankType) Descriptor() protoreflect.EnumDescriptor { + return file_vars_vars_proto_enumTypes[2].Descriptor() +} + +func (RankType) Type() protoreflect.EnumType { + return &file_vars_vars_proto_enumTypes[2] +} + +func (x RankType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RankType.Descriptor instead. +func (RankType) EnumDescriptor() ([]byte, []int) { + return file_vars_vars_proto_rawDescGZIP(), []int{2} +} + +var File_vars_vars_proto protoreflect.FileDescriptor + +var file_vars_vars_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x76, 0x61, 0x72, 0x73, 0x2f, 0x76, 0x61, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x07, 0x70, 0x62, 0x2e, 0x76, 0x61, 0x72, 0x73, 0x2a, 0xc8, 0x01, 0x0a, 0x15, 0x55, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x61, 0x79, 0x10, 0x00, 0x12, 0x11, 0x0a, + 0x0d, 0x42, 0x75, 0x79, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x6f, 0x64, 0x10, 0x01, + 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x75, 0x79, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, + 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x75, 0x79, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x10, 0x03, + 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x69, 0x66, 0x74, 0x10, 0x04, 0x12, 0x0f, + 0x0a, 0x0b, 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x10, 0x05, 0x12, + 0x10, 0x0a, 0x0c, 0x44, 0x72, 0x61, 0x77, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x10, + 0x0a, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x10, 0x0b, 0x12, 0x13, + 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x10, 0x14, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x10, 0x15, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x10, 0x1e, 0x2a, 0x1d, 0x0a, 0x05, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x09, + 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x6c, 0x69, + 0x74, 0x65, 0x10, 0x01, 0x2a, 0xc2, 0x01, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0a, + 0x0a, 0x06, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x65, + 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x6c, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x6c, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, + 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, + 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x10, 0x07, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x10, 0x08, 0x12, 0x07, 0x0a, 0x03, 0x57, 0x69, 0x6e, 0x10, 0x09, 0x12, 0x08, 0x0a, + 0x04, 0x4c, 0x6f, 0x73, 0x74, 0x10, 0x0a, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x69, 0x72, 0x73, 0x74, + 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x10, 0x0b, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x65, 0x46, 0x69, 0x72, + 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x10, 0x0c, 0x42, 0x21, 0x5a, 0x1f, 0x6c, 0x69, 0x76, + 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x62, + 0x2f, 0x76, 0x61, 0x72, 0x73, 0x3b, 0x70, 0x62, 0x56, 0x61, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_vars_vars_proto_rawDescOnce sync.Once + file_vars_vars_proto_rawDescData = file_vars_vars_proto_rawDesc +) + +func file_vars_vars_proto_rawDescGZIP() []byte { + file_vars_vars_proto_rawDescOnce.Do(func() { + file_vars_vars_proto_rawDescData = protoimpl.X.CompressGZIP(file_vars_vars_proto_rawDescData) + }) + return file_vars_vars_proto_rawDescData +} + +var file_vars_vars_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_vars_vars_proto_goTypes = []interface{}{ + (UserCoinChangedReason)(0), // 0: pb.vars.UserCoinChangedReason + (Goods)(0), // 1: pb.vars.Goods + (RankType)(0), // 2: pb.vars.RankType +} +var file_vars_vars_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_vars_vars_proto_init() } +func file_vars_vars_proto_init() { + if File_vars_vars_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_vars_vars_proto_rawDesc, + NumEnums: 3, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_vars_vars_proto_goTypes, + DependencyIndexes: file_vars_vars_proto_depIdxs, + EnumInfos: file_vars_vars_proto_enumTypes, + }.Build() + File_vars_vars_proto = out.File + file_vars_vars_proto_rawDesc = nil + file_vars_vars_proto_goTypes = nil + file_vars_vars_proto_depIdxs = nil +} diff --git a/app/pb/vars/vars.proto b/app/pb/vars/vars.proto new file mode 100644 index 0000000..4ce512e --- /dev/null +++ b/app/pb/vars/vars.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package pb.vars; + +option go_package = "live-service/app/pb/vars;pbVars"; + +enum UserCoinChangedReason { + ///// 消费 + Pay = 0; // 通用消费 + BuyBattleFood = 1; // 购买粮草 + BuyEliteUnit = 2; // 购买精英单位 + BuyTitle = 3; // 购买称号 + ///// 礼物 + SendGift = 4; // 赠送礼物 + BuyNobility = 5; // 购买贵族 + ///// 领取 + DrawGiftPack = 10; // 领取礼包 + CheckIn = 11; // 签到打卡 + ///// 游戏事件 + EventRankSubmit = 20; // 排行榜结算变动 + EventBattleEnd = 21; // 战局结束奖励 + ///// 其它事件 + Transfer = 30; // 转账 +} + +enum Goods { + Title = 0; // 称号 + Elite = 1; // 精英单位 +} + +enum RankType { + Unknown = 0; + Damage = 1; // 伤害榜 + DeDamage = 2; // 受伤榜 + General = 3; // 名将榜 + DeGeneral = 4; // 落马榜 + KillUnit = 5; // 小兵击杀 + DeKillUnit = 6; // 小兵被杀 + KillPlayer = 7; // 击杀玩家 + DeKillPlayer = 8; // 被杀榜 + Win = 9; // 获胜榜 + Lost = 10; // 战败榜 + FirstBlood = 11; // 一血榜 + DeFirstBlood = 12; // 被拿一血榜 +} \ No newline at end of file diff --git a/app/user_center/gen-model.bat b/app/user_center/gen-model.bat index a596fb5..10e6206 100644 --- a/app/user_center/gen-model.bat +++ b/app/user_center/gen-model.bat @@ -2,7 +2,7 @@ chcp 65001 @echo 开始代码生成 -set tables=user_coin +set tables=user_title set targetDir=.\model set templateDir=..\..\doc\template diff --git a/app/user_center/model/gift_model.go b/app/user_center/model/gift_model.go index c8e4ca6..28b4e2f 100644 --- a/app/user_center/model/gift_model.go +++ b/app/user_center/model/gift_model.go @@ -34,9 +34,9 @@ func (m *customGiftModel) FindByPlatformGift(ctx context.Context, platform strin err := db.Model(&Gift{}). Where("platform = ? AND gift_id = ?", platform, giftId). Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*Gift), nil + return &resp, nil } diff --git a/app/user_center/model/gift_model_gen.go b/app/user_center/model/gift_model_gen.go index d5b49a7..13fa916 100644 --- a/app/user_center/model/gift_model_gen.go +++ b/app/user_center/model/gift_model_gen.go @@ -42,6 +42,7 @@ type ( Platform string `gorm:"column:platform"` // 平台 PPriceFree int64 `gorm:"column:p_price_free"` // 平台免费价值单价B站: 银瓜子虎牙: 银豆 Price float64 `gorm:"column:price"` // 转换后的礼物价值,1RMB:1000(p) + Pic string `gorm:"pic"` // 礼物基本图 CreateTime time.Time `gorm:"column:create_time;default:null"` // 创建时间 PPricePaid int64 `gorm:"column:p_price_paid"` // 平台收费价值单价B站: 金瓜子虎牙: 金豆 } @@ -64,21 +65,21 @@ func (m *defaultGiftModel) Insert(ctx context.Context, tx *gorm.DB, data *Gift) func (m *defaultGiftModel) FindOne(ctx context.Context, tx *gorm.DB, id int64) (*Gift, error) { var resp Gift err := gormx.WithTx(ctx, m.DB, tx).Model(&Gift{}).Where("`id` = ?", id).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*Gift), nil + return &resp, nil } func (m *defaultGiftModel) FindOneByGiftIdPlatform(ctx context.Context, tx *gorm.DB, giftId string, platform string) (*Gift, error) { var resp Gift err := gormx.WithTx(ctx, m.DB, tx).Model(&Gift{}).Where("`gift_id` = ? and `platform` = ?", giftId, platform).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*Gift), nil + return &resp, nil } func (m *defaultGiftModel) Update(ctx context.Context, tx *gorm.DB, data *Gift) error { diff --git a/app/user_center/model/rank_and_score.go b/app/user_center/model/rank_and_score.go index e387d32..9374f78 100644 --- a/app/user_center/model/rank_and_score.go +++ b/app/user_center/model/rank_and_score.go @@ -1,22 +1,24 @@ package model -import "live-service/app/user_center/rpc/pb" +import ( + pbVars "live-service/app/pb/vars" +) -var rankAndScoreMap map[pb.RankType]ScoreType -var scoreAndRankMap map[ScoreType]pb.RankType +var rankAndScoreMap map[pbVars.RankType]ScoreType +var scoreAndRankMap map[ScoreType]pbVars.RankType -func ScoreTypeByRankType(rankType pb.RankType) ScoreType { +func ScoreTypeByRankType(rankType pbVars.RankType) ScoreType { if scoreType, ok := rankAndScoreMap[rankType]; ok { return scoreType } return ScoreTypeDamage } -func RankTypeByScoreType(scoreType ScoreType) pb.RankType { +func RankTypeByScoreType(scoreType ScoreType) pbVars.RankType { if rankType, ok := scoreAndRankMap[scoreType]; ok { return rankType } - return pb.RankType_Damage + return pbVars.RankType_Damage } func AllScoreType() []ScoreType { @@ -27,25 +29,25 @@ func AllScoreType() []ScoreType { return result } -func addRankScore(rankType pb.RankType, scoreType ScoreType) { +func addRankScore(rankType pbVars.RankType, scoreType ScoreType) { rankAndScoreMap[rankType] = scoreType scoreAndRankMap[scoreType] = rankType } func init() { - rankAndScoreMap = make(map[pb.RankType]ScoreType) - scoreAndRankMap = make(map[ScoreType]pb.RankType) - - addRankScore(pb.RankType_Damage, ScoreTypeDamage) - addRankScore(pb.RankType_DeDamage, ScoreTypeDeDamage) - addRankScore(pb.RankType_General, ScoreTypeGeneral) - addRankScore(pb.RankType_DeGeneral, ScoreTypeDeGeneral) - addRankScore(pb.RankType_KillUnit, ScoreTypeKillUnit) - addRankScore(pb.RankType_DeKillUnit, ScoreTypeDeKillUnit) - addRankScore(pb.RankType_KillPlayer, ScoreTypeKillPlayer) - addRankScore(pb.RankType_DeKillPlayer, ScoreTypeDeKillPlayer) - addRankScore(pb.RankType_Win, ScoreTypeWin) - addRankScore(pb.RankType_Lost, ScoreTypeLost) - addRankScore(pb.RankType_FirstBlood, ScoreTypeFirstBlood) - addRankScore(pb.RankType_DeFirstBlood, ScoreTypeDeFirstBlood) + rankAndScoreMap = make(map[pbVars.RankType]ScoreType) + scoreAndRankMap = make(map[ScoreType]pbVars.RankType) + + addRankScore(pbVars.RankType_Damage, ScoreTypeDamage) + addRankScore(pbVars.RankType_DeDamage, ScoreTypeDeDamage) + addRankScore(pbVars.RankType_General, ScoreTypeGeneral) + addRankScore(pbVars.RankType_DeGeneral, ScoreTypeDeGeneral) + addRankScore(pbVars.RankType_KillUnit, ScoreTypeKillUnit) + addRankScore(pbVars.RankType_DeKillUnit, ScoreTypeDeKillUnit) + addRankScore(pbVars.RankType_KillPlayer, ScoreTypeKillPlayer) + addRankScore(pbVars.RankType_DeKillPlayer, ScoreTypeDeKillPlayer) + addRankScore(pbVars.RankType_Win, ScoreTypeWin) + addRankScore(pbVars.RankType_Lost, ScoreTypeLost) + addRankScore(pbVars.RankType_FirstBlood, ScoreTypeFirstBlood) + addRankScore(pbVars.RankType_DeFirstBlood, ScoreTypeDeFirstBlood) } diff --git a/app/user_center/model/rank_pvp_model.go b/app/user_center/model/rank_pvp_model.go index 0b5a660..19334ff 100644 --- a/app/user_center/model/rank_pvp_model.go +++ b/app/user_center/model/rank_pvp_model.go @@ -67,11 +67,11 @@ func (m *customRankPvpModel) RankListByType(ctx context.Context, rankType, topN Where(fmt.Sprintf("%s.user_id > 0 AND rank_type = ?", m.table), rankType). Limit(int(limit)). Find(&result).Error - selectResult, err := gormx.WrapSelectResult(err, result) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return selectResult.([]RankPvpWithPlatformUser), nil + return result, nil } func (m *customRankPvpModel) UpdateRank(ctx context.Context, rankType int64, data []RankPvp) error { diff --git a/app/user_center/model/rank_pvp_model_gen.go b/app/user_center/model/rank_pvp_model_gen.go index 401107c..00afc6f 100644 --- a/app/user_center/model/rank_pvp_model_gen.go +++ b/app/user_center/model/rank_pvp_model_gen.go @@ -62,21 +62,21 @@ func (m *defaultRankPvpModel) Insert(ctx context.Context, tx *gorm.DB, data *Ran func (m *defaultRankPvpModel) FindOne(ctx context.Context, tx *gorm.DB, id int64) (*RankPvp, error) { var resp RankPvp err := gormx.WithTx(ctx, m.DB, tx).Model(&RankPvp{}).Where("`id` = ?", id).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*RankPvp), nil + return &resp, nil } func (m *defaultRankPvpModel) FindOneByUserIdRankType(ctx context.Context, tx *gorm.DB, userId int64, rankType int64) (*RankPvp, error) { var resp RankPvp err := gormx.WithTx(ctx, m.DB, tx).Model(&RankPvp{}).Where("`user_id` = ? and `rank_type` = ?", userId, rankType).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*RankPvp), nil + return &resp, nil } func (m *defaultRankPvpModel) Update(ctx context.Context, tx *gorm.DB, data *RankPvp) error { diff --git a/app/user_center/model/statistics_pvp_model.go b/app/user_center/model/statistics_pvp_model.go index d9c8e0c..9eb43c3 100644 --- a/app/user_center/model/statistics_pvp_model.go +++ b/app/user_center/model/statistics_pvp_model.go @@ -45,18 +45,18 @@ type ( } UpdateRecordProps struct { - Damage *int64 // 伤害 - DeDamage *int64 // 被伤害 - KillUnitCount *int64 // 击杀单位数量 - DeKillUnitCount *int64 // 被击杀单位被击杀 - Win bool // 是否获胜 - Lost bool // 是否战败 - KillPlayer bool // 是否击杀玩家 - DeKillPlayer bool // 是否玩家被击杀 - General bool // 是否拿到名将 - DeGeneral bool // 是否名将罗马 - FirstBlood bool // 是否拿到一血 - DeFirstBlood bool // 是否被拿一血 + Damage int64 // 伤害 + DeDamage int64 // 被伤害 + KillUnitCount int64 // 击杀单位数量 + DeKillUnitCount int64 // 被击杀单位被击杀 + Win bool // 是否获胜 + Lost bool // 是否战败 + KillPlayer int64 // 击杀玩家数量 + DeKillPlayer bool // 是否玩家被击杀 + General bool // 是否拿到名将 + DeGeneral bool // 是否名将罗马 + FirstBlood bool // 是否拿到一血 + DeFirstBlood bool // 是否被拿一血 } customStatisticsPvpModel struct { @@ -77,17 +77,17 @@ func (m *customStatisticsPvpModel) UpdateRecord(ctx context.Context, tx *gorm.DB db = db.Model(&StatisticsPvp{}).Where("user_id = ?", userId) data := make(map[string]interface{}) - if props.Damage != nil { - data["damage"] = gorm.Expr("damage + ?", *props.Damage) + if props.Damage != 0 { + data["damage"] = gorm.Expr("damage + ?", props.Damage) } - if props.DeDamage != nil { - data["de_damage"] = gorm.Expr("de_damage + ?", *props.DeDamage) + if props.DeDamage != 0 { + data["de_damage"] = gorm.Expr("de_damage + ?", props.DeDamage) } - if props.KillUnitCount != nil { - data["kill_unit_count"] = gorm.Expr("kill_unit_count + ?", *props.KillUnitCount) + if props.KillUnitCount != 0 { + data["kill_unit_count"] = gorm.Expr("kill_unit_count + ?", props.KillUnitCount) } - if props.DeKillUnitCount != nil { - data["de_kill_unit_count"] = gorm.Expr("de_kill_unit_count + ?", *props.DeKillUnitCount) + if props.DeKillUnitCount != 0 { + data["de_kill_unit_count"] = gorm.Expr("de_kill_unit_count + ?", props.DeKillUnitCount) } if props.Win { data["win_count"] = gorm.Expr("win_count + 1") @@ -95,8 +95,8 @@ func (m *customStatisticsPvpModel) UpdateRecord(ctx context.Context, tx *gorm.DB if props.Lost { data["lost_count"] = gorm.Expr("lost_count + 1") } - if props.KillPlayer { - data["kill_player_count"] = gorm.Expr("kill_player_count + 1") + if props.KillPlayer != 0 { + data["kill_player_count"] = gorm.Expr("kill_player_count + ?", props.KillPlayer) } if props.DeKillPlayer { data["de_kill_player_count"] = gorm.Expr("de_kill_player_count + 1") @@ -139,11 +139,11 @@ func (m *customStatisticsPvpModel) FindGreaterByScore(ctx context.Context, score Where(whereSql, score). Order(fmt.Sprintf("%s.%s desc", m.table, scoreType)). Limit(limit).Find(&result).Error - selectResult, err := gormx.WrapSelectResult(err, result) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return selectResult.([]UserAndScore), nil + return result, nil } func (m *customStatisticsPvpModel) FindScoreByType(ctx context.Context, tx *gorm.DB, userId int64, scoreType []ScoreType) (map[string]int64, error) { @@ -157,7 +157,7 @@ func (m *customStatisticsPvpModel) FindScoreByType(ctx context.Context, tx *gorm err := db.Table(m.table). Select(selectFields). Where("user_id = ?", userId).Take(&resp).Error - _, err = gormx.WrapSelectResult(err, resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } diff --git a/app/user_center/model/statistics_pvp_model_gen.go b/app/user_center/model/statistics_pvp_model_gen.go index ae97db9..fef7744 100644 --- a/app/user_center/model/statistics_pvp_model_gen.go +++ b/app/user_center/model/statistics_pvp_model_gen.go @@ -70,11 +70,11 @@ func (m *defaultStatisticsPvpModel) Insert(ctx context.Context, tx *gorm.DB, dat func (m *defaultStatisticsPvpModel) FindOne(ctx context.Context, tx *gorm.DB, userId int64) (*StatisticsPvp, error) { var resp StatisticsPvp err := gormx.WithTx(ctx, m.DB, tx).Model(&StatisticsPvp{}).Where("`user_id` = ?", userId).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*StatisticsPvp), nil + return &resp, nil } func (m *defaultStatisticsPvpModel) Update(ctx context.Context, tx *gorm.DB, data *StatisticsPvp) error { diff --git a/app/user_center/model/user_check_in_model.go b/app/user_center/model/user_check_in_model.go index e3b6f8e..5717048 100644 --- a/app/user_center/model/user_check_in_model.go +++ b/app/user_center/model/user_check_in_model.go @@ -40,11 +40,11 @@ func (m *customUserCheckInModel) FindThisWeek(ctx context.Context, tx *gorm.DB, err := db.Model(&UserCheckIn{}). Where("user_id = ? AND check_in_time >= ", userId, now.Monday()). Order("check_in_time ASC").Find(resp).Error - result, err := gormx.WrapSelectResult(err, resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.([]UserCheckIn), nil + return resp, nil } func (m *customUserCheckInModel) CheckInToday(ctx context.Context, tx *gorm.DB, userId int64) (bool, error) { diff --git a/app/user_center/model/user_check_in_model_gen.go b/app/user_center/model/user_check_in_model_gen.go index 47590fb..b536fba 100644 --- a/app/user_center/model/user_check_in_model_gen.go +++ b/app/user_center/model/user_check_in_model_gen.go @@ -58,11 +58,11 @@ func (m *defaultUserCheckInModel) Insert(ctx context.Context, tx *gorm.DB, data func (m *defaultUserCheckInModel) FindOne(ctx context.Context, tx *gorm.DB, id int64) (*UserCheckIn, error) { var resp UserCheckIn err := gormx.WithTx(ctx, m.DB, tx).Model(&UserCheckIn{}).Where("`id` = ?", id).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserCheckIn), nil + return &resp, nil } func (m *defaultUserCheckInModel) Update(ctx context.Context, tx *gorm.DB, data *UserCheckIn) error { diff --git a/app/user_center/model/user_coin_model_gen.go b/app/user_center/model/user_coin_model_gen.go index 5b7fec8..f040690 100644 --- a/app/user_center/model/user_coin_model_gen.go +++ b/app/user_center/model/user_coin_model_gen.go @@ -61,11 +61,11 @@ func (m *defaultUserCoinModel) Insert(ctx context.Context, tx *gorm.DB, data *Us func (m *defaultUserCoinModel) FindOne(ctx context.Context, tx *gorm.DB, userId int64) (*UserCoin, error) { var resp UserCoin err := gormx.WithTx(ctx, m.DB, tx).Model(&UserCoin{}).Where("`user_id` = ?", userId).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserCoin), nil + return &resp, nil } func (m *defaultUserCoinModel) Update(ctx context.Context, tx *gorm.DB, data *UserCoin) error { diff --git a/app/user_center/model/user_elite_model.go b/app/user_center/model/user_elite_model.go new file mode 100644 index 0000000..0c52f8e --- /dev/null +++ b/app/user_center/model/user_elite_model.go @@ -0,0 +1,132 @@ +package model + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" + "git.noahlan.cn/northlan/ntools-go/uuid" + "github.com/jinzhu/now" + "github.com/pkg/errors" + "gorm.io/gorm" + "live-service/common/nerr" + "live-service/common/timex" + "time" +) + +var _ UserEliteModel = (*customUserEliteModel)(nil) + +type ( + // UserEliteModel is an interface to be customized, add more methods here, + // and implement the added methods in customUserEliteModel. + UserEliteModel interface { + userEliteModel + // FindMaxSort 寻找当前用户精英单位的最大Sort 最小值2 + FindMaxSort(ctx context.Context, tx *gorm.DB, userId int64) int64 + // FindOneByUserIdSort 通过用户和排序号找寻精英单位 + FindOneByUserIdSort(ctx context.Context, tx *gorm.DB, userId int64, sort int64) (*UserElite, error) + // FindByUserId 查找用户所有列表,按sort升序排列 + FindByUserId(ctx context.Context, tx *gorm.DB, userId int64) ([]UserElite, error) + // Addon 添加新的或延长时间 + Addon(ctx context.Context, tx *gorm.DB, userId, eliteId int64, duration time.Duration, forever bool) error + } + + customUserEliteModel struct { + *defaultUserEliteModel + } +) + +// NewUserEliteModel returns a model for the database table. +func NewUserEliteModel(conn *gorm.DB) UserEliteModel { + return &customUserEliteModel{ + defaultUserEliteModel: newUserEliteModel(conn), + } +} + +func (m *customUserEliteModel) FindMaxSort(ctx context.Context, tx *gorm.DB, userId int64) int64 { + db := gormx.WithTx(ctx, m.DB, tx) + var resp int64 = 1 + + db.Table(m.table). + Select("MAX(sort)"). + Where("user_id = ?", userId). + Where("end_time > ?", now.BeginningOfDay()).Take(&resp) + + return resp +} + +func (m *customUserEliteModel) FindOneByUserIdSort(ctx context.Context, tx *gorm.DB, userId int64, sort int64) (*UserElite, error) { + db := gormx.WithTx(ctx, m.DB, tx) + var resp UserElite + err := db.Model(&UserElite{}). + Where("user_id = ? and sort = ?", userId, sort).Take(&resp).Error + err = gormx.WrapSelectErr(err) + if err != nil { + return nil, err + } + return &resp, nil +} + +func (m *customUserEliteModel) FindByUserId(ctx context.Context, tx *gorm.DB, userId int64) ([]UserElite, error) { + var resp []UserElite + err := gormx.WithTx(ctx, m.DB, tx).Table(m.table). + Where("user_id = ?", userId). + Order("sort asc").Find(&resp).Error + err = gormx.WrapSelectErr(err) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *customUserEliteModel) Addon(ctx context.Context, tx *gorm.DB, userId, eliteId int64, duration time.Duration, forever bool) error { + return m.TransactCtx(ctx, tx, func(tx *gorm.DB) error { + userElite, err := m.FindOneByUserIdEliteId(ctx, tx, userId, eliteId) + if err != nil { + if !errors.Is(err, gormx.ErrNotFound) { + return nerr.NewWithCode(nerr.DBError) + } + } + today := now.BeginningOfDay() + + if userElite == nil { + // sort + maxSort := m.FindMaxSort(ctx, tx, userId) + err = m.Insert(ctx, tx, &UserElite{ + Id: uuid.NextId(), + UserId: userId, + EliteId: eliteId, + Sort: maxSort + 1, + Forever: BitBool(forever), + StartTime: today, + EndTime: today.Add(duration), + }) + if err != nil { + return nerr.NewWithCode(nerr.DBError) + } + } else { + // update + if !timex.DayExpire(today, userElite.EndTime, bool(userElite.Forever)) { + // 未过期,endTime直接添加1day + userElite.EndTime = userElite.EndTime.Add(duration) + err = m.Update(ctx, tx, userElite) + if err != nil { + return nerr.NewWithCode(nerr.DBError) + } + } else { + // 过期,更新日期 + err = m.Update(ctx, tx, &UserElite{ + Id: userElite.Id, + UserId: userId, + EliteId: eliteId, + Sort: userElite.Sort, + Forever: BitBool(forever), + StartTime: today, + EndTime: today.Add(duration), + }) + if err != nil { + return nerr.NewWithCode(nerr.DBError) + } + } + } + return nil + }) +} diff --git a/app/user_center/model/user_elite_model_gen.go b/app/user_center/model/user_elite_model_gen.go new file mode 100644 index 0000000..892c3ea --- /dev/null +++ b/app/user_center/model/user_elite_model_gen.go @@ -0,0 +1,100 @@ +// Code generated by goctl. DO NOT EDIT! + +package model + +import ( + "context" + "strings" + "time" + + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stringx" + "gorm.io/gorm" +) + +var ( + userEliteFieldNames = builder.RawFieldNames(&UserElite{}) + userEliteRows = strings.Join(userEliteFieldNames, ",") + userEliteRowsExpectAutoSet = strings.Join(stringx.Remove(userEliteFieldNames, "`create_time`", "`update_time`"), ",") + userEliteRowsWithPlaceHolder = strings.Join(stringx.Remove(userEliteFieldNames, "`id`", "`create_time`", "`update_time`"), "=?,") + "=?" +) + +type ( + userEliteModel interface { + gormx.TxModel + Insert(ctx context.Context, tx *gorm.DB, data *UserElite) error + FindOne(ctx context.Context, tx *gorm.DB, id int64) (*UserElite, error) + FindOneByUserIdEliteId(ctx context.Context, tx *gorm.DB, userId int64, eliteId int64) (*UserElite, error) + Update(ctx context.Context, tx *gorm.DB, data *UserElite) error + Delete(ctx context.Context, tx *gorm.DB, id int64) error + } + + defaultUserEliteModel struct { + gormx.GormConn + table string + } + + UserElite struct { + Id int64 `gorm:"column:id;primaryKey"` // 主键ID + UserId int64 `gorm:"column:user_id"` // 用户ID + EliteId int64 `gorm:"column:elite_id"` // 精英单位ID + Sort int64 `gorm:"column:sort"` // 排序号 + Forever BitBool `gorm:"forever"` // 永久 + StartTime time.Time `gorm:"column:start_time;default:null"` // 开始时间 + EndTime time.Time `gorm:"column:end_time;default:null"` // 结束时间 + } +) + +var UserEliteTableName = "`user_elite`" + +func newUserEliteModel(conn *gorm.DB) *defaultUserEliteModel { + return &defaultUserEliteModel{ + GormConn: gormx.NewConn(conn), + table: UserEliteTableName, + } +} + +func (m *defaultUserEliteModel) Insert(ctx context.Context, tx *gorm.DB, data *UserElite) error { + err := gormx.WithTx(ctx, m.DB, tx).Create(&data).Error + return err +} + +func (m *defaultUserEliteModel) FindOne(ctx context.Context, tx *gorm.DB, id int64) (*UserElite, error) { + var resp UserElite + err := gormx.WithTx(ctx, m.DB, tx).Model(&UserElite{}).Where("`id` = ?", id).Take(&resp).Error + if err = gormx.WrapSelectErr(err); err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultUserEliteModel) FindOneByUserIdEliteId(ctx context.Context, tx *gorm.DB, userId int64, eliteId int64) (*UserElite, error) { + var resp UserElite + err := gormx.WithTx(ctx, m.DB, tx).Model(&UserElite{}).Where("`user_id` = ? and `elite_id` = ?", userId, eliteId).Take(&resp).Error + if err = gormx.WrapSelectErr(err); err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultUserEliteModel) Update(ctx context.Context, tx *gorm.DB, data *UserElite) error { + + result := gormx.WithTx(ctx, m.DB, tx).Save(data) + return gormx.WrapUpdateErr(result.Error, result.RowsAffected) + +} + +func (m *defaultUserEliteModel) Delete(ctx context.Context, tx *gorm.DB, id int64) error { + err := gormx.WithTx(ctx, m.DB, tx).Delete(&UserElite{}, id).Error + + return err +} + +func (m *defaultUserEliteModel) tableName() string { + return m.table +} + +func (UserElite) TableName() string { + return UserEliteTableName +} diff --git a/app/user_center/model/user_gift_model_gen.go b/app/user_center/model/user_gift_model_gen.go index 4ce359b..a1f347a 100644 --- a/app/user_center/model/user_gift_model_gen.go +++ b/app/user_center/model/user_gift_model_gen.go @@ -65,11 +65,11 @@ func (m *defaultUserGiftModel) Insert(ctx context.Context, tx *gorm.DB, data *Us func (m *defaultUserGiftModel) FindOne(ctx context.Context, tx *gorm.DB, id int64) (*UserGift, error) { var resp UserGift err := gormx.WithTx(ctx, m.DB, tx).Model(&UserGift{}).Where("`id` = ?", id).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserGift), nil + return &resp, nil } func (m *defaultUserGiftModel) Update(ctx context.Context, tx *gorm.DB, data *UserGift) error { diff --git a/app/user_center/model/user_integral_model_gen.go b/app/user_center/model/user_integral_model_gen.go index 5613817..00139e4 100644 --- a/app/user_center/model/user_integral_model_gen.go +++ b/app/user_center/model/user_integral_model_gen.go @@ -61,11 +61,11 @@ func (m *defaultUserIntegralModel) Insert(ctx context.Context, tx *gorm.DB, data func (m *defaultUserIntegralModel) FindOne(ctx context.Context, tx *gorm.DB, userId int64) (*UserIntegral, error) { var resp UserIntegral err := gormx.WithTx(ctx, m.DB, tx).Model(&UserIntegral{}).Where("`user_id` = ?", userId).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserIntegral), nil + return &resp, nil } func (m *defaultUserIntegralModel) Update(ctx context.Context, tx *gorm.DB, data *UserIntegral) error { diff --git a/app/user_center/model/user_model_gen.go b/app/user_center/model/user_model_gen.go index 2dbadb3..1c92984 100644 --- a/app/user_center/model/user_model_gen.go +++ b/app/user_center/model/user_model_gen.go @@ -59,11 +59,11 @@ func (m *defaultUserModel) Insert(ctx context.Context, tx *gorm.DB, data *User) func (m *defaultUserModel) FindOne(ctx context.Context, tx *gorm.DB, id int64) (*User, error) { var resp User err := gormx.WithTx(ctx, m.DB, tx).Model(&User{}).Where("`id` = ?", id).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*User), nil + return &resp, nil } func (m *defaultUserModel) Update(ctx context.Context, tx *gorm.DB, data *User) error { diff --git a/app/user_center/model/user_nobility_model_gen.go b/app/user_center/model/user_nobility_model_gen.go index 7eeaecf..f11a2a4 100644 --- a/app/user_center/model/user_nobility_model_gen.go +++ b/app/user_center/model/user_nobility_model_gen.go @@ -62,11 +62,11 @@ func (m *defaultUserNobilityModel) Insert(ctx context.Context, tx *gorm.DB, data func (m *defaultUserNobilityModel) FindOne(ctx context.Context, tx *gorm.DB, userId int64) (*UserNobility, error) { var resp UserNobility err := gormx.WithTx(ctx, m.DB, tx).Model(&UserNobility{}).Where("`user_id` = ?", userId).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserNobility), nil + return &resp, nil } func (m *defaultUserNobilityModel) Update(ctx context.Context, tx *gorm.DB, data *UserNobility) error { diff --git a/app/user_center/model/user_platform_model.go b/app/user_center/model/user_platform_model.go index 12d8255..46c0ede 100644 --- a/app/user_center/model/user_platform_model.go +++ b/app/user_center/model/user_platform_model.go @@ -22,15 +22,17 @@ type ( FindEmptyList(ctx context.Context, num int64) ([]UserPlatform, error) // FindUpdatableList 查询过期需要更新信息的用户 FindUpdatableList(ctx context.Context, duration int64, num int64) ([]UserPlatform, error) - // FindDisplayOneByUserId 查找用户信息,用户展示 - FindDisplayOneByUserId(ctx context.Context, uid int64) (*UserPlatformForDisplay, error) + // FindDisplayOneByUserId 查找用户信息,用于展示 + FindDisplayOneByUserId(ctx context.Context, uid int64) (*UserForDisplay, error) + // FindDisplayOneByPlatform 查找用户信息,用于展示 + FindDisplayOneByPlatform(ctx context.Context, tx *gorm.DB, platform string, pUid string) (*UserForDisplay, error) // UpdateNobilityByPUid 更新贵族数据 UpdateNobilityByPUid(ctx context.Context, pUid int64, nobility int64) error // FindUserIdByPlatform 根据平台与平台用户ID获取系统用户ID FindUserIdByPlatform(ctx context.Context, platform, pUid string) (int64, error) } - UserPlatformForDisplay struct { + UserForDisplay struct { UserId int64 // 用户ID PUname string // 平台用户名 PAvatar string // 平台用户头像地址 @@ -59,11 +61,11 @@ func (m *customUserPlatformModel) FindOneByPlatformAndPUid(ctx context.Context, var resp UserPlatform err := db.Model(&UserPlatform{}).Where("`platform` = ? AND `p_uid` = ?", platform, pUid).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserPlatform), nil + return &resp, nil } func (m *customUserPlatformModel) FindFullByPlatform(ctx context.Context, tx *gorm.DB, platform, pUid string) (*FullUser, error) { @@ -74,11 +76,11 @@ func (m *customUserPlatformModel) FindFullByPlatform(ctx context.Context, tx *go Joins("UserIntegral"). Where("platform = ? AND p_uid = ?", platform, pUid). Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*FullUser), nil + return &resp, nil } func (m *customUserPlatformModel) FindEmptyList(ctx context.Context, num int64) ([]UserPlatform, error) { @@ -87,11 +89,11 @@ func (m *customUserPlatformModel) FindEmptyList(ctx context.Context, num int64) Table(m.tableName()). Where("JSON_LENGTH(`p_info`) = 0 LIMIT ?", num). Find(&resp).Error - result, err := gormx.WrapSelectResult(err, resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.([]UserPlatform), nil + return resp, nil } func (m *customUserPlatformModel) FindUpdatableList(ctx context.Context, duration int64, num int64) ([]UserPlatform, error) { @@ -100,25 +102,39 @@ func (m *customUserPlatformModel) FindUpdatableList(ctx context.Context, duratio Table(m.tableName()). Where("`update_time` < (NOW() - INTERVAL ? HOUR) LIMIT ?", duration, num). Find(&resp).Error - result, err := gormx.WrapSelectResult(err, resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.([]UserPlatform), nil + return resp, nil } -func (m *customUserPlatformModel) FindDisplayOneByUserId(ctx context.Context, uid int64) (*UserPlatformForDisplay, error) { - var resp UserPlatformForDisplay +func (m *customUserPlatformModel) FindDisplayOneByUserId(ctx context.Context, uid int64) (*UserForDisplay, error) { + var resp UserForDisplay err := gormx.WithTx(ctx, m.DB, nil). Table(m.table). Select(fmt.Sprintf("%s.user_id, %s.p_uname, %s.p_avatar", m.table, m.table, m.table)). Where("user_id = ?", uid). Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) + if err != nil { + return nil, err + } + return &resp, nil +} + +func (m *customUserPlatformModel) FindDisplayOneByPlatform(ctx context.Context, tx *gorm.DB, platform string, pUid string) (*UserForDisplay, error) { + var resp UserForDisplay + err := gormx.WithTx(ctx, m.DB, tx). + Table(m.table). + Select(fmt.Sprintf("%s.user_id, %s.p_uname, %s.p_avatar", m.table, m.table, m.table)). + Where("platform = ? AND p_uid = ?", platform, pUid). + Take(&resp).Error + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserPlatformForDisplay), nil + return &resp, nil } func (m *customUserPlatformModel) UpdateNobilityByPUid(ctx context.Context, pUid int64, nobility int64) error { @@ -134,7 +150,7 @@ func (m *customUserPlatformModel) FindUserIdByPlatform(ctx context.Context, plat Table(m.table). Select(fmt.Sprintf("%s.user_id", m.table)). Where("platform = ? AND p_uid = ?", platform, pUid).Take(&resp).Error - _, err = gormx.WrapSelectResult(err, resp) + err = gormx.WrapSelectErr(err) if err != nil { return 0, err } diff --git a/app/user_center/model/user_platform_model_gen.go b/app/user_center/model/user_platform_model_gen.go index 979e9da..6a0b80e 100644 --- a/app/user_center/model/user_platform_model_gen.go +++ b/app/user_center/model/user_platform_model_gen.go @@ -36,17 +36,16 @@ type ( } UserPlatform struct { - Id int64 `gorm:"column:id;primaryKey"` // 主键 - UserId int64 `gorm:"column:user_id"` // 用户ID - Platform string `gorm:"column:platform"` // 平台类型 - POpenid string `gorm:"column:p_openid"` // 平台用户openid - PUid string `gorm:"column:p_uid"` // 平台用户uid - PUname string `gorm:"column:p_uname"` // 平台用户名 - PInfo string `gorm:"column:p_info"` // 平台用户原始信息(json) - PAvatar string `gorm:"column:p_avatar"` // 平台用户头像地址 - PNobilityLevel int64 `gorm:"column:p_nobility_level"` // 平台贵族等级 - CreateTime time.Time `gorm:"column:create_time;default:null"` // 创建时间 - UpdateTime time.Time `gorm:"column:update_time;default:null"` // 更新时间 + Id int64 `gorm:"column:id;primaryKey"` // 主键 + UserId int64 `gorm:"column:user_id"` // 用户ID + Platform string `gorm:"column:platform"` // 平台类型 + POpenid string `gorm:"column:p_openid"` // 平台用户openid + PUid string `gorm:"column:p_uid"` // 平台用户uid + PUname string `gorm:"column:p_uname"` // 平台用户名 + PInfo string `gorm:"column:p_info"` // 平台用户原始信息(json) + PAvatar string `gorm:"column:p_avatar"` // 平台用户头像地址 + CreateTime time.Time `gorm:"column:create_time;default:null"` // 创建时间 + UpdateTime time.Time `gorm:"column:update_time;default:null"` // 更新时间 } ) @@ -67,21 +66,21 @@ func (m *defaultUserPlatformModel) Insert(ctx context.Context, tx *gorm.DB, data func (m *defaultUserPlatformModel) FindOne(ctx context.Context, tx *gorm.DB, id int64) (*UserPlatform, error) { var resp UserPlatform err := gormx.WithTx(ctx, m.DB, tx).Model(&UserPlatform{}).Where("`id` = ?", id).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserPlatform), nil + return &resp, nil } func (m *defaultUserPlatformModel) FindOneByPlatformPUid(ctx context.Context, tx *gorm.DB, platform string, pUid string) (*UserPlatform, error) { var resp UserPlatform err := gormx.WithTx(ctx, m.DB, tx).Model(&UserPlatform{}).Where("`platform` = ? and `p_uid` = ?", platform, pUid).Take(&resp).Error - result, err := gormx.WrapSelectResult(err, &resp) + err = gormx.WrapSelectErr(err) if err != nil { return nil, err } - return result.(*UserPlatform), nil + return &resp, nil } func (m *defaultUserPlatformModel) Update(ctx context.Context, tx *gorm.DB, data *UserPlatform) error { diff --git a/app/user_center/model/user_title_model.go b/app/user_center/model/user_title_model.go new file mode 100644 index 0000000..f9b7dab --- /dev/null +++ b/app/user_center/model/user_title_model.go @@ -0,0 +1,140 @@ +package model + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" + "git.noahlan.cn/northlan/ntools-go/uuid" + "github.com/jinzhu/now" + "github.com/pkg/errors" + "gorm.io/gorm" + "live-service/common/nerr" + "live-service/common/timex" + "time" +) + +var _ UserTitleModel = (*customUserTitleModel)(nil) + +const ( + TitleTypeDefault = "default" // 默认类型 可购买 + TitleTypeRank = "rank" // 排行榜类型 不可购买 + TitleTypeCustom = "custom" // 自定义类型 不可购买 +) + +type ( + // UserTitleModel is an interface to be customized, add more methods here, + // and implement the added methods in customUserTitleModel. + UserTitleModel interface { + userTitleModel + // FindMaxSort 寻找当前用户的最大Sort 最小值2 + FindMaxSort(ctx context.Context, tx *gorm.DB, userId int64) int64 + // FindOneByUserIdSort 通过用户和排序号找寻称号 + FindOneByUserIdSort(ctx context.Context, tx *gorm.DB, userId int64, sort int64) (*UserTitle, error) + // FindByUserId 查找用户所有列表,按sort升序排列 + FindByUserId(ctx context.Context, tx *gorm.DB, userId int64) ([]UserTitle, error) + // Addon 添加新的或延长时间 + Addon(ctx context.Context, tx *gorm.DB, userId, titleId int64, titleType string, duration time.Duration, forever bool) error + } + + customUserTitleModel struct { + *defaultUserTitleModel + } +) + +// NewUserTitleModel returns a model for the database table. +func NewUserTitleModel(conn *gorm.DB) UserTitleModel { + return &customUserTitleModel{ + defaultUserTitleModel: newUserTitleModel(conn), + } +} + +func (m *customUserTitleModel) FindMaxSort(ctx context.Context, tx *gorm.DB, userId int64) int64 { + db := gormx.WithTx(ctx, m.DB, tx) + var resp int64 = 1 + + db.Table(m.table). + Select("MAX(sort)"). + Where("user_id = ?", userId). + Where("end_time > ?", now.BeginningOfDay()).Take(&resp) + + return resp +} + +func (m *customUserTitleModel) FindOneByUserIdSort(ctx context.Context, tx *gorm.DB, userId int64, sort int64) (*UserTitle, error) { + db := gormx.WithTx(ctx, m.DB, tx) + var resp UserTitle + err := db.Model(&UserTitle{}). + Where("user_id = ? and sort = ?", userId, sort).Take(&resp).Error + err = gormx.WrapSelectErr(err) + if err != nil { + return nil, err + } + return &resp, nil +} + +func (m *customUserTitleModel) FindByUserId(ctx context.Context, tx *gorm.DB, userId int64) ([]UserTitle, error) { + var resp []UserTitle + err := gormx.WithTx(ctx, m.DB, tx).Table(m.table). + Where("user_id = ?", userId). + Order("sort asc").Find(&resp).Error + err = gormx.WrapSelectErr(err) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *customUserTitleModel) Addon(ctx context.Context, tx *gorm.DB, userId, titleId int64, titleType string, duration time.Duration, forever bool) error { + return m.TransactCtx(ctx, tx, func(tx *gorm.DB) error { + userTitle, err := m.FindOneByUserIdTitleId(ctx, tx, userId, titleId) + if err != nil { + if !errors.Is(err, gormx.ErrNotFound) { + return nerr.NewWithCode(nerr.DBError) + } + } + today := now.BeginningOfDay() + + if userTitle == nil { + // sort + maxSort := m.FindMaxSort(ctx, tx, userId) + err = m.Insert(ctx, tx, &UserTitle{ + Id: uuid.NextId(), + UserId: userId, + TitleId: titleId, + Sort: maxSort + 1, + Type: titleType, + Forever: BitBool(forever), + StartTime: today, + EndTime: today.Add(duration), + }) + if err != nil { + return nerr.NewWithCode(nerr.DBError) + } + } else { + // update + if !timex.DayExpire(today, userTitle.EndTime, bool(userTitle.Forever)) { + // 未过期,endTime直接添加1day + userTitle.EndTime = userTitle.EndTime.Add(duration) + err = m.Update(ctx, tx, userTitle) + if err != nil { + return nerr.NewWithCode(nerr.DBError) + } + } else { + // 过期,更新日期 + err = m.Update(ctx, tx, &UserTitle{ + Id: userTitle.Id, + UserId: userId, + TitleId: titleId, + Sort: userTitle.Sort, + Type: titleType, + Forever: BitBool(forever), + StartTime: today, + EndTime: today.Add(duration), + }) + if err != nil { + return nerr.NewWithCode(nerr.DBError) + } + } + } + return nil + }) +} diff --git a/app/user_center/model/user_title_model_gen.go b/app/user_center/model/user_title_model_gen.go new file mode 100644 index 0000000..0c26d75 --- /dev/null +++ b/app/user_center/model/user_title_model_gen.go @@ -0,0 +1,101 @@ +// Code generated by goctl. DO NOT EDIT! + +package model + +import ( + "context" + "strings" + "time" + + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stringx" + "gorm.io/gorm" +) + +var ( + userTitleFieldNames = builder.RawFieldNames(&UserTitle{}) + userTitleRows = strings.Join(userTitleFieldNames, ",") + userTitleRowsExpectAutoSet = strings.Join(stringx.Remove(userTitleFieldNames, "`create_time`", "`update_time`"), ",") + userTitleRowsWithPlaceHolder = strings.Join(stringx.Remove(userTitleFieldNames, "`id`", "`create_time`", "`update_time`"), "=?,") + "=?" +) + +type ( + userTitleModel interface { + gormx.TxModel + Insert(ctx context.Context, tx *gorm.DB, data *UserTitle) error + FindOne(ctx context.Context, tx *gorm.DB, id int64) (*UserTitle, error) + FindOneByUserIdTitleId(ctx context.Context, tx *gorm.DB, userId int64, titleId int64) (*UserTitle, error) + Update(ctx context.Context, tx *gorm.DB, data *UserTitle) error + Delete(ctx context.Context, tx *gorm.DB, id int64) error + } + + defaultUserTitleModel struct { + gormx.GormConn + table string + } + + UserTitle struct { + Id int64 `gorm:"column:id;primaryKey"` // 主键ID + UserId int64 `gorm:"column:user_id"` // 用户ID + TitleId int64 `gorm:"column:title_id"` // 称号ID + Sort int64 `gorm:"column:sort"` // 排序号 + Type string `gorm:"type"` // 称号类型 + Forever BitBool `gorm:"forever"` // 永久 + StartTime time.Time `gorm:"column:start_time;default:null"` // 开始时间 + EndTime time.Time `gorm:"column:end_time;default:null"` // 结束时间 + } +) + +var UserTitleTableName = "`user_title`" + +func newUserTitleModel(conn *gorm.DB) *defaultUserTitleModel { + return &defaultUserTitleModel{ + GormConn: gormx.NewConn(conn), + table: UserTitleTableName, + } +} + +func (m *defaultUserTitleModel) Insert(ctx context.Context, tx *gorm.DB, data *UserTitle) error { + err := gormx.WithTx(ctx, m.DB, tx).Create(&data).Error + return err +} + +func (m *defaultUserTitleModel) FindOne(ctx context.Context, tx *gorm.DB, id int64) (*UserTitle, error) { + var resp UserTitle + err := gormx.WithTx(ctx, m.DB, tx).Model(&UserTitle{}).Where("`id` = ?", id).Take(&resp).Error + if err = gormx.WrapSelectErr(err); err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultUserTitleModel) FindOneByUserIdTitleId(ctx context.Context, tx *gorm.DB, userId int64, titleId int64) (*UserTitle, error) { + var resp UserTitle + err := gormx.WithTx(ctx, m.DB, tx).Model(&UserTitle{}).Where("`user_id` = ? and `title_id` = ?", userId, titleId).Take(&resp).Error + if err = gormx.WrapSelectErr(err); err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultUserTitleModel) Update(ctx context.Context, tx *gorm.DB, data *UserTitle) error { + + result := gormx.WithTx(ctx, m.DB, tx).Save(data) + return gormx.WrapUpdateErr(result.Error, result.RowsAffected) + +} + +func (m *defaultUserTitleModel) Delete(ctx context.Context, tx *gorm.DB, id int64) error { + err := gormx.WithTx(ctx, m.DB, tx).Delete(&UserTitle{}, id).Error + + return err +} + +func (m *defaultUserTitleModel) tableName() string { + return m.table +} + +func (UserTitle) TableName() string { + return UserTitleTableName +} diff --git a/app/user_center/model/zhg_user_details_model.go b/app/user_center/model/zhg_user_details_model.go new file mode 100644 index 0000000..6092636 --- /dev/null +++ b/app/user_center/model/zhg_user_details_model.go @@ -0,0 +1,59 @@ +package model + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" + "github.com/pkg/errors" + "gorm.io/gorm" + "gorm.io/gorm/clause" +) + +var _ ZhgUserDetailsModel = (*customZhgUserDetailsModel)(nil) + +type ( + // ZhgUserDetailsModel is an interface to be customized, add more methods here, + // and implement the added methods in customZhgUserDetailsModel. + ZhgUserDetailsModel interface { + zhgUserDetailsModel + // Upsert 更新或新增 + Upsert(ctx context.Context, tx *gorm.DB, param *UpsertParam) error + } + + UpsertParam struct { + UserId int64 + Elite *int64 + Title *int64 + } + + customZhgUserDetailsModel struct { + *defaultZhgUserDetailsModel + } +) + +// NewZhgUserDetailsModel returns a model for the database table. +func NewZhgUserDetailsModel(conn *gorm.DB) ZhgUserDetailsModel { + return &customZhgUserDetailsModel{ + defaultZhgUserDetailsModel: newZhgUserDetailsModel(conn), + } +} + +func (m *customZhgUserDetailsModel) Upsert(ctx context.Context, tx *gorm.DB, param *UpsertParam) error { + data := &ZhgUserDetails{UserId: param.UserId} + updateColumns := make([]string, 0) + if param.Title != nil { + updateColumns = append(updateColumns, "title") + data.Title = *param.Title + } + if param.Elite != nil { + updateColumns = append(updateColumns, "elite") + data.Elite = *param.Elite + } + if len(updateColumns) <= 0 { + return errors.New("错误,待更新字段数不能小于0") + } + db := gormx.WithTx(ctx, m.DB, tx) + result := db.Clauses(clause.OnConflict{ + DoUpdates: clause.AssignmentColumns(updateColumns), + }).Create(&data) + return gormx.WrapUpdateErr(result.Error, result.RowsAffected) +} diff --git a/app/user_center/model/zhg_user_details_model_gen.go b/app/user_center/model/zhg_user_details_model_gen.go new file mode 100644 index 0000000..8451a0a --- /dev/null +++ b/app/user_center/model/zhg_user_details_model_gen.go @@ -0,0 +1,85 @@ +// Code generated by goctl. DO NOT EDIT! + +package model + +import ( + "context" + "strings" + + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stringx" + "gorm.io/gorm" +) + +var ( + zhgUserDetailsFieldNames = builder.RawFieldNames(&ZhgUserDetails{}) + zhgUserDetailsRows = strings.Join(zhgUserDetailsFieldNames, ",") + zhgUserDetailsRowsExpectAutoSet = strings.Join(stringx.Remove(zhgUserDetailsFieldNames, "`create_time`", "`update_time`"), ",") + zhgUserDetailsRowsWithPlaceHolder = strings.Join(stringx.Remove(zhgUserDetailsFieldNames, "`user_id`", "`create_time`", "`update_time`"), "=?,") + "=?" +) + +type ( + zhgUserDetailsModel interface { + gormx.TxModel + Insert(ctx context.Context, tx *gorm.DB, data *ZhgUserDetails) error + FindOne(ctx context.Context, tx *gorm.DB, userId int64) (*ZhgUserDetails, error) + Update(ctx context.Context, tx *gorm.DB, data *ZhgUserDetails) error + Delete(ctx context.Context, tx *gorm.DB, userId int64) error + } + + defaultZhgUserDetailsModel struct { + gormx.GormConn + table string + } + + ZhgUserDetails struct { + UserId int64 `gorm:"column:user_id;primaryKey"` // 用户ID + Elite int64 `gorm:"column:elite"` // 当前使用的精英单位ID + Title int64 `gorm:"column:title"` // 当前佩戴的称号ID + } +) + +var ZhgUserDetailsTableName = "`zhg_user_details`" + +func newZhgUserDetailsModel(conn *gorm.DB) *defaultZhgUserDetailsModel { + return &defaultZhgUserDetailsModel{ + GormConn: gormx.NewConn(conn), + table: ZhgUserDetailsTableName, + } +} + +func (m *defaultZhgUserDetailsModel) Insert(ctx context.Context, tx *gorm.DB, data *ZhgUserDetails) error { + err := gormx.WithTx(ctx, m.DB, tx).Create(&data).Error + return err +} + +func (m *defaultZhgUserDetailsModel) FindOne(ctx context.Context, tx *gorm.DB, userId int64) (*ZhgUserDetails, error) { + var resp ZhgUserDetails + err := gormx.WithTx(ctx, m.DB, tx).Model(&ZhgUserDetails{}).Where("`user_id` = ?", userId).Take(&resp).Error + if err = gormx.WrapSelectErr(err); err != nil { + return nil, err + } + return &resp, nil +} + +func (m *defaultZhgUserDetailsModel) Update(ctx context.Context, tx *gorm.DB, data *ZhgUserDetails) error { + + result := gormx.WithTx(ctx, m.DB, tx).Save(data) + return gormx.WrapUpdateErr(result.Error, result.RowsAffected) + +} + +func (m *defaultZhgUserDetailsModel) Delete(ctx context.Context, tx *gorm.DB, userId int64) error { + err := gormx.WithTx(ctx, m.DB, tx).Delete(&ZhgUserDetails{}, userId).Error + + return err +} + +func (m *defaultZhgUserDetailsModel) tableName() string { + return m.table +} + +func (ZhgUserDetails) TableName() string { + return ZhgUserDetailsTableName +} diff --git a/app/user_center/rpc/etc/user_center-dev.yaml b/app/user_center/rpc/etc/user_center-dev.yaml index b24e4d5..cd05bde 100644 --- a/app/user_center/rpc/etc/user_center-dev.yaml +++ b/app/user_center/rpc/etc/user_center-dev.yaml @@ -1,6 +1,7 @@ Name: usercenter.rpc ListenOn: 127.0.0.1:40001 Timeout: 5000 +Mode: dev Etcd: Hosts: - 127.0.0.1:2379 @@ -12,12 +13,11 @@ Log: KeepDays: 7 Level: info DB: - #DataSource: root:root@tcp(192.168.1.100:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true DataSource: root:root@tcp(127.0.0.1:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true Kafka: - UserNotify: + UserCoinNotify: Addr: [ "127.0.0.1:9093" ] - Topic: "notify-user-dev" + Topic: "notify-user-coin-dev" RankUpdate: Addr: [ "127.0.0.1:9093" ] Topic: "rank-update-dev" @@ -27,13 +27,13 @@ Kafka: UserRetriever: Enabled: false UpdateDuration: 720 # 720 hours = 30 Day = 1 Month + NobilityPlatforms: [ "bilibili" ] # 需要获取贵族的平台列表 Cron: PlatformUser: "0 0/5 * * * ?" # 每隔5分钟执行一次 Nobility: "0 0/10 * * * ?" # 每隔10分钟执行一次 - NobilityPlatforms: [ "bilibili" ] # 需要获取贵族的平台列表 Bilibili: - RoomId: 8722013 - Mid: 6704420 + RoomId: 6925399 + # Mid: 6704420 RoomShortInfoApi: https://api.live.bilibili.com/room/v1/Room/room_init TopListApi: https://api.live.bilibili.com/guard/topList Rank: @@ -47,40 +47,73 @@ GiftCollector: Cron: CollectGift: "0 0 0/6 * * ?" # 每隔6小时执行一次 Coin: - # RMB到弹币的转换 - RMBToCoin: 100 - # 平台礼物到RMB的转换 - GiftToRMB: - bilibili: 0.001 - # 平台免费礼物到弹币的转换 - FreeToCoin: - bilibili: 0.00025 -Integral: - # 签到积分配置 + # 签到配置 CheckIn: - # 签到积分 一周 0(周日) 1 2 3 4 5 6 - Points: [ 15000,3000,3500,5000,6500,8000,10000 ] - Critical: 0.15 # 签到积分暴击率 - CriticalRadio: [ 1.3, 1.5, 1.8, 2.0, 2.0, 3.0 ] # 暴击倍率 - BattleReport: - GeneralIntegral: 1000 # 名将积分 - WinRadio: 0.02 # 伤害量 1/50 - LostRadio: 0.008 # 伤害量 1/120 - RewardPool: - InitReward: 0 - Ratio: 0.7 - BattleRatio: 0.75 - GiftRatio: 0.5 - ReturnRatio: 0.8 - WelfareRatio: 0.3 + # 签到 一周 0(周日) 1 2 3 4 5 6 + Points: [ 60,10,15,20,25,30,50 ] + Critical: 0.08 # 签到暴击率 + CriticalRadio: [ 1.2, 1.3, 1.5 ] # 暴击倍率 # RMB到弹币的转换 - RMBToIntegral: 100 + RMBToCoin: 10 # 平台礼物到RMB的转换 GiftToRMB: bilibili: 0.001 # 平台免费礼物到弹币的转换 - FreeToIntegral: - bilibili: 0.00025 + FreeToCoin: + bilibili: 0.01 # 价值1毛 +Elite: + LiveDict: { "1": "1001", "2": "1002" } + Default: + Id: 0 + Sort: 1 + Items: + - Id: 1001 + PriceDay: 100 + PriceForever: 10000 + - Id: 1002 + PriceDay: 100 + PriceForever: 10000 +Title: + LiveDict: { "1": "3" } + Items: + - Id: 99999 + Name: 无上意志 + Type: custom + - Id: 1 + Name: 祁池帝姬 + Type: custom + - Id: 2 + Name: 废物舰长 + Type: custom + - Id: 3 + Name: 无用之人 + Type: default + PriceDay: 50 + PriceForever: 100000 + - Id: 1000 + Name: 三军统帅 # 名将榜首 + Type: rank + RankType: 3 + - Id: 1001 + Name: 人屠 # 小兵击杀榜首 + Type: rank + RankType: 5 + - Id: 1002 + Name: 破营 # 拆迁榜首 + Type: rank + RankType: 7 + - Id: 1003 + Name: 不败 # 常胜榜首 + Type: rank + RankType: 9 + - Id: 1004 + Name: 勇冠三军 # 一血榜首 + Type: rank + RankType: 11 + - Id: 1005 + Name: 求放过 # 被一血榜首 + Type: rank + RankType: 12 GiftPackMap: - PackType: starter PackName: 新手礼包 @@ -90,7 +123,7 @@ GiftPackMap: StartTime: "2022-05-21 09:00:00" EndTime: "2022-05-21 09:00:00" Content: - Integral: 50000 + Coin: 50 - PackType: subsistence PackName: 低保 Condition: @@ -99,4 +132,4 @@ GiftPackMap: StartTime: "2022-05-21 09:00:00" EndTime: "2022-05-21 09:00:00" Content: - Integrals: [ 10000, 8000, 4000 ] \ No newline at end of file + Coins: [ 10, 15, 20 ] \ No newline at end of file diff --git a/app/user_center/rpc/internal/common/coin_manager/manager.go b/app/user_center/rpc/internal/common/coin_manager/manager.go new file mode 100644 index 0000000..ab87b71 --- /dev/null +++ b/app/user_center/rpc/internal/common/coin_manager/manager.go @@ -0,0 +1,153 @@ +package coin_manager + +import ( + "context" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + pbMq "live-service/app/pb/mq" + pbVars "live-service/app/pb/vars" + "live-service/app/user_center/model" + "live-service/app/user_center/rpc/internal/mq" + "live-service/app/user_center/rpc/pb" + "live-service/common/nerr" +) + +type ( + Manager struct { + userCoinModel model.UserCoinModel + userMq *mq.UserMq + + logx.Logger + } + ChangeCoinReq struct { + BattleId int64 // 战局ID + UserId int64 // 用户ID + Change int64 // 变化量(负数为减扣) + } + ChangeCoinResp struct { + BattleId int64 // 战局ID + UserId int64 // 用户ID + Change int64 // 变化量(负数为减扣) + Current int64 // 当前量 + } +) + +func NewCoinManager(mod model.UserCoinModel, userMq *mq.UserMq) *Manager { + return &Manager{ + userCoinModel: mod, + userMq: userMq, + Logger: logx.WithContext(context.Background()), + } +} + +func (m *Manager) GetUserCoin(ctx context.Context, userId int64) (int64, error) { + resp, err := m.userCoinModel.FindOne(ctx, nil, userId) + if err != nil { + return 0, err + } + return resp.Coin, err +} + +func (m *Manager) TransferCoin(ctx context.Context, req *pb.TransferUserCoinReq) (*pb.TransferUserCoinResp, error) { + if req.Transfer < 0 { + req.Transfer = -req.Transfer + } + resp := &pb.TransferUserCoinResp{ + UserId: req.UserId, + TargetUserId: req.TargetUserId, + } + if err := m.userCoinModel.TransactCtx(ctx, nil, func(tx *gorm.DB) error { + if req.UserId == 0 { + return nerr.NewError(nerr.RequestParamError, "源用户ID为空") + } + if req.TargetUserId == 0 { + return nerr.NewError(nerr.RequestParamError, "目标用户ID为空") + } + coin, err := m.userCoinModel.ChangeCoin(ctx, tx, req.UserId, -req.Transfer) + if err != nil { + return nerr.NewWithErr(err) + } + targetCoin, err := m.userCoinModel.ChangeCoin(ctx, tx, req.TargetUserId, req.Transfer) + if err != nil { + return nerr.NewWithErr(err) + } + resp.UserCoin = coin + resp.TargetUserCoin = targetCoin + + // 通知 + go func() { + m.userMq.NotifyUserCoinChanged(&pbMq.MqUserCoinChanged{ + UserId: req.UserId, + Change: -req.Transfer, + Current: coin, + Reason: pbVars.UserCoinChangedReason_Transfer, + }) + m.userMq.NotifyUserCoinChanged(&pbMq.MqUserCoinChanged{ + UserId: req.TargetUserId, + Change: req.Transfer, + Current: targetCoin, + Reason: pbVars.UserCoinChangedReason_Transfer, + }) + }() + + return nil + }); err != nil { + return nil, err + } + return resp, nil +} + +func (m *Manager) ChangeCoin(ctx context.Context, tx *gorm.DB, req *ChangeCoinReq, reason pbVars.UserCoinChangedReason) (*ChangeCoinResp, error) { + coin, err := m.userCoinModel.ChangeCoin(ctx, tx, req.UserId, req.Change) + if err != nil { + return nil, err + } + + // 通知 + go m.userMq.NotifyUserCoinChanged(&pbMq.MqUserCoinChanged{ + UserId: req.UserId, + Change: req.Change, + Current: coin, + Reason: reason, + }) + + return &ChangeCoinResp{ + UserId: req.UserId, + Change: req.Change, + Current: coin, + }, nil +} + +func (m *Manager) ChangeCoinBatch(ctx context.Context, req []ChangeCoinReq, reason pbVars.UserCoinChangedReason) (map[int64]ChangeCoinResp, error) { + resp := make(map[int64]ChangeCoinResp) + if err := m.userCoinModel.TransactCtx(ctx, nil, func(tx *gorm.DB) error { + for _, item := range req { + coin, err := m.userCoinModel.ChangeCoin(ctx, tx, item.UserId, item.Change) + if err != nil { + return err + } + resp[item.UserId] = ChangeCoinResp{ + BattleId: item.BattleId, + UserId: item.UserId, + Change: item.Change, + Current: coin, + } + } + return nil + }); err != nil { + return resp, err + } + + go func() { + for _, coinResp := range resp { + m.userMq.NotifyUserCoinChanged(&pbMq.MqUserCoinChanged{ + UserId: coinResp.UserId, + Change: coinResp.Change, + Current: coinResp.Current, + Reason: reason, + }) + } + }() + + return resp, nil +} diff --git a/app/user_center/rpc/internal/common/integral_manager/manager.go b/app/user_center/rpc/internal/common/integral_manager/manager.go deleted file mode 100644 index 89196d2..0000000 --- a/app/user_center/rpc/internal/common/integral_manager/manager.go +++ /dev/null @@ -1,132 +0,0 @@ -package integral_manager - -import ( - "context" - "github.com/zeromicro/go-zero/core/logx" - "gorm.io/gorm" - "live-service/app/user_center/model" - "live-service/app/user_center/rpc/internal/common/reward_pool" - "live-service/app/user_center/rpc/pb" - "live-service/common/nerr" -) - -type ( - Manager struct { - cfg Config // 配置 - userIntegralModel model.UserIntegralModel - rewardPoolManager *reward_pool.PoolManager - - logx.Logger - } - Config struct { - GiftRatio float64 - } - ChangeIntegralReq struct { - BattleId int64 // 战局ID - UserId int64 // 用户ID - Change int64 // 变化量(负数为减扣) - Type pb.IntegralType // 积分类型 - } - ChangeIntegralResp struct { - BattleId int64 // 战局ID - UserId int64 // 用户ID - Change int64 // 变化量(负数为减扣) - Integral int64 // 剩余积分 - } -) - -func NewIntegralManager(userIntegralModel model.UserIntegralModel, rewardPoolManager *reward_pool.PoolManager) *Manager { - return &Manager{ - userIntegralModel: userIntegralModel, - rewardPoolManager: rewardPoolManager, - Logger: logx.WithContext(context.Background()), - } -} - -func (m *Manager) GetUserIntegral(ctx context.Context, userId int64) (int64, error) { - resp, err := m.userIntegralModel.FindOne(ctx, nil, userId) - if err != nil { - return 0, err - } - return resp.Integral, err -} - -func (m *Manager) TransferIntegral(ctx context.Context, req *pb.TransferUserIntegralReq) *pb.TransferUserIntegralResp { - resp := &pb.TransferUserIntegralResp{ - UserId: req.UserId, - TargetUserId: req.TargetUserId, - } - if err := m.userIntegralModel.TransactCtx(ctx, nil, func(tx *gorm.DB) error { - if req.UserId == 0 { - return nerr.NewError(nerr.RequestParamError, "源用户ID为空") - } - if req.TargetUserId == 0 { - return nerr.NewError(nerr.RequestParamError, "目标用户ID为空") - } - integral, err := m.userIntegralModel.ChangeIntegral(ctx, tx, req.UserId, -req.Transfer) - if err != nil { - return err - } - targetIntegral, err := m.userIntegralModel.ChangeIntegral(ctx, tx, req.TargetUserId, req.Transfer) - if err != nil { - return err - } - resp.Code = int32(nerr.OK) - resp.Msg = "转移成功" - resp.UserIntegral = integral - resp.TargetUserIntegral = targetIntegral - return nil - }); err != nil { - if e, ok := err.(*nerr.Error); ok { - resp.Code = int32(e.Code) - resp.Msg = e.Msg - } else { - resp.Code = int32(nerr.ServerCommonError) - resp.Msg = "转移失败,未知原因" - } - } - return resp -} - -func (m *Manager) ChangeIntegral(ctx context.Context, req *ChangeIntegralReq, rewardPool bool) (*ChangeIntegralResp, error) { - integral, err := m.userIntegralModel.ChangeIntegral(ctx, nil, req.UserId, req.Change) - if err != nil { - return nil, err - } - if req.BattleId != 0 && rewardPool { - m.rewardPoolManager.Pool(req.BattleId).Add(req.UserId, req.Change, req.Type) - } - return &ChangeIntegralResp{ - UserId: req.UserId, - Change: req.Change, - Integral: integral, - }, nil -} - -func (m *Manager) ChangeIntegralBatch(ctx context.Context, req []ChangeIntegralReq, rewardPool bool) (map[int64]ChangeIntegralResp, error) { - resp := make(map[int64]ChangeIntegralResp) - if err := m.userIntegralModel.TransactCtx(ctx, nil, func(tx *gorm.DB) error { - for _, item := range req { - integral, err := m.userIntegralModel.ChangeIntegral(ctx, tx, item.UserId, item.Change) - if err != nil { - return err - } - resp[item.UserId] = ChangeIntegralResp{ - BattleId: item.BattleId, - UserId: item.UserId, - Change: item.Change, - Integral: integral, - } - } - return nil - }); err != nil { - return resp, err - } - // 奖池 - for _, item := range req { - if item.BattleId != 0 && rewardPool { - m.rewardPoolManager.Pool(item.BattleId).Add(item.UserId, item.Change, item.Type) - } - } - return resp, nil -} diff --git a/app/user_center/rpc/internal/common/reward_pool/pool.go b/app/user_center/rpc/internal/common/reward_pool/pool.go index 5a0b697..3cf625f 100644 --- a/app/user_center/rpc/internal/common/reward_pool/pool.go +++ b/app/user_center/rpc/internal/common/reward_pool/pool.go @@ -1,9 +1,9 @@ package reward_pool import ( - "git.noahlan.cn/northlan/ntools-go/kafka" "github.com/shopspring/decimal" pbMq "live-service/app/pb/mq" + "live-service/app/user_center/rpc/internal/mq" "live-service/app/user_center/rpc/pb" "sort" "sync" @@ -31,8 +31,8 @@ type ( initReward int64 // 初始奖池 ratio Ratio // 比例 - producer *kafka.Producer // kafka - mutex sync.Mutex + rewardPoolMq *mq.RewardPool + mutex sync.Mutex } Ratio struct { @@ -58,12 +58,12 @@ type ( ) // NewRewardPoolManager 构建奖池 -func NewRewardPoolManager(initReward int64, ratio Ratio, producer *kafka.Producer) *PoolManager { +func NewRewardPoolManager(initReward int64, ratio Ratio, rewardPoolMq *mq.RewardPool) *PoolManager { return &PoolManager{ - initReward: initReward, - pools: make(map[int64]*pool), - producer: producer, - ratio: ratio, + initReward: initReward, + pools: make(map[int64]*pool), + ratio: ratio, + rewardPoolMq: rewardPoolMq, } } @@ -84,7 +84,7 @@ func (p *PoolManager) Draw(battleId int64, req []DrawRequest) *DrawResult { // 移除奖池 p.Remain(battleId) // 变动通知 - _ = p.producer.SendMessageAsync(&pbMq.MqRewardPool{ + p.rewardPoolMq.RewardPoolChanged(&pbMq.MqRewardPool{ WelfarePool: p.welfarePool, BattleId: battleId, InitReward: 0, @@ -164,7 +164,6 @@ func (p *pool) draw(req []DrawRequest) *DrawResult { remainRewards -= tmp } - // TODO 奖池分的其余用途 // 用户瓜分奖池 for _, item := range req { // 计算战斗积分分配比例 @@ -219,7 +218,7 @@ func (p *pool) Add(userId, val int64, integralType pb.IntegralType) int64 { } result := p.Rewards() // 变动通知 - _ = p.manager.producer.SendMessageAsync(&pbMq.MqRewardPool{ + p.manager.rewardPoolMq.RewardPoolChanged(&pbMq.MqRewardPool{ WelfarePool: p.manager.initReward, BattleId: p.id, InitReward: p.initReward, diff --git a/app/user_center/rpc/internal/config/config.go b/app/user_center/rpc/internal/config/config.go index 45937ee..3e21cca 100644 --- a/app/user_center/rpc/internal/config/config.go +++ b/app/user_center/rpc/internal/config/config.go @@ -1,36 +1,24 @@ package config import ( + "fmt" + "github.com/knadh/koanf" + "github.com/knadh/koanf/parsers/yaml" + "github.com/knadh/koanf/providers/file" "github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/zrpc" ) type ( - Kafka struct { + KafkaConf struct { Addr []string // 连接地址 Topic string } - GiftPack struct { - PackType string // 礼包类型 - PackName string // 礼包名称 - // Condition 领取条件 - Condition struct { - UserLimit int32 // 单人可领取数量 - UserResetType string `json:",optional"` // 用户礼包重置类型: 不重置(unset)|每天(daily)|每周(weekly)|每月(monthly) - StartTime string // 可领取时间(开始) 两个时间相等则不限期领取 - EndTime string // 可领取时间(结束) - } - // Content 礼包内容 - Content struct { - Integral int64 `json:",default=0"` // 积分数 - Integrals []int64 `json:",optional"` // 积分数(多次领取,每次不同) - // Title 奖励称号列表 - Title []struct { - Id int64 // 称号ID - Duration int64 // 持续时长,单位: 秒 -1无限 - } `json:",optional"` - } + KafkaProducer struct { + UserCoinNotify KafkaConf // 用户金币变动通知 + RankUpdate KafkaConf // 排行榜更新通知队列 + RewardPool KafkaConf // 奖池通知 } // Config 配置 @@ -41,73 +29,48 @@ type ( DataSource string } // Kafka 消息队列配置 - Kafka struct { - UserNotify Kafka // 用户信息通知队列 - RankUpdate Kafka // 排行榜更新通知队列 - RewardPool Kafka // 奖池通知 - } - UserRetriever struct { - Enabled bool // 是否开启 - UpdateDuration int64 // 用户信息更新最短间隔 单位 h - NobilityPlatforms []string // 需要获取贵族的平台 - Cron struct { - PlatformUser string - Nobility string - } - Bilibili struct { - RoomId int64 // 直播房间号 - Mid int64 `json:",optional"` // 主播UID 不输入就通过API获取 - RoomShortInfoApi string // 房间简短信息API - TopListApi string - } - } - Rank struct { - Enabled bool // 是否开启 - Cron struct { - Update string // 更新榜单 - Persistence string // 持久化 - } - } - GiftCollector struct { - Enabled bool // 是否开启 - Platforms []string // 需搜集的平台 - Cron struct { - CollectGift string - } - } - // 弹币 - Coin struct { - RMBToCoin float64 // RMB到弹币的转换 - GiftToRMB map[string]float64 // 平台礼物到RMB的转换 - FreeToCoin map[string]float64 // 平台免费礼物到弹币的转换 + Kafka KafkaProducer + } +) + +var k = koanf.New(".") + +func MustLoad(filepath string, v interface{}) { + f := file.Provider(filepath) + err := f.Watch(func(event interface{}, err error) { + if err != nil { + fmt.Printf("配置文件热重载失败: %v\n", err) + return } - Integral struct { - // CheckIn 签到 - CheckIn struct { - Points []int64 // 签到积分 次数分数 - Critical float32 // 暴击率(百分比) - CriticalRadio []float32 // 暴击倍数 - } - // 战局积分 - BattleReport struct { - GeneralIntegral int64 // 名将积分 - WinRadio float64 // 获胜方积分因子 乘法 - LostRadio float64 // 失败方积分因子 乘法 - } - // 奖池 - RewardPool struct { - InitReward int64 // 奖池初始积分 - Ratio float64 // 奖池结算比例 - GiftRatio float64 // 礼物算入奖池比例 - BattleRatio float64 // 战斗消耗积分算入奖池比例 - ReturnRatio float64 // 回收积分比例 - WelfareRatio float64 // 福利池从奖金扣除比例 - } - RMBToIntegral float64 // RMB到弹币的转换 - GiftToRMB map[string]float64 // 平台礼物到RMB的转换 - FreeToIntegral map[string]float64 // 平台免费礼物到弹币的转换 + k = koanf.New(".") + err = loadAndUnmarshal(f, v) + + if err != nil { + fmt.Printf("配置文件热重载失败: %v\n", err) + return } - // GiftPack 礼包配置 - GiftPackMap []GiftPack + fmt.Printf("重载配置文件: %+v\n", v) + }) + if err != nil { + panic(err) } -) + mustLoadAndUnmarshal(f, v) +} + +func loadAndUnmarshal(f *file.File, v interface{}) (err error) { + err = k.Load(f, yaml.Parser()) + if err != nil { + return + } + err = k.UnmarshalWithConf("", v, koanf.UnmarshalConf{Tag: "cfg"}) + if err != nil { + return + } + return +} + +func mustLoadAndUnmarshal(f *file.File, v interface{}) { + if err := loadAndUnmarshal(f, v); err != nil { + panic(err) + } +} diff --git a/app/user_center/rpc/internal/config/config_game.go b/app/user_center/rpc/internal/config/config_game.go new file mode 100644 index 0000000..6660f3a --- /dev/null +++ b/app/user_center/rpc/internal/config/config_game.go @@ -0,0 +1,136 @@ +package config + +import "github.com/pkg/errors" + +type ( + Elite struct { + LiveDict map[int32]int64 // 直播间序号对应ID + Default struct { + Id int64 + Sort int32 + } // 默认 + Items []EliteItem + } + // EliteItem 精英单位 + EliteItem struct { + Id int64 // 单位ID + PriceDay int64 // 每天价格(弹币) + PriceForever int64 // 永久价格 + } + Title struct { + LiveDict map[int32]int64 // 直播间序号对应ID + Items []TitleItem + } + // TitleItem 称号 + TitleItem struct { + Id int64 // 称号ID + Name string // 称号名 + Type string // 称号类型 + RankType int32 // 作用的排行榜类型 + PriceDay int64 // 每天价格(弹币) + PriceForever int64 // 永久价格(弹币) + } + GiftPack struct { + PackType string // 礼包类型 + PackName string // 礼包名称 + // Condition 领取条件 + Condition struct { + UserLimit int32 // 单人可领取数量 + UserResetType string // 用户礼包重置类型: 不重置(unset)|每天(daily)|每周(weekly)|每月(monthly) + StartTime string // 可领取时间(开始) 两个时间相等则不限期领取 + EndTime string // 可领取时间(结束) + } + // Content 礼包内容 + Content struct { + Coin int64 // 积分数 + Coins []int64 // 积分数(多次领取,每次不同) + + // Title 奖励称号列表 + Title []struct { + Id int64 // 称号ID + Duration int64 // 持续时长,单位: 秒 -1无限 + } + } + } + GameConfig struct { + UserRetriever struct { + Enabled bool // 是否开启 + UpdateDuration int64 // 用户信息更新最短间隔 单位 h + NobilityPlatforms []string // 需要获取贵族的平台 + Cron struct { + PlatformUser string + Nobility string + } + Bilibili struct { + RoomId int64 // 直播房间号 + Mid int64 // 主播UID 不输入就通过API获取 + RoomShortInfoApi string // 房间简短信息API + TopListApi string + } + } + Rank struct { + Enabled bool // 是否开启 + Cron struct { + Update string // 更新榜单 + Persistence string // 持久化 + } + } + GiftCollector struct { + Enabled bool // 是否开启 + Platforms []string // 需搜集的平台 + Cron struct { + CollectGift string + } + } + // 弹币 + Coin struct { + // CheckIn 签到 + CheckIn struct { + Points []int64 // 签到积分 次数分数 + Critical float32 // 暴击率(百分比) + CriticalRadio []float32 // 暴击倍数 + } + RMBToCoin float64 // RMB到弹币的转换 + GiftToRMB map[string]float64 // 平台礼物到RMB的转换 + FreeToCoin map[string]float64 // 平台免费礼物到弹币的转换 + } + // 精英单位 + Elite Elite + // 称号 + Title Title + // GiftPack 礼包配置 + GiftPackMap []GiftPack + } +) + +func (c *Title) FindTitleCfg(id int64) (*TitleItem, error) { + for _, item := range c.Items { + if id == item.Id { + return &item, nil + } + } + return nil, errors.New("未找到ID对应的称号配置") +} + +func (c *Title) FindTitleCfgByLive(sort int32) (*TitleItem, error) { + if id, ok := c.LiveDict[sort]; ok { + return c.FindTitleCfg(id) + } + return nil, errors.New("未找到sort对应的称号配置") +} + +func (c *Elite) FindEliteCfg(id int64) (*EliteItem, error) { + for _, item := range c.Items { + if id == item.Id { + return &item, nil + } + } + return nil, errors.New("未找到ID对应的精英单位配置") +} + +func (c *Elite) FindEliteCfgByLive(sort int32) (*EliteItem, error) { + if id, ok := c.LiveDict[sort]; ok { + return c.FindEliteCfg(id) + } + return nil, errors.New("未找到sort对应的精英单位配置") +} diff --git a/app/user_center/rpc/internal/logic/coin/change_coin_logic.go b/app/user_center/rpc/internal/logic/coin/change_coin_logic.go new file mode 100644 index 0000000..4f701ae --- /dev/null +++ b/app/user_center/rpc/internal/logic/coin/change_coin_logic.go @@ -0,0 +1,41 @@ +package coin + +import ( + "context" + "github.com/pkg/errors" + "live-service/app/user_center/rpc/internal/common/coin_manager" + "live-service/common/nerr" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ChangeCoinLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewChangeCoinLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ChangeCoinLogic { + return &ChangeCoinLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// changeCoin 新增或扣减用户弹币 +func (l *ChangeCoinLogic) ChangeCoin(in *pb.ChangeCoinReq) (*pb.Empty, error) { + _, err := l.svcCtx.CoinManager.ChangeCoin(l.ctx, nil, &coin_manager.ChangeCoinReq{ + BattleId: in.BattleId, + UserId: in.UserId, + Change: in.Change, + }, in.Reason) + if err != nil { + return nil, errors.Wrapf(nerr.NewWithErr(err), "记录弹币失败, err:%+v", err) + } + + return &pb.Empty{}, nil +} diff --git a/app/user_center/rpc/internal/logic/coin/get_user_coin_logic.go b/app/user_center/rpc/internal/logic/coin/get_user_coin_logic.go new file mode 100644 index 0000000..a98f2e0 --- /dev/null +++ b/app/user_center/rpc/internal/logic/coin/get_user_coin_logic.go @@ -0,0 +1,40 @@ +package coin + +import ( + "context" + "github.com/pkg/errors" + "live-service/common/nerr" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetUserCoinLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetUserCoinLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserCoinLogic { + return &GetUserCoinLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// getUserCoin 获取用户弹币 +func (l *GetUserCoinLogic) GetUserCoin(in *pb.UserIdReq) (*pb.GetUserCoinResp, error) { + // 查询当前用户积分 + coin, err := l.svcCtx.CoinManager.GetUserCoin(l.ctx, in.UserId) + if err != nil { + return nil, errors.Wrapf(nerr.NewWithCode(nerr.DBError), "查询用户弹币失败, err:%+v", err) + } + + return &pb.GetUserCoinResp{ + UserId: in.UserId, + Current: coin, + }, nil +} diff --git a/app/user_center/rpc/internal/logic/coin/transfer_user_coin_logic.go b/app/user_center/rpc/internal/logic/coin/transfer_user_coin_logic.go new file mode 100644 index 0000000..58e0dd4 --- /dev/null +++ b/app/user_center/rpc/internal/logic/coin/transfer_user_coin_logic.go @@ -0,0 +1,44 @@ +package coin + +import ( + "context" + "github.com/pkg/errors" + "live-service/common/nerr" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type TransferUserCoinLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewTransferUserCoinLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TransferUserCoinLogic { + return &TransferUserCoinLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// transferUserCoin 转移用户弹币 +func (l *TransferUserCoinLogic) TransferUserCoin(in *pb.TransferUserCoinReq) (*pb.TransferUserCoinResp, error) { + transResp, err := l.svcCtx.CoinManager.TransferCoin(l.ctx, in) + if err != nil { + return nil, errors.Wrap(nerr.NewWithErr(err), "转移弹币失败") + } + // 获取 username + if tmp, err := l.svcCtx.UserPlatformModel.FindDisplayOneByUserId(l.ctx, transResp.UserId); err == nil { + transResp.Uname = tmp.PUname + transResp.Avatar = tmp.PAvatar + } + if tmp, err := l.svcCtx.UserPlatformModel.FindDisplayOneByUserId(l.ctx, transResp.TargetUserId); err == nil { + transResp.TargetUname = tmp.PUname + transResp.TargetAvatar = tmp.PAvatar + } + return transResp, nil +} diff --git a/app/user_center/rpc/internal/logic/draw_pool/increase_welfare_logic.go b/app/user_center/rpc/internal/logic/draw_pool/increase_welfare_logic.go deleted file mode 100644 index 583fc89..0000000 --- a/app/user_center/rpc/internal/logic/draw_pool/increase_welfare_logic.go +++ /dev/null @@ -1,30 +0,0 @@ -package draw_pool - -import ( - "context" - - "live-service/app/user_center/rpc/internal/svc" - "live-service/app/user_center/rpc/pb" - - "github.com/zeromicro/go-zero/core/logx" -) - -type IncreaseWelfareLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewIncreaseWelfareLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IncreaseWelfareLogic { - return &IncreaseWelfareLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -func (l *IncreaseWelfareLogic) IncreaseWelfare(in *pb.IncreaseWelfareReq) (*pb.Empty, error) { - // todo: add your logic here and delete this line - - return &pb.Empty{}, nil -} diff --git a/app/user_center/rpc/internal/logic/gift/user_buy_nobility_logic.go b/app/user_center/rpc/internal/logic/gift/user_buy_nobility_logic.go index f228473..5be2d56 100644 --- a/app/user_center/rpc/internal/logic/gift/user_buy_nobility_logic.go +++ b/app/user_center/rpc/internal/logic/gift/user_buy_nobility_logic.go @@ -28,10 +28,10 @@ func NewUserBuyNobilityLogic(ctx context.Context, svcCtx *svc.ServiceContext) *U // UserBuyNobility 用户购买贵族 // 1. 记录送礼 + 新增积分 // 2. 修改贵族 -func (l *UserBuyNobilityLogic) UserBuyNobility(in *pb.UserBuyNobilityReq) (*pb.UserBuyNobilityResp, error) { +func (l *UserBuyNobilityLogic) UserBuyNobility(in *pb.UserBuyNobilityReq) (*pb.Empty, error) { // 记录送礼信息 sendGiftLogic := NewUserSendGiftLogic(l.ctx, l.svcCtx) - integralChanged, err := sendGiftLogic.UserSendGift(&pb.UserSendGiftReq{ + _, err := sendGiftLogic.UserSendGift(&pb.UserSendGiftReq{ Platform: in.Platform, UserId: in.UserId, PUid: in.PUid, @@ -58,11 +58,5 @@ func (l *UserBuyNobilityLogic) UserBuyNobility(in *pb.UserBuyNobilityReq) (*pb.U return nil, errors.Wrapf(nerr.NewError(nerr.GiftNobilityUpdateErr, "更新贵族信息失败"), "更新贵族信息失败 err:%v", err) } - return &pb.UserBuyNobilityResp{ - Integral: &pb.ChangeIntegralResp{ - UserId: integralChanged.Integral.UserId, - Change: integralChanged.Integral.Change, - Integral: integralChanged.Integral.Integral, - }, - }, nil + return &pb.Empty{}, nil } diff --git a/app/user_center/rpc/internal/logic/gift/user_send_gift_logic.go b/app/user_center/rpc/internal/logic/gift/user_send_gift_logic.go index 0293495..7dc7d07 100644 --- a/app/user_center/rpc/internal/logic/gift/user_send_gift_logic.go +++ b/app/user_center/rpc/internal/logic/gift/user_send_gift_logic.go @@ -3,11 +3,14 @@ package gift import ( "context" "git.noahlan.cn/northlan/ntools-go/uuid" + "github.com/pkg/errors" + pbVars "live-service/app/pb/vars" "live-service/app/user_center/model" - "live-service/app/user_center/rpc/internal/common/integral_manager" + "live-service/app/user_center/rpc/internal/common/coin_manager" "live-service/app/user_center/rpc/internal/logic/gift_collect" "live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/pb" + "live-service/common/nerr" "strconv" "github.com/zeromicro/go-zero/core/logx" @@ -30,8 +33,7 @@ func NewUserSendGiftLogic(ctx context.Context, svcCtx *svc.ServiceContext) *User // UserSendGift 用户赠送礼物 // 1. 记录用户赠送信息 // 2. 新增用户积分 -func (l *UserSendGiftLogic) UserSendGift(in *pb.UserSendGiftReq) (*pb.UserSendGiftResp, error) { - resp := &pb.UserSendGiftResp{} +func (l *UserSendGiftLogic) UserSendGift(in *pb.UserSendGiftReq) (*pb.Empty, error) { // 记录送礼信息 { dbUserGift := &model.UserGift{ @@ -53,29 +55,22 @@ func (l *UserSendGiftLogic) UserSendGift(in *pb.UserSendGiftReq) (*pb.UserSendGi } } - // 积分 + // 弹币 { - // 计算积分 - addonIntegral := calcIntegral(l.svcCtx.Config, in.Platform, in.IsPaid, float64(in.Price), in.Num) + addonCoin := calcCoin(l.svcCtx.GameConfig, in.Platform, in.IsPaid, float64(in.Price), in.Num) if tmpMap, ok := gift_collect.Service.GetCacheByPlatform(in.Platform); ok { if tmpData, ok := tmpMap[in.GiftId]; ok { - addonIntegral = calcIntegral(l.svcCtx.Config, in.Platform, tmpData.IsPaid, tmpData.Price, in.Num) + addonCoin = calcCoin(l.svcCtx.GameConfig, in.Platform, tmpData.IsPaid, tmpData.Price, in.Num) } } - newIntegral, err := l.svcCtx.IntegralManager.ChangeIntegral(l.ctx, &integral_manager.ChangeIntegralReq{ + _, err := l.svcCtx.CoinManager.ChangeCoin(l.ctx, nil, &coin_manager.ChangeCoinReq{ BattleId: in.BattleId, UserId: in.UserId, - Change: addonIntegral, - Type: pb.IntegralType_Gift, - }, true) + Change: addonCoin, + }, pbVars.UserCoinChangedReason_SendGift) if err != nil { - return nil, err - } - resp.Integral = &pb.ChangeIntegralResp{ - UserId: in.UserId, - Change: newIntegral.Change, - Integral: newIntegral.Integral, + return nil, errors.Wrapf(nerr.NewWithErr(err), "添加弹币失败 err:%v", err) } } - return resp, nil + return &pb.Empty{}, nil } diff --git a/app/user_center/rpc/internal/logic/gift/util.go b/app/user_center/rpc/internal/logic/gift/util.go index fcb783a..44395d8 100644 --- a/app/user_center/rpc/internal/logic/gift/util.go +++ b/app/user_center/rpc/internal/logic/gift/util.go @@ -5,21 +5,24 @@ import ( "live-service/app/user_center/rpc/internal/config" ) -func calcIntegral(cfg config.Config, platform string, isPaid bool, price float64, num int64) int64 { - giftToRMBRadio, _ := cfg.Integral.GiftToRMB[platform] - freeToIntegralRadio, _ := cfg.Integral.FreeToIntegral[platform] - rmbToIntegral := cfg.Integral.RMBToIntegral +func calcCoin(cfg *config.GameConfig, platform string, isPaid bool, price float64, num int64) int64 { + giftToRMBRadio, _ := cfg.Coin.GiftToRMB[platform] + freeToRadio, _ := cfg.Coin.FreeToCoin[platform] + rmbTo := cfg.Coin.RMBToCoin var newPrice float64 if isPaid { newPrice = price * giftToRMBRadio } else { - newPrice = price * freeToIntegralRadio + newPrice = price * freeToRadio } decimal.DivisionPrecision = 2 - return decimal.NewFromFloat(newPrice). - Mul(decimal.NewFromInt(num)). - Mul(decimal.NewFromFloat(rmbToIntegral)). - Round(0).IntPart() + + resp := decimal.NewFromFloat(newPrice). + Mul(decimal.NewFromInt(num)) + if isPaid { + resp = resp.Mul(decimal.NewFromFloat(rmbTo)) + } + return resp.Round(0).IntPart() } diff --git a/app/user_center/rpc/internal/logic/gift_collect/collector.go b/app/user_center/rpc/internal/logic/gift_collect/collector.go index 974a07a..b7b18bb 100644 --- a/app/user_center/rpc/internal/logic/gift_collect/collector.go +++ b/app/user_center/rpc/internal/logic/gift_collect/collector.go @@ -45,14 +45,14 @@ func InitCollector(svcCtx *svc.ServiceContext) { Logger: logx.WithContext(ctx), } - if !svcCtx.Config.GiftCollector.Enabled { + if !svcCtx.GameConfig.GiftCollector.Enabled { return } Service.startJob() } func (c *GiftCollector) startJob() { - cfg := c.svcCtx.Config.GiftCollector + cfg := c.svcCtx.GameConfig.GiftCollector // 先执行一次 c.collectGift(cfg.Platforms...) diff --git a/app/user_center/rpc/internal/logic/gift_collect/collector_bilibili.go b/app/user_center/rpc/internal/logic/gift_collect/collector_bilibili.go index e7ccaeb..a27c593 100644 --- a/app/user_center/rpc/internal/logic/gift_collect/collector_bilibili.go +++ b/app/user_center/rpc/internal/logic/gift_collect/collector_bilibili.go @@ -25,6 +25,7 @@ type ( Name string `json:"name"` // 礼物名称 Price int64 `json:"price"` // 礼物单价 CoinType string `json:"coin_type"` // 瓜子类型 gold金瓜子 silver银瓜子 + ImgBasic string `json:"img_basic"` // 礼物图 } ) @@ -40,7 +41,7 @@ func isPaidGift(coinType string) bool { func GiftCollectorBilibili(ctx context.Context, svcCtx *svc.ServiceContext) (ret map[int64]GiftData, err error) { const platform = "bilibili" - radio, _ := svcCtx.Config.Integral.GiftToRMB[platform] + radio, _ := svcCtx.GameConfig.Coin.GiftToRMB[platform] // 1. 读取API httpResp, err := http.Get("https://api.live.bilibili.com/xlive/web-room/v1/giftPanel/giftConfig?platform=app") @@ -83,6 +84,7 @@ func GiftCollectorBilibili(ctx context.Context, svcCtx *svc.ServiceContext) (ret Id: uuid.NextId(), GiftId: strconv.FormatInt(gift.Id, 10), GiftName: gift.Name, + Pic: gift.ImgBasic, Platform: platform, } giftData := GiftData{ diff --git a/app/user_center/rpc/internal/logic/integral/change_integral_logic.go b/app/user_center/rpc/internal/logic/integral/change_integral_logic.go deleted file mode 100644 index bba43f6..0000000 --- a/app/user_center/rpc/internal/logic/integral/change_integral_logic.go +++ /dev/null @@ -1,46 +0,0 @@ -package integral - -import ( - "context" - "github.com/pkg/errors" - "live-service/app/user_center/rpc/internal/common/integral_manager" - "live-service/common/nerr" - - "live-service/app/user_center/rpc/internal/svc" - "live-service/app/user_center/rpc/pb" - - "github.com/zeromicro/go-zero/core/logx" -) - -type ChangeIntegralLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewChangeIntegralLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ChangeIntegralLogic { - return &ChangeIntegralLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -// ChangeIntegral 更改用户积分 -func (l *ChangeIntegralLogic) ChangeIntegral(in *pb.ChangeIntegralReq) (*pb.ChangeIntegralResp, error) { - integral, err := l.svcCtx.IntegralManager.ChangeIntegral(l.ctx, &integral_manager.ChangeIntegralReq{ - BattleId: in.BattleId, - UserId: in.UserId, - Change: in.Change, - Type: in.IntegralType, - }, true) - if err != nil { - return nil, errors.Wrapf(nerr.NewWithErr(err), "记录积分失败, err:%+v", err) - } - - return &pb.ChangeIntegralResp{ - UserId: in.UserId, - Change: in.Change, - Integral: integral.Integral, - }, nil -} diff --git a/app/user_center/rpc/internal/logic/integral/get_user_integral_logic.go b/app/user_center/rpc/internal/logic/integral/get_user_integral_logic.go deleted file mode 100644 index d0b72c6..0000000 --- a/app/user_center/rpc/internal/logic/integral/get_user_integral_logic.go +++ /dev/null @@ -1,40 +0,0 @@ -package integral - -import ( - "context" - "github.com/pkg/errors" - "live-service/common/nerr" - - "live-service/app/user_center/rpc/internal/svc" - "live-service/app/user_center/rpc/pb" - - "github.com/zeromicro/go-zero/core/logx" -) - -type GetUserIntegralLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewGetUserIntegralLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserIntegralLogic { - return &GetUserIntegralLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -// GetUserIntegral 获取用户积分 -func (l *GetUserIntegralLogic) GetUserIntegral(in *pb.UserIdReq) (*pb.UserIntegralResp, error) { - // 查询当前用户积分 - integral, err := l.svcCtx.UserIntegralModel.FindOne(l.ctx, nil, in.UserId) - if err != nil { - return nil, errors.Wrapf(nerr.NewWithCode(nerr.DBError), "查询用户积分失败, err:%+v", err) - } - - return &pb.UserIntegralResp{ - UserId: in.UserId, - Integral: integral.Integral, - }, nil -} diff --git a/app/user_center/rpc/internal/logic/integral/transfer_user_integral_logic.go b/app/user_center/rpc/internal/logic/integral/transfer_user_integral_logic.go deleted file mode 100644 index d7cd478..0000000 --- a/app/user_center/rpc/internal/logic/integral/transfer_user_integral_logic.go +++ /dev/null @@ -1,41 +0,0 @@ -package integral - -import ( - "context" - "live-service/app/user_center/rpc/internal/svc" - "live-service/app/user_center/rpc/pb" - "live-service/common/nerr" - - "github.com/zeromicro/go-zero/core/logx" -) - -type TransferUserIntegralLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewTransferUserIntegralLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TransferUserIntegralLogic { - return &TransferUserIntegralLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -// TransferUserIntegral 转移积分 -func (l *TransferUserIntegralLogic) TransferUserIntegral(in *pb.TransferUserIntegralReq) (*pb.TransferUserIntegralResp, error) { - transResp := l.svcCtx.IntegralManager.TransferIntegral(l.ctx, in) - if transResp.Code == int32(nerr.OK) { - // 获取 username - if tmp, err := l.svcCtx.UserPlatformModel.FindDisplayOneByUserId(l.ctx, transResp.UserId); err == nil { - transResp.Uname = tmp.PUname - transResp.Avatar = tmp.PAvatar - } - if tmp, err := l.svcCtx.UserPlatformModel.FindDisplayOneByUserId(l.ctx, transResp.TargetUserId); err == nil { - transResp.TargetUname = tmp.PUname - transResp.TargetAvatar = tmp.PAvatar - } - } - return transResp, nil -} diff --git a/app/user_center/rpc/internal/logic/platform_user/platform_user_retrieve.go b/app/user_center/rpc/internal/logic/platform_user/platform_user_retrieve.go index b889cec..4f4be0c 100644 --- a/app/user_center/rpc/internal/logic/platform_user/platform_user_retrieve.go +++ b/app/user_center/rpc/internal/logic/platform_user/platform_user_retrieve.go @@ -41,7 +41,7 @@ type RetrieveFunc func(pUid string) (*PlatformUser, error) type NobilityFunc func(svcCtx *svc.ServiceContext) ([]NobilityData, error) func InitUserRetriever(svcCtx *svc.ServiceContext) { - cfg := svcCtx.Config.UserRetriever + cfg := svcCtx.GameConfig.UserRetriever if !cfg.Enabled { return } @@ -63,7 +63,7 @@ func InitUserRetriever(svcCtx *svc.ServiceContext) { func (r *UserRetriever) initJob() { logx.Info("开启用户数据采集服务...") - cfg := r.svcCtx.Config.UserRetriever + cfg := r.svcCtx.GameConfig.UserRetriever c := cron.New(cron.WithSeconds()) // 获取平台用户信息 _, _ = c.AddFunc(cfg.Cron.PlatformUser, func() { @@ -104,7 +104,7 @@ func (r *UserRetriever) retrievePlatformUser() { r.retrieveList(list) // 优先加载空信息用户 if len(list) <= 0 { - if list, err = r.svcCtx.UserPlatformModel.FindUpdatableList(r.ctx, r.svcCtx.Config.UserRetriever.UpdateDuration, 5); err != nil { + if list, err = r.svcCtx.UserPlatformModel.FindUpdatableList(r.ctx, r.svcCtx.GameConfig.UserRetriever.UpdateDuration, 5); err != nil { return } r.retrieveList(list) diff --git a/app/user_center/rpc/internal/logic/platform_user/retrieve_bilibili.go b/app/user_center/rpc/internal/logic/platform_user/retrieve_bilibili.go index 028d698..86a766b 100644 --- a/app/user_center/rpc/internal/logic/platform_user/retrieve_bilibili.go +++ b/app/user_center/rpc/internal/logic/platform_user/retrieve_bilibili.go @@ -124,7 +124,7 @@ type ( ) func NobilityBilibili(svcCtx *svc.ServiceContext) ([]NobilityData, error) { - cfg := svcCtx.Config.UserRetriever.Bilibili + cfg := svcCtx.GameConfig.UserRetriever.Bilibili if cfg.Mid == 0 { if mId, err := fetchMid(cfg.RoomShortInfoApi, cfg.RoomId); err != nil { return nil, err diff --git a/app/user_center/rpc/internal/logic/rank/rank_job.go b/app/user_center/rpc/internal/logic/rank/rank_job.go index 14bc528..9ab0cd0 100644 --- a/app/user_center/rpc/internal/logic/rank/rank_job.go +++ b/app/user_center/rpc/internal/logic/rank/rank_job.go @@ -8,6 +8,7 @@ import ( "github.com/pkg/errors" "github.com/robfig/cron/v3" "github.com/zeromicro/go-zero/core/logx" + pbVars "live-service/app/pb/vars" "live-service/app/user_center/model" "live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/pb" @@ -27,20 +28,7 @@ type ( svcCtx *svc.ServiceContext // 实时排行榜(定期读取,半实时) - rankByTypeMap map[pb.RankType]*zset.ZSetInt - - //damageRank *zset.ZSetInt - //deDamageRank *zset.ZSetInt - //generalRank *zset.ZSetInt - //deGeneralRank *zset.ZSetInt - //killUnitRank *zset.ZSetInt - //deKillUnitRank *zset.ZSetInt - //killPlayerRank *zset.ZSetInt - //deKillPlayerRank *zset.ZSetInt - //winRank *zset.ZSetInt - //lostRank *zset.ZSetInt - //firstBloodRank *zset.ZSetInt - //deFirstBloodRank *zset.ZSetInt + rankByTypeMap map[pbVars.RankType]*zset.ZSetInt // 用户数据表内存缓存 userCache *lru.Cache @@ -55,24 +43,24 @@ func InitRankJob(svcCtx *svc.ServiceContext) { Service = &Job{ ctx: context.Background(), svcCtx: svcCtx, - rankByTypeMap: map[pb.RankType]*zset.ZSetInt{ - pb.RankType_Damage: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_DeDamage: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_General: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_DeGeneral: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_KillUnit: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_DeKillUnit: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_KillPlayer: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_DeKillPlayer: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_Win: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_Lost: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_FirstBlood: zset.NewZSetInt(lessFunc, model.MaxRankN), - pb.RankType_DeFirstBlood: zset.NewZSetInt(lessFunc, model.MaxRankN), + rankByTypeMap: map[pbVars.RankType]*zset.ZSetInt{ + pbVars.RankType_Damage: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_DeDamage: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_General: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_DeGeneral: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_KillUnit: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_DeKillUnit: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_KillPlayer: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_DeKillPlayer: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_Win: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_Lost: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_FirstBlood: zset.NewZSetInt(lessFunc, model.MaxRankN), + pbVars.RankType_DeFirstBlood: zset.NewZSetInt(lessFunc, model.MaxRankN), }, userCache: uc, } - if !svcCtx.Config.Rank.Enabled { + if !svcCtx.GameConfig.Rank.Enabled { return } Service.initJob() @@ -84,56 +72,43 @@ func InitRankJob(svcCtx *svc.ServiceContext) { // 3. 开启任务 定时落库 func (j *Job) initJob() { logx.Info("开启排行榜服务...") - // TODO 读取历史数据功能暂时移除 - //j.initByType(model.RankTypeDamage) - //j.initByType(model.RankTypeDeDamage) - //j.initByType(model.RankTypeGeneral) - //j.initByType(model.RankTypeDeGeneral) - //j.initByType(model.RankTypeKillUnit) - //j.initByType(model.RankTypeDeKillUnit) - //j.initByType(model.RankTypeKillPlayer) - //j.initByType(model.RankTypeDeKillPlayer) - //j.initByType(model.RankTypeWin) - //j.initByType(model.RankTypeLost) - //j.initByType(model.RankTypeFirstBlood) - //j.initByType(model.RankTypeDeFirstBlood) - cfg := j.svcCtx.Config.Rank + cfg := j.svcCtx.GameConfig.Rank // job read and update c := cron.New() _, _ = c.AddFunc(cfg.Cron.Update, func() { - go j.readAndUpdate(pb.RankType_Damage) - go j.readAndUpdate(pb.RankType_DeDamage) - go j.readAndUpdate(pb.RankType_General) - go j.readAndUpdate(pb.RankType_DeGeneral) - go j.readAndUpdate(pb.RankType_KillUnit) - go j.readAndUpdate(pb.RankType_DeKillUnit) - go j.readAndUpdate(pb.RankType_KillPlayer) - go j.readAndUpdate(pb.RankType_DeKillPlayer) - go j.readAndUpdate(pb.RankType_Win) - go j.readAndUpdate(pb.RankType_Lost) - go j.readAndUpdate(pb.RankType_FirstBlood) - go j.readAndUpdate(pb.RankType_DeFirstBlood) + go j.readAndUpdate(pbVars.RankType_Damage) + go j.readAndUpdate(pbVars.RankType_DeDamage) + go j.readAndUpdate(pbVars.RankType_General) + go j.readAndUpdate(pbVars.RankType_DeGeneral) + go j.readAndUpdate(pbVars.RankType_KillUnit) + go j.readAndUpdate(pbVars.RankType_DeKillUnit) + go j.readAndUpdate(pbVars.RankType_KillPlayer) + go j.readAndUpdate(pbVars.RankType_DeKillPlayer) + go j.readAndUpdate(pbVars.RankType_Win) + go j.readAndUpdate(pbVars.RankType_Lost) + go j.readAndUpdate(pbVars.RankType_FirstBlood) + go j.readAndUpdate(pbVars.RankType_DeFirstBlood) }) // persistence _, _ = c.AddFunc(cfg.Cron.Persistence, func() { - go j.persistence(pb.RankType_Damage) - go j.persistence(pb.RankType_DeDamage) - go j.persistence(pb.RankType_General) - go j.persistence(pb.RankType_DeGeneral) - go j.persistence(pb.RankType_KillUnit) - go j.persistence(pb.RankType_DeKillUnit) - go j.persistence(pb.RankType_KillPlayer) - go j.persistence(pb.RankType_DeKillPlayer) - go j.persistence(pb.RankType_Win) - go j.persistence(pb.RankType_Lost) - go j.persistence(pb.RankType_FirstBlood) - go j.persistence(pb.RankType_DeFirstBlood) + go j.persistence(pbVars.RankType_Damage) + go j.persistence(pbVars.RankType_DeDamage) + go j.persistence(pbVars.RankType_General) + go j.persistence(pbVars.RankType_DeGeneral) + go j.persistence(pbVars.RankType_KillUnit) + go j.persistence(pbVars.RankType_DeKillUnit) + go j.persistence(pbVars.RankType_KillPlayer) + go j.persistence(pbVars.RankType_DeKillPlayer) + go j.persistence(pbVars.RankType_Win) + go j.persistence(pbVars.RankType_Lost) + go j.persistence(pbVars.RankType_FirstBlood) + go j.persistence(pbVars.RankType_DeFirstBlood) }) c.Start() } -func (j *Job) RankByScore(rankType pb.RankType, score int32) int32 { +func (j *Job) RankByScore(rankType pbVars.RankType, score int32) int32 { rankZSet, _, err := j.getRankInstanceAndScoreType(rankType) if err != nil { return 0 @@ -146,9 +121,9 @@ func (j *Job) RankByScore(rankType pb.RankType, score int32) int32 { return 0 } -func (j *Job) RangeRankByType(rankType pb.RankType, topN int32) *pb.RankPvpResp { +func (j *Job) RangeRankByType(rankType pbVars.RankType, topN int32) *pb.RankPvpResp { result := &pb.RankPvpResp{ - Type: int32(rankType), + Type: rankType, } rankZSet, _, err := j.getRankInstanceAndScoreType(rankType) if err != nil { @@ -195,27 +170,7 @@ func (j *Job) RangeRankByType(rankType pb.RankType, topN int32) *pb.RankPvpResp return result } -func (j *Job) initByType(rankType pb.RankType) { - list, err := j.svcCtx.RankPvpModel.RankListByType(j.ctx, int64(rankType), model.MaxRankN) - if err != nil { - return - } - rankZSet, _, err := j.getRankInstanceAndScoreType(rankType) - if err != nil { - return - } - for _, user := range list { - // 缓存用户信息 - j.userCache.Add(user.UserId, CachedUserInfo{ - UserId: user.UserId, - Username: user.PUname, - Avatar: user.PAvatar, - }) - rankZSet.Add(user.UserId, int32(user.Score)) - } -} - -func (j *Job) readAndUpdate(rankType pb.RankType) { +func (j *Job) readAndUpdate(rankType pbVars.RankType) { rankZSet, scoreType, err := j.getRankInstanceAndScoreType(rankType) if err != nil { return @@ -259,7 +214,7 @@ func (j *Job) readAndUpdate(rankType pb.RankType) { } } -func (j *Job) persistence(rankType pb.RankType) { +func (j *Job) persistence(rankType pbVars.RankType) { rankZSet, _, err := j.getRankInstanceAndScoreType(rankType) if err != nil { return @@ -286,7 +241,7 @@ func (j *Job) persistence(rankType pb.RankType) { } } -func (j *Job) getRankInstanceAndScoreType(rankType pb.RankType) (*zset.ZSetInt, model.ScoreType, error) { +func (j *Job) getRankInstanceAndScoreType(rankType pbVars.RankType) (*zset.ZSetInt, model.ScoreType, error) { var rankZSet *zset.ZSetInt scoreType := model.ScoreTypeByRankType(rankType) rankZSet, _ = j.rankByTypeMap[rankType] diff --git a/app/user_center/rpc/internal/logic/rank/rank_pvp_logic.go b/app/user_center/rpc/internal/logic/rank/rank_pvp_logic.go index 2201872..78313e1 100644 --- a/app/user_center/rpc/internal/logic/rank/rank_pvp_logic.go +++ b/app/user_center/rpc/internal/logic/rank/rank_pvp_logic.go @@ -24,5 +24,5 @@ func NewRankPvpLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RankPvpLo // rank func (l *RankPvpLogic) RankPvp(in *pb.RankPvpReq) (*pb.RankPvpResp, error) { - return Service.RangeRankByType(pb.RankType(in.Type), in.TopN), nil + return Service.RangeRankByType(in.Type, in.TopN), nil } diff --git a/app/user_center/rpc/internal/logic/rank/user_rank_pvp_logic.go b/app/user_center/rpc/internal/logic/rank/user_rank_pvp_logic.go index b9ff247..a891458 100644 --- a/app/user_center/rpc/internal/logic/rank/user_rank_pvp_logic.go +++ b/app/user_center/rpc/internal/logic/rank/user_rank_pvp_logic.go @@ -3,6 +3,7 @@ package rank import ( "context" "github.com/pkg/errors" + pbVars "live-service/app/pb/vars" "live-service/app/user_center/model" "live-service/common/nerr" @@ -39,7 +40,7 @@ func (l *UserRankPvpLogic) UserRankPvp(in *pb.UserRankReq) (*pb.UserRankResp, er } } else { // 只查询一种类型 - scoreTypes := []model.ScoreType{model.ScoreTypeByRankType(pb.RankType(in.RankType))} + scoreTypes := []model.ScoreType{model.ScoreTypeByRankType(in.RankType)} if dbScoreMap, err = l.svcCtx.StatisticsPvpModel.FindScoreByType(l.ctx, nil, in.UserId, scoreTypes); err != nil { return nil, errors.Wrapf(nerr.NewError(nerr.RankStatisticsSelectError, "获取用户分数失败"), "获取用户分数失败 err:%v", err) } @@ -54,9 +55,9 @@ func (l *UserRankPvpLogic) UserRankPvp(in *pb.UserRankReq) (*pb.UserRankResp, er }, nil } -func (l *UserRankPvpLogic) rankItem(rankType pb.RankType, score int64) *pb.UserRankResp_Item { +func (l *UserRankPvpLogic) rankItem(rankType pbVars.RankType, score int64) *pb.UserRankResp_Item { return &pb.UserRankResp_Item{ - RankType: int32(rankType), + RankType: rankType, Score: score, Pos: Service.RankByScore(rankType, int32(score)), } diff --git a/app/user_center/rpc/internal/logic/statistics/stat_pvp_first_blood_logic.go b/app/user_center/rpc/internal/logic/statistics/stat_pvp_first_blood_logic.go deleted file mode 100644 index c37ac81..0000000 --- a/app/user_center/rpc/internal/logic/statistics/stat_pvp_first_blood_logic.go +++ /dev/null @@ -1,74 +0,0 @@ -package statistics - -import ( - "context" - "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" - "github.com/pkg/errors" - "gorm.io/gorm" - "live-service/app/user_center/model" - "live-service/app/user_center/rpc/internal/svc" - "live-service/app/user_center/rpc/pb" - "live-service/common/nerr" - - "github.com/zeromicro/go-zero/core/logx" -) - -type StatPvpFirstBloodLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewStatPvpFirstBloodLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StatPvpFirstBloodLogic { - return &StatPvpFirstBloodLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -const ( - TypeFirstBlood = 1 - TypeDeFirstBlood = 2 -) - -func (l *StatPvpFirstBloodLogic) StatPvpFirstBlood(in *pb.StatPvPFirstBloodReq) (*pb.Empty, error) { - // 虚拟UID - if in.Uid <= 0 { - return &pb.Empty{}, nil - } - err := l.svcCtx.StatisticsPvpModel.TransactCtx(l.ctx, nil, func(tx *gorm.DB) error { - // 直接更新,提高效率 - props := model.UpdateRecordProps{} - if in.Type == TypeFirstBlood { - props.FirstBlood = true - } else if in.Type == TypeDeFirstBlood { - props.DeFirstBlood = true - } - - if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, in.Uid, - &props); err != nil { - if errors.Is(err, gormx.ErrRowsAffectedZero) { - // insert - dbModel := model.StatisticsPvp{ - UserId: in.Uid, - } - if in.Type == TypeFirstBlood { - dbModel.FirstBloodCount = 1 - } else if in.Type == TypeDeFirstBlood { - dbModel.DeFirstBloodCount = 1 - } - if err = l.svcCtx.StatisticsPvpModel.Insert(l.ctx, tx, &dbModel); err != nil { - return errors.Wrapf(err, ErrInsertErr, err) - } - } else { - return errors.Wrapf(err, ErrUpdateErr, err) - } - } - return nil - }) - if err != nil { - return nil, errors.Wrapf(nerr.NewWithCode(nerr.DBError), "一血报送-事务执行失败, err:%+v", err) - } - return &pb.Empty{}, nil -} diff --git a/app/user_center/rpc/internal/logic/statistics/stat_pvp_kill_logic.go b/app/user_center/rpc/internal/logic/statistics/stat_pvp_kill_logic.go deleted file mode 100644 index 5595b22..0000000 --- a/app/user_center/rpc/internal/logic/statistics/stat_pvp_kill_logic.go +++ /dev/null @@ -1,86 +0,0 @@ -package statistics - -import ( - "context" - "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" - "github.com/pkg/errors" - "gorm.io/gorm" - "live-service/app/user_center/model" - "live-service/common/nerr" - - "live-service/app/user_center/rpc/internal/svc" - "live-service/app/user_center/rpc/pb" - - "github.com/zeromicro/go-zero/core/logx" -) - -type StatPvpKillLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewStatPvpKillLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StatPvpKillLogic { - return &StatPvpKillLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -func (l *StatPvpKillLogic) StatPvpKill(in *pb.StatPvPKillReq) (*pb.Empty, error) { - // 虚拟UID - if in.Uid <= 0 { - return &pb.Empty{}, nil - } - - err := l.svcCtx.StatisticsPvpModel.TransactCtx(l.ctx, nil, func(tx *gorm.DB) error { - // 击杀 - props := model.UpdateRecordProps{ - KillPlayer: true, - } - if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, in.Uid, &props); err != nil { - if errors.Is(err, gormx.ErrRowsAffectedZero) { - dbModel := &model.StatisticsPvp{ - UserId: in.Uid, - KillPlayerCount: 1, - } - if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, tx, dbModel); err != nil { - return errors.Wrapf(err, ErrInsertErr, err) - } - } else { - return errors.Wrapf(err, ErrUpdateErr, err) - } - } - // 被杀 + 落马否 - // 虚拟UID - if in.TargetUid <= 0 { - return nil - } - props = model.UpdateRecordProps{ - DeKillPlayer: true, - DeGeneral: in.IsGeneral, - } - if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, in.TargetUid, &props); err != nil { - if errors.Is(err, gormx.ErrRowsAffectedZero) { - dbModel := &model.StatisticsPvp{ - UserId: in.TargetUid, - DeKillUnitCount: 1, - } - if in.IsGeneral { - dbModel.DeGeneralCount = 1 - } - if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, tx, dbModel); err != nil { - return errors.Wrapf(err, ErrInsertErr, err) - } - } else { - return errors.Wrapf(err, ErrUpdateErr, err) - } - } - return nil - }) - if err != nil { - return nil, errors.Wrapf(nerr.NewWithCode(nerr.DBError), "击杀玩家-事务执行失败, err:%+v", err) - } - return &pb.Empty{}, nil -} diff --git a/app/user_center/rpc/internal/logic/statistics/stat_pvp_report_logic.go b/app/user_center/rpc/internal/logic/statistics/stat_pvp_report_logic.go index b382c6a..0c3594c 100644 --- a/app/user_center/rpc/internal/logic/statistics/stat_pvp_report_logic.go +++ b/app/user_center/rpc/internal/logic/statistics/stat_pvp_report_logic.go @@ -4,11 +4,10 @@ import ( "context" "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" "github.com/pkg/errors" + "github.com/shopspring/decimal" "github.com/zeromicro/go-zero/core/logx" "gorm.io/gorm" "live-service/app/user_center/model" - "live-service/app/user_center/rpc/internal/common/integral_manager" - "live-service/app/user_center/rpc/internal/common/reward_pool" "live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/pb" "sort" @@ -28,165 +27,217 @@ func NewStatPvpReportLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Sta } } +type ( + sumType struct { + damage int64 + deDamage int64 + killPlayer int64 + } + + statPvPReportItem struct { + *pb.StatPvPReportResp_Item + uid int64 + uname string + damage int64 + deDamage int64 + killUnit int64 + deKillUnit int64 + firstBlood bool + deFirstBlood bool + killPlayer int64 + deKillPlayer bool + isGeneral bool + } +) + func (l *StatPvpReportLogic) StatPvpReport(in *pb.StatPvPReportReq) (*pb.StatPvPReportResp, error) { - resp := &pb.StatPvPReportResp{} - // 排序 - sort.SliceStable(in.WinItems, func(i, j int) bool { - return in.WinItems[i].Position < in.WinItems[j].Position + var err error + resp := &pb.StatPvPReportResp{ + WinCamp: in.WinCamp, + BattleId: in.BattleId, + } + winItems := make([]*statPvPReportItem, 0, len(in.WinItems)) + lostItems := make([]*statPvPReportItem, 0, len(in.LostItems)) + // 1. 计算评分 + winSum := l.calcSum(in.WinItems, winItems) + lostSum := l.calcSum(in.LostItems, lostItems) + l.calcScoreResponse(winSum, winItems) + l.calcScoreResponse(lostSum, lostItems) + + // 2. 评分排序 + sort.Slice(winItems, func(i, j int) bool { + return winItems[i].Score > winItems[j].Score }) - sort.SliceStable(in.LostItems, func(i, j int) bool { - return in.LostItems[i].Position < in.LostItems[j].Position + sort.Slice(lostItems, func(i, j int) bool { + return lostItems[i].Score > lostItems[j].Score }) - // 名将记录 - if len(in.WinItems) > 0 { - general := in.WinItems[0] - if general.Uid > 0 { - if err := l.svcCtx.StatisticsPvpModel.TransactCtx(l.ctx, nil, func(tx *gorm.DB) error { - if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, general.Uid, - &model.UpdateRecordProps{General: true}); err != nil { - if errors.Is(err, gormx.ErrRowsAffectedZero) { - // insert - if err = l.svcCtx.StatisticsPvpModel.Insert(l.ctx, tx, &model.StatisticsPvp{ - UserId: general.Uid, - GeneralCount: 1, - }); err != nil { - return errors.Wrapf(err, ErrInsertErr, err) - } - } else { - return errors.Wrapf(err, ErrUpdateErr, err) - } - } - return nil - }); err != nil { - l.Logger.Errorf("PvP名将记录事务执行失败, err:%v", err) - } - } + + // 3. 添加position + 各项记录(可忽略错误) + err = l.reports(true, winItems) + if err != nil { + l.Logger.Errorf("获胜PvP记录失败, err:%v", err) } - // 玩家记录 - { - // 获胜记录 - if err := l.reports(true, in.WinItems); err != nil { - l.Logger.Errorf("获胜PvP记录失败, err:%v", err) - } - // 战败记录 - if err := l.reports(false, in.LostItems); err != nil { - l.Logger.Errorf("战败PvP记录失败, err:%v", err) - } + err = l.reports(false, lostItems) + if err != nil { + l.Logger.Errorf("战败PvP记录失败, err:%v", err) } - // 积分记录 - { - battleReportCfg := l.svcCtx.Config.Integral.BattleReport - drawReq := make([]reward_pool.DrawRequest, 0, len(in.WinItems)) - for _, item := range in.WinItems { - drawReq = append(drawReq, reward_pool.DrawRequest{ - UserId: item.Uid, - Position: item.Position, - Ratio: 0.2, - }) - } - drawResult := l.svcCtx.RewardPoolManager.Draw(in.BattleId, drawReq) - winItemResp := make([]*pb.StatPvPReportResp_Item, 0, len(in.WinItems)) - lostItemResp := make([]*pb.StatPvPReportResp_Item, 0, len(in.LostItems)) - integralChangeReq := make([]integral_manager.ChangeIntegralReq, 0, len(in.WinItems)+len(in.LostItems)) + // resp + resp.WinItems = make([]*pb.StatPvPReportResp_Item, 0, len(winItems)) + resp.LostItems = make([]*pb.StatPvPReportResp_Item, 0, len(lostItems)) + for _, item := range winItems { + resp.WinItems = append(resp.WinItems, &pb.StatPvPReportResp_Item{ + Uid: item.uid, + Uname: item.uname, + Position: item.Position, + Score: item.Score, + }) + } + for _, item := range lostItems { + resp.LostItems = append(resp.LostItems, &pb.StatPvPReportResp_Item{ + Uid: item.uid, + Uname: item.uname, + Position: item.Position, + Score: item.Score, + }) + } + return resp, nil +} - // . 战斗结算 - // . 奖池结算 - for _, item := range in.WinItems { - // damage (暴兵越多伤害越高) - // killUnit (暴兵越多击杀越多) - // deDamage (暴兵越多受伤越多) - // deKillUnit (暴兵越多死的约多) - uid, uname, position, damage := item.Uid, item.Uname, item.Position, item.Damage +func (l *StatPvpReportLogic) calcSum(items []*pb.StatPvPReportReq_Item, out []*statPvPReportItem) sumType { + var sum sumType + for _, item := range items { + sum.damage += item.Damage + sum.deDamage += item.DeDamage + sum.killPlayer += item.KillPlayer + out = append(out, &statPvPReportItem{ + uid: item.Uid, + uname: item.Uname, + damage: item.Damage, + deDamage: item.DeDamage, + killUnit: item.KillUnit, + deKillUnit: item.DeKillUnit, + firstBlood: item.FirstBlood, + deFirstBlood: item.DeFirstBlood, + killPlayer: item.KillPlayer, + deKillPlayer: item.DeKillPlayer, + isGeneral: item.IsGeneral, + }) + } + return sum +} - battleIntegral := int64(float64(damage) * battleReportCfg.WinRadio) - tmp := &pb.StatPvPReportResp_Item{ - Uid: uid, - Uname: uname, - Position: position, - ReturnsIntegral: drawResult.UserReturns[uid], - RewardPoolIntegral: drawResult.DrawRewards[uid], - NobilityIntegral: 0, // TODO . 贵族加成分 再议 - BattleIntegral: battleIntegral, - } - if position == 1 { - tmp.GeneralIntegral = battleReportCfg.GeneralIntegral - } - tmp.TotalIntegral = tmp.ReturnsIntegral + tmp.RewardPoolIntegral + tmp.GeneralIntegral + tmp.NobilityIntegral + tmp.BattleIntegral - winItemResp = append(winItemResp, tmp) - integralChangeReq = append(integralChangeReq, integral_manager.ChangeIntegralReq{ - BattleId: in.BattleId, - UserId: uid, - Change: tmp.TotalIntegral, - Type: pb.IntegralType_Battle, - }) +func (l *StatPvpReportLogic) calcScoreResponse(sum sumType, items []*statPvPReportItem) { + for _, item := range items { + itemResp := &pb.StatPvPReportResp_Item{ + Uid: item.Uid, + Uname: item.Uname, + Score: 0, } + damageScore, _ := decimal.NewFromInt(item.damage). + Div(decimal.NewFromInt(sum.damage)). + Mul(decimal.NewFromFloat32(0.3)). + Mul(decimal.NewFromInt(100)). + Round(1).Float64() + deDamageScore, _ := decimal.NewFromInt(item.deDamage). + Div(decimal.NewFromInt(sum.deDamage)). + Mul(decimal.NewFromFloat32(0.1)). + Mul(decimal.NewFromInt(100)). + Round(1).Float64() + killPlayerScore, _ := decimal.NewFromInt(item.killPlayer). + Div(decimal.NewFromInt(sum.killPlayer)). + Mul(decimal.NewFromFloat32(0.3)). + Mul(decimal.NewFromInt(100)). + Round(1).Float64() + deKillUnit := item.deKillUnit + if deKillUnit == 0 { + deKillUnit = 1 + } + kdScore, _ := decimal.NewFromInt(item.killUnit). + Div(decimal.NewFromInt(deKillUnit)). + Mul(decimal.NewFromFloat32(0.3)). + Mul(decimal.NewFromInt(30)). + Round(1).Float64() - for _, item := range in.LostItems { - uid, uname, position, damage := item.Uid, item.Uname, item.Position, item.Damage - battleIntegral := int64(float64(damage) * battleReportCfg.LostRadio) - tmp := &pb.StatPvPReportResp_Item{ - Uid: uid, - Uname: uname, - Position: position, - ReturnsIntegral: 0, - RewardPoolIntegral: 0, - GeneralIntegral: 0, - NobilityIntegral: 0, // TODO . 贵族加成分 再议 - BattleIntegral: battleIntegral, - TotalIntegral: 0, - } - tmp.TotalIntegral = tmp.ReturnsIntegral + tmp.RewardPoolIntegral + tmp.GeneralIntegral + tmp.NobilityIntegral + tmp.BattleIntegral - lostItemResp = append(lostItemResp, tmp) - integralChangeReq = append(integralChangeReq, integral_manager.ChangeIntegralReq{ - BattleId: in.BattleId, - UserId: uid, - Change: tmp.TotalIntegral, - Type: pb.IntegralType_Battle, - }) + itemResp.Score += float32(damageScore) + itemResp.Score += float32(deDamageScore) + itemResp.Score += float32(killPlayerScore) + itemResp.Score += float32(kdScore) + if item.firstBlood { + itemResp.Score += 5 } - // 统一结算积分 - _, err := l.svcCtx.IntegralManager.ChangeIntegralBatch(l.ctx, integralChangeReq, false) - if err != nil { - l.Logger.Errorf("积分结算失败 %v", err) + if item.deFirstBlood { + itemResp.Score -= 5 } - - resp.WinItems = winItemResp - resp.LostItems = lostItemResp + if item.deKillPlayer { + itemResp.Score -= 10 + } + if item.isGeneral { + itemResp.Score += 10 + } + item.StatPvPReportResp_Item = itemResp } - l.Logger.Info("PvP战报,记录成功...") - return resp, nil } -func (l *StatPvpReportLogic) reports(win bool, items []*pb.StatPvPReportReq_Item) error { +func (l *StatPvpReportLogic) reports(win bool, items []*statPvPReportItem) error { return l.svcCtx.StatisticsPvpModel.TransactCtx(l.ctx, nil, func(tx *gorm.DB) error { - for _, item := range items { - if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, item.Uid, - &model.UpdateRecordProps{ - Win: win, - Lost: !win, - Damage: &item.Damage, - DeDamage: &item.DeDamage, - KillUnitCount: &item.KillUnit, - DeKillUnitCount: &item.DeKillUnit, - }); err != nil { + for i, item := range items { + item.Position = int32(i + 1) + props := &model.UpdateRecordProps{ + Damage: item.damage, + DeDamage: item.deDamage, + KillUnitCount: item.killUnit, + DeKillUnitCount: item.deKillUnit, + Win: win, + Lost: !win, + KillPlayer: item.killPlayer, + DeKillPlayer: item.deKillPlayer, + DeGeneral: item.deKillPlayer && item.isGeneral, + FirstBlood: item.firstBlood, + DeFirstBlood: item.deFirstBlood, + } + if win && i == 0 { + // 名将 + props.General = true + } + + if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, item.Uid, props); err != nil { if errors.Is(err, gormx.ErrRowsAffectedZero) { // insert - var winCount int64 - var lostCount int64 + var ( + winCount, lostCount, deKillPlayer, generalCount, firstBloodCount, deFirstBloodCount int64 + ) if win { winCount = 1 } else { lostCount = 1 } + if item.deKillPlayer { + deKillPlayer = 1 + } + if props.General { + generalCount = 1 + } + if props.FirstBlood { + firstBloodCount = 1 + } + if props.DeFirstBlood { + deFirstBloodCount = 1 + } if err = l.svcCtx.StatisticsPvpModel.Insert(l.ctx, tx, &model.StatisticsPvp{ - UserId: item.Uid, - WinCount: winCount, - LostCount: lostCount, - Damage: item.Damage, - DeDamage: item.DeDamage, - KillUnitCount: item.KillUnit, - DeKillUnitCount: item.DeKillUnit, + UserId: item.uid, + WinCount: winCount, + LostCount: lostCount, + Damage: item.damage, + DeDamage: item.deDamage, + KillUnitCount: item.killUnit, + DeKillUnitCount: item.deKillUnit, + KillPlayerCount: item.killPlayer, + DeKillPlayerCount: deKillPlayer, + GeneralCount: generalCount, + DeGeneralCount: 0, + FirstBloodCount: firstBloodCount, + DeFirstBloodCount: deFirstBloodCount, }); err != nil { return errors.Wrapf(err, ErrInsertErr, err) } diff --git a/app/user_center/rpc/internal/logic/user/get_user_details_logic.go b/app/user_center/rpc/internal/logic/user/get_user_details_logic.go new file mode 100644 index 0000000..9ffbfce --- /dev/null +++ b/app/user_center/rpc/internal/logic/user/get_user_details_logic.go @@ -0,0 +1,124 @@ +package user + +import ( + "context" + "gorm.io/gorm" + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + "live-service/common/timex" + "time" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetUserDetailsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetUserDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserDetailsLogic { + return &GetUserDetailsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// getUserDetails 获取用户详细信息 +func (l *GetUserDetailsLogic) GetUserDetails(in *pb.UserIdReq) (*pb.UserDetailsResp, error) { + resp := &pb.UserDetailsResp{ + UserId: in.UserId, + } + // 贵族 + var nobilityLevel int32 + if dbNobility, err := l.svcCtx.UserNobilityModel.FindOne(l.ctx, nil, in.UserId); err == nil { + nobilityLevel = int32(dbNobility.NobilityLevel) + // 判断过期 + if time.Now().After(dbNobility.EndTime) { + if !dbNobility.Forever { + nobilityLevel = 0 + } + } + } + resp.NobilityLevel = nobilityLevel + // 金币 + var coin int64 + if dbCoin, err := l.svcCtx.CoinManager.GetUserCoin(l.ctx, in.UserId); err == nil { + coin = dbCoin + } + resp.Coin = coin + + nowTime := time.Now() + // 当前佩戴 称号/精英单位 + var currentTitle pb.UserDetailsResp_TitleItem + var currentElite pb.UserDetailsResp_EliteItem + + _ = l.svcCtx.Db.Transaction(func(tx *gorm.DB) error { + if zhgUserDetails, err := l.svcCtx.ZhgUserDetailsModel.FindOne(l.ctx, tx, in.UserId); err == nil { + if dbTitle, err := l.svcCtx.UserTitleModel.FindOneByUserIdTitleId(l.ctx, tx, in.UserId, zhgUserDetails.Title); err == nil { + if !timex.DayExpire(nowTime, dbTitle.EndTime, bool(dbTitle.Forever)) { + var name string + if cfg, err := l.svcCtx.GameConfig.Title.FindTitleCfg(dbTitle.TitleId); err == nil { + name = cfg.Name + } + currentTitle = pb.UserDetailsResp_TitleItem{ + Id: dbTitle.TitleId, + Name: name, + Sort: int32(dbTitle.Sort), + Remain: timex.DayRemain(nowTime, dbTitle.EndTime, bool(dbTitle.Forever)), + } + } + } + if dbElite, err := l.svcCtx.UserEliteModel.FindOneByUserIdEliteId(l.ctx, tx, in.UserId, zhgUserDetails.Elite); err == nil { + if !timex.DayExpire(nowTime, dbElite.EndTime, bool(dbElite.Forever)) { + currentElite = pb.UserDetailsResp_EliteItem{ + Id: dbElite.EliteId, + Sort: int32(dbElite.Sort), + Remain: timex.DayRemain(nowTime, dbElite.EndTime, bool(dbElite.Forever)), + } + } + } + } + return nil + }) + + resp.CurrentTitle = ¤tTitle + resp.CurrentElite = ¤tElite + + // 拥有 称号/精英单位 列表 + elites := make([]*pb.UserDetailsResp_EliteItem, 0) + if dbElites, err := l.svcCtx.UserEliteModel.FindByUserId(l.ctx, nil, in.UserId); err == nil { + for _, item := range dbElites { + if !timex.DayExpire(nowTime, item.EndTime, bool(item.Forever)) { + elites = append(elites, &pb.UserDetailsResp_EliteItem{ + Id: item.EliteId, + Sort: int32(item.Sort), + Remain: timex.DayRemain(nowTime, item.EndTime, bool(item.Forever)), + }) + } + } + } + resp.Elites = elites + + titles := make([]*pb.UserDetailsResp_TitleItem, 0) + if dbTitles, err := l.svcCtx.UserTitleModel.FindByUserId(l.ctx, nil, in.UserId); err == nil { + for _, item := range dbTitles { + if !timex.DayExpire(nowTime, item.EndTime, bool(item.Forever)) { + var name string + if cfg, err := l.svcCtx.GameConfig.Title.FindTitleCfg(item.TitleId); err == nil { + name = cfg.Name + } + titles = append(titles, &pb.UserDetailsResp_TitleItem{ + Id: item.TitleId, + Name: name, + Sort: int32(item.Sort), + Remain: timex.DayRemain(nowTime, item.EndTime, bool(item.Forever)), + }) + } + } + } + resp.Titles = titles + + return resp, nil +} diff --git a/app/user_center/rpc/internal/logic/user/retrieve_platform_user_logic.go b/app/user_center/rpc/internal/logic/user/retrieve_platform_user_logic.go index a76f38d..46dfd45 100644 --- a/app/user_center/rpc/internal/logic/user/retrieve_platform_user_logic.go +++ b/app/user_center/rpc/internal/logic/user/retrieve_platform_user_logic.go @@ -10,7 +10,6 @@ import ( "live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/pb" "live-service/common/nerr" - "time" ) type RetrievePlatformUserLogic struct { @@ -30,20 +29,15 @@ func NewRetrievePlatformUserLogic(ctx context.Context, svcCtx *svc.ServiceContex // RetrievePlatformUser 查询或创建用户(此时不通过API查询平台用户信息) func (l *RetrievePlatformUserLogic) RetrievePlatformUser(in *pb.PlatformUserReq) (*pb.PlatformUserResp, error) { - var dbFullUser *model.FullUser - var username string + var displayUser *model.UserForDisplay if err := l.svcCtx.Db.Transaction(func(tx *gorm.DB) error { var err error - if dbFullUser, err = l.svcCtx.UserPlatformModel.FindFullByPlatform(l.ctx, tx, in.Platform, in.PUid); err != nil { + if displayUser, err = l.svcCtx.UserPlatformModel.FindDisplayOneByPlatform(l.ctx, tx, in.Platform, in.PUid); err != nil { if !errors.Is(err, model.ErrNotFound) { return nerr.NewWithCode(nerr.DBError) } - } - if dbFullUser != nil { - if one, err := l.svcCtx.UserModel.FindOne(l.ctx, tx, dbFullUser.UserId); err != nil { - username = one.Username - } + } else { return nil } // : not found @@ -51,7 +45,7 @@ func (l *RetrievePlatformUserLogic) RetrievePlatformUser(in *pb.PlatformUserReq) // insert newId := uuid.NextId() if err := l.svcCtx.UserModel.Insert(l.ctx, tx, &model.User{Id: newId}); err != nil { - return errors.Wrap(nerr.NewWithCode(nerr.DBError), "插入用户数据失败") + return nerr.NewWithCode(nerr.DBError) } dbPlatformUser := &model.UserPlatform{ Id: uuid.NextId(), @@ -61,45 +55,20 @@ func (l *RetrievePlatformUserLogic) RetrievePlatformUser(in *pb.PlatformUserReq) PInfo: "{}", } if err := l.svcCtx.UserPlatformModel.Insert(l.ctx, tx, dbPlatformUser); err != nil { - return errors.Wrap(nerr.NewWithCode(nerr.DBError), "插入平台用户数据失败") + return nerr.NewWithCode(nerr.DBError) } - dbFullUser = &model.FullUser{ - UserPlatform: *dbPlatformUser, - UserNobility: model.UserNobility{ - UserId: newId, - NobilityLevel: 0, - }, - UserIntegral: model.UserIntegral{ - UserId: newId, - Integral: 0, - }, + displayUser = &model.UserForDisplay{ + UserId: newId, } return nil }); err != nil { return nil, errors.Wrapf(nerr.NewWithCode(nerr.DBError), "查询或创建用户-事务执行失败, err:%+v", err) } return &pb.PlatformUserResp{ - User: l.buildPBUser(username, dbFullUser), + Id: displayUser.UserId, + Platform: in.Platform, + PUid: in.PUid, + PUname: displayUser.PUname, + PAvatar: displayUser.PAvatar, }, nil } - -func (l *RetrievePlatformUserLogic) buildPBUser(username string, dbFullUser *model.FullUser) *pb.User { - resp := &pb.User{ - Id: dbFullUser.UserId, - Username: username, - Platform: dbFullUser.Platform, - PUid: dbFullUser.PUid, - PUname: dbFullUser.PUname, - PAvatar: dbFullUser.PAvatar, - NobilityLevel: int32(dbFullUser.UserNobility.NobilityLevel), - Integral: dbFullUser.UserIntegral.Integral, - } - // 贵族过期判断 - if time.Now().After(dbFullUser.UserNobility.EndTime) { - if !dbFullUser.UserNobility.Forever { - // 贵族过期,置为0 - resp.NobilityLevel = 0 - } - } - return resp -} diff --git a/app/user_center/rpc/internal/logic/user/user_check_in_logic.go b/app/user_center/rpc/internal/logic/user/user_check_in_logic.go index 37779ca..c2f4b91 100644 --- a/app/user_center/rpc/internal/logic/user/user_check_in_logic.go +++ b/app/user_center/rpc/internal/logic/user/user_check_in_logic.go @@ -6,9 +6,12 @@ import ( "github.com/pkg/errors" "github.com/zeromicro/go-zero/core/logx" "gorm.io/gorm" + pbVars "live-service/app/pb/vars" "live-service/app/user_center/model" + "live-service/app/user_center/rpc/internal/common/coin_manager" "live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/pb" + "live-service/common/nerr" "math/rand" "time" ) @@ -29,29 +32,20 @@ func NewUserCheckInLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserC const ( MsgAlreadyCheckIn = "今天已打过卡了!" - MsgCheckInSuccess = "打卡成功,哔哩哔哩 (゜-゜)つロ 干杯" -) - -var ( - ErrAlreadyCheckIn = errors.New(MsgAlreadyCheckIn) ) // UserCheckIn 用户签到|打卡 func (l *UserCheckInLogic) UserCheckIn(in *pb.UserIdReq) (*pb.UserCheckInResp, error) { resp := &pb.UserCheckInResp{ - Code: 0, - Msg: "", - IntegralChange: 0, - Integral: 0, - IsCritical: false, + IsCritical: false, } if err := l.svcCtx.Db.Transaction(func(tx *gorm.DB) error { isCheckInToday, err := l.svcCtx.UserCheckInModel.CheckInToday(l.ctx, tx, in.UserId) if err != nil { - return err + return nerr.NewWithCode(nerr.DBError) } if isCheckInToday { - return ErrAlreadyCheckIn + return nerr.NewError(nerr.UserAlreadyCheckIn, MsgAlreadyCheckIn) } // 打卡记录 if err = l.svcCtx.UserCheckInModel.Insert(l.ctx, tx, &model.UserCheckIn{ @@ -59,33 +53,31 @@ func (l *UserCheckInLogic) UserCheckIn(in *pb.UserIdReq) (*pb.UserCheckInResp, e UserId: in.UserId, CheckInTime: time.Now(), }); err != nil { - return err + return nerr.NewWithCode(nerr.DBError) } // 积分记录,计算当日可得积分 change, critical := l.getCriticalPoint() - if resp.Integral, err = l.svcCtx.UserIntegralModel.ChangeIntegral(l.ctx, tx, in.UserId, change); err != nil { - return err - } + changeCoinResp, err := l.svcCtx.CoinManager.ChangeCoin(l.ctx, tx, &coin_manager.ChangeCoinReq{ + UserId: in.UserId, + Change: change, + }, pbVars.UserCoinChangedReason_CheckIn) + if err != nil { + return errors.Wrapf(nerr.NewWithErr(err), "记录弹币失败, err:%+v", err) + } + resp.CurrentCoin = changeCoinResp.Current + resp.CoinChange = change resp.IsCritical = critical - resp.IntegralChange = change - resp.Msg = MsgCheckInSuccess - resp.Code = 200 - return nil }); err != nil { - if errors.Is(err, ErrAlreadyCheckIn) { - resp.Msg = MsgAlreadyCheckIn - return resp, nil - } - return nil, err + return nil, errors.Wrapf(nerr.NewWithErr(err), "打卡失败 err:%v", err) } return resp, nil } func (l *UserCheckInLogic) getCriticalPoint() (int64, bool) { - checkInCfg := l.svcCtx.Config.Integral.CheckIn + checkInCfg := l.svcCtx.GameConfig.Coin.CheckIn nt := time.Now() weekDay := int(nt.Weekday()) point := checkInCfg.Points[weekDay] diff --git a/app/user_center/rpc/internal/logic/zhg/buy_elite_logic.go b/app/user_center/rpc/internal/logic/zhg/buy_elite_logic.go new file mode 100644 index 0000000..28aa5a1 --- /dev/null +++ b/app/user_center/rpc/internal/logic/zhg/buy_elite_logic.go @@ -0,0 +1,60 @@ +package zhg + +import ( + "context" + "github.com/pkg/errors" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + pbVars "live-service/app/pb/vars" + "live-service/app/user_center/rpc/internal/common/coin_manager" + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + "live-service/common/nerr" + "time" +) + +type BuyEliteLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewBuyEliteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BuyEliteLogic { + return &BuyEliteLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *BuyEliteLogic) BuyElite(in *pb.EliteReq) (*pb.BuyEliteResp, error) { + elite, err := l.svcCtx.GameConfig.Elite.FindEliteCfgByLive(in.Sort) + if err != nil { + // 待购买的精英单位不存在 + return nil, errors.Wrapf(nerr.NewError(nerr.EliteConfigNotFoundErr, err.Error()), err.Error()) + } + resp := &pb.BuyEliteResp{ + UserId: in.UserId, + EliteId: elite.Id, + Cost: elite.PriceDay, + Duration: 1, + } + if err = l.svcCtx.Db.Transaction(func(tx *gorm.DB) error { + // 扣减弹币 + if _, err = l.svcCtx.CoinManager.ChangeCoin(l.ctx, tx, &coin_manager.ChangeCoinReq{ + UserId: in.UserId, + Change: -elite.PriceDay, + }, pbVars.UserCoinChangedReason_BuyEliteUnit); err != nil { + return err + } + + if err = l.svcCtx.UserEliteModel.Addon(l.ctx, nil, in.UserId, elite.Id, 24*time.Hour, false); err != nil { + return errors.Wrapf(nerr.NewWithErr(err), "兑换精英单位失败 err:%v", err) + } + + return nil + }); err != nil { + return nil, err + } + return resp, nil +} diff --git a/app/user_center/rpc/internal/logic/zhg/buy_title_logic.go b/app/user_center/rpc/internal/logic/zhg/buy_title_logic.go new file mode 100644 index 0000000..139688d --- /dev/null +++ b/app/user_center/rpc/internal/logic/zhg/buy_title_logic.go @@ -0,0 +1,67 @@ +package zhg + +import ( + "context" + "github.com/pkg/errors" + "gorm.io/gorm" + pbVars "live-service/app/pb/vars" + "live-service/app/user_center/model" + "live-service/app/user_center/rpc/internal/common/coin_manager" + "live-service/common/nerr" + "time" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type BuyTitleLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewBuyTitleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BuyTitleLogic { + return &BuyTitleLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *BuyTitleLogic) BuyTitle(in *pb.TitleReq) (*pb.BuyTitleResp, error) { + titleCfg, err := l.svcCtx.GameConfig.Title.FindTitleCfgByLive(in.Sort) + if err != nil { + return nil, nerr.NewError(nerr.TitleConfigNotFoundErr, err.Error()) + } + if titleCfg.Type != model.TitleTypeDefault { + return nil, nerr.NewError(nerr.TitleCannotBuyErr, "该称号禁止兑换") + } + + resp := &pb.BuyTitleResp{ + UserId: in.UserId, + TitleId: titleCfg.Id, + Name: titleCfg.Name, + Cost: titleCfg.PriceDay, + Duration: 1, + } + if err = l.svcCtx.Db.Transaction(func(tx *gorm.DB) error { + // 扣减弹币 + if _, err = l.svcCtx.CoinManager.ChangeCoin(l.ctx, tx, &coin_manager.ChangeCoinReq{ + UserId: in.UserId, + Change: -titleCfg.PriceDay, + }, pbVars.UserCoinChangedReason_BuyEliteUnit); err != nil { + return err + } + + if err = l.svcCtx.UserTitleModel.Addon(l.ctx, nil, in.UserId, titleCfg.Id, titleCfg.Type, 24*time.Hour, false); err != nil { + return errors.Wrapf(nerr.NewWithErr(err), "兑换称号失败 err:%v", err) + } + + return nil + }); err != nil { + return nil, err + } + return resp, nil +} diff --git a/app/user_center/rpc/internal/logic/zhg/change_elite_logic.go b/app/user_center/rpc/internal/logic/zhg/change_elite_logic.go new file mode 100644 index 0000000..fc6ddb1 --- /dev/null +++ b/app/user_center/rpc/internal/logic/zhg/change_elite_logic.go @@ -0,0 +1,66 @@ +package zhg + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" + "github.com/pkg/errors" + "live-service/app/user_center/model" + "live-service/common/nerr" + "live-service/common/timex" + "time" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ChangeEliteLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewChangeEliteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ChangeEliteLogic { + return &ChangeEliteLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ChangeEliteLogic) ChangeElite(in *pb.EliteReq) (*pb.ChangeEliteResp, error) { + resp := &pb.ChangeEliteResp{ + UserId: in.UserId, + } + eliteId := l.svcCtx.GameConfig.Elite.Default.Id + if in.Sort != l.svcCtx.GameConfig.Elite.Default.Sort { + dbModel, err := l.svcCtx.UserEliteModel.FindOneByUserIdSort(l.ctx, nil, in.UserId, int64(in.Sort)) + if err != nil { + if errors.Is(err, gormx.ErrNotFound) { + return nil, errors.Wrap(nerr.NewError(nerr.UserEliteNotFoundErr, "用户没有此单位"), "用户没有此单位") + } + return nil, errors.Wrap(nerr.NewWithCode(nerr.DBError), "数据库错误,请联系UP主") + } + // 判断过期 + if timex.DayExpire(time.Now(), dbModel.EndTime, bool(dbModel.Forever)) { + return nil, errors.Wrap(nerr.NewError(nerr.UserEliteExpiresErr, "待切换的精英单位已过期"), "待切换的精英单位已过期") + } + eliteId = dbModel.EliteId + } + + // 更新当前使用精英单位 + err := l.svcCtx.ZhgUserDetailsModel.Upsert(l.ctx, nil, &model.UpsertParam{ + UserId: in.UserId, + Elite: &eliteId, + }) + if err != nil { + if !errors.Is(err, gormx.ErrRowsAffectedZero) { + return nil, errors.Wrapf(nerr.NewError(nerr.UserChangeEliteErr, "切换精英单位失败"), "切换精英单位失败 err:%v", err) + } + } + + resp.EliteId = eliteId + + return resp, nil +} diff --git a/app/user_center/rpc/internal/logic/zhg/change_title_logic.go b/app/user_center/rpc/internal/logic/zhg/change_title_logic.go new file mode 100644 index 0000000..65c21f9 --- /dev/null +++ b/app/user_center/rpc/internal/logic/zhg/change_title_logic.go @@ -0,0 +1,68 @@ +package zhg + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormx" + "github.com/pkg/errors" + "live-service/app/user_center/model" + "live-service/common/nerr" + "live-service/common/timex" + "time" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ChangeTitleLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewChangeTitleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ChangeTitleLogic { + return &ChangeTitleLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *ChangeTitleLogic) ChangeTitle(in *pb.TitleReq) (*pb.ChangeTitleResp, error) { + resp := &pb.ChangeTitleResp{ + UserId: in.UserId, + } + + dbModel, err := l.svcCtx.UserTitleModel.FindOneByUserIdSort(l.ctx, nil, in.UserId, int64(in.Sort)) + if err != nil { + if errors.Is(err, gormx.ErrNotFound) { + return nil, errors.Wrap(nerr.NewError(nerr.UserTitleNotFoundErr, "用户没有此称号"), "用户没有此称号") + } + return nil, errors.Wrap(nerr.NewWithCode(nerr.DBError), "数据库错误,请联系UP主") + } + // 判断过期 + if timex.DayExpire(time.Now(), dbModel.EndTime, bool(dbModel.Forever)) { + return nil, errors.Wrap(nerr.NewError(nerr.UserTitleExpiresErr, "待切换的称号已过期"), "待切换的称号已过期") + } + + // 更新当前佩戴称号 + err = l.svcCtx.ZhgUserDetailsModel.Upsert(l.ctx, nil, &model.UpsertParam{ + UserId: in.UserId, + Title: &dbModel.TitleId, + }) + if err != nil { + if !errors.Is(err, gormx.ErrRowsAffectedZero) { + return nil, errors.Wrapf(nerr.NewError(nerr.UserChangeTitleErr, "切换称号失败"), "切换称号失败 err:%v", err) + } + } + + resp.TitleId = dbModel.TitleId + + var titleName string + if titleCfg, err := l.svcCtx.GameConfig.Title.FindTitleCfg(dbModel.TitleId); err == nil { + titleName = titleCfg.Name + } + resp.Name = titleName + return resp, nil +} diff --git a/app/user_center/rpc/internal/logic/zhg/give_elite_logic.go b/app/user_center/rpc/internal/logic/zhg/give_elite_logic.go new file mode 100644 index 0000000..7c57e9e --- /dev/null +++ b/app/user_center/rpc/internal/logic/zhg/give_elite_logic.go @@ -0,0 +1,55 @@ +package zhg + +import ( + "context" + "live-service/common/nerr" + "time" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GiveEliteLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGiveEliteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GiveEliteLogic { + return &GiveEliteLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *GiveEliteLogic) GiveElite(in *pb.GiveEliteReq) (*pb.BuyEliteResp, error) { + elite, err := l.svcCtx.GameConfig.Elite.FindEliteCfg(in.EliteId) + if err != nil { + return nil, nerr.NewError(nerr.EliteConfigNotFoundErr, err.Error()) + } + + duration := in.Duration + if in.Forever { + duration = -1 + } + resp := &pb.BuyEliteResp{ + UserId: in.UserId, + EliteId: elite.Id, + Cost: 0, + Duration: duration, + } + if duration < 0 { + duration = -duration + } else if duration == 0 { + duration = 1 + } + err = l.svcCtx.UserEliteModel.Addon(l.ctx, nil, in.UserId, elite.Id, time.Duration(duration)*24*time.Hour, in.Forever) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/app/user_center/rpc/internal/logic/zhg/give_title_logic.go b/app/user_center/rpc/internal/logic/zhg/give_title_logic.go new file mode 100644 index 0000000..caf6b43 --- /dev/null +++ b/app/user_center/rpc/internal/logic/zhg/give_title_logic.go @@ -0,0 +1,56 @@ +package zhg + +import ( + "context" + "live-service/common/nerr" + "time" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GiveTitleLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGiveTitleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GiveTitleLogic { + return &GiveTitleLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *GiveTitleLogic) GiveTitle(in *pb.GiveTitleReq) (*pb.BuyTitleResp, error) { + cfg, err := l.svcCtx.GameConfig.Title.FindTitleCfg(in.TitleId) + if err != nil { + return nil, nerr.NewError(nerr.EliteConfigNotFoundErr, err.Error()) + } + + duration := in.Duration + if in.Forever { + duration = -1 + } + resp := &pb.BuyTitleResp{ + UserId: in.UserId, + TitleId: cfg.Id, + Name: cfg.Name, + Cost: 0, + Duration: duration, + } + if duration < 0 { + duration = -duration + } else if duration == 0 { + duration = 1 + } + err = l.svcCtx.UserTitleModel.Addon(l.ctx, nil, in.UserId, cfg.Id, cfg.Type, time.Duration(duration)*24*time.Hour, in.Forever) + if err != nil { + return nil, err + } + + return resp, nil +} diff --git a/app/user_center/rpc/internal/mq/reward_pool.go b/app/user_center/rpc/internal/mq/reward_pool.go new file mode 100644 index 0000000..076b0f1 --- /dev/null +++ b/app/user_center/rpc/internal/mq/reward_pool.go @@ -0,0 +1,32 @@ +package mq + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/kafka" + "github.com/zeromicro/go-zero/core/logx" + pbMq "live-service/app/pb/mq" + "live-service/app/user_center/rpc/internal/config" + kfk "live-service/common/kafka" +) + +type ( + RewardPool struct { + producer *kafka.Producer // kafka + + logx.Logger + } +) + +func NewRewardPoolMq(cfg config.KafkaProducer) *RewardPool { + return &RewardPool{ + producer: kafka.NewKafkaProducer(kfk.DefaultProducerConfig, cfg.RewardPool.Addr, cfg.RewardPool.Topic), + Logger: logx.WithContext(context.Background()), + } +} + +func (m *RewardPool) RewardPoolChanged(req *pbMq.MqRewardPool) { + err := m.producer.SendMessageAsync(req) + if err != nil { + m.Logger.Error("发送通知奖池变更消息失败") + } +} diff --git a/app/user_center/rpc/internal/mq/user.go b/app/user_center/rpc/internal/mq/user.go new file mode 100644 index 0000000..9229d0d --- /dev/null +++ b/app/user_center/rpc/internal/mq/user.go @@ -0,0 +1,42 @@ +package mq + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/kafka" + "github.com/zeromicro/go-zero/core/logx" + pbMq "live-service/app/pb/mq" + "live-service/app/user_center/model" + "live-service/app/user_center/rpc/internal/config" + kfk "live-service/common/kafka" +) + +type ( + UserMq struct { + userPlatformModel model.UserPlatformModel + coinChangedKfk *kafka.Producer + + logx.Logger + } +) + +func NewUserMq(userPlatformModel model.UserPlatformModel, cfg config.KafkaProducer) *UserMq { + return &UserMq{ + userPlatformModel: userPlatformModel, + coinChangedKfk: kafka.NewKafkaProducer(kfk.DefaultProducerConfig, cfg.UserCoinNotify.Addr, cfg.UserCoinNotify.Topic), + Logger: logx.WithContext(context.Background()), + } +} + +func (m *UserMq) NotifyUserCoinChanged(req *pbMq.MqUserCoinChanged) { + if req.Username == "" || req.Avatar == "" { + // 读取用户数据 + if dbModel, err := m.userPlatformModel.FindDisplayOneByUserId(context.Background(), req.UserId); err == nil { + req.Username = dbModel.PUname + req.Avatar = dbModel.PAvatar + } + } + err := m.coinChangedKfk.SendMessageAsync(req) + if err != nil { + m.Logger.Error("发送通知用户金币变更消息失败") + } +} diff --git a/app/user_center/rpc/internal/server/user_center_server.go b/app/user_center/rpc/internal/server/user_center_server.go index ad02594..88d310c 100644 --- a/app/user_center/rpc/internal/server/user_center_server.go +++ b/app/user_center/rpc/internal/server/user_center_server.go @@ -5,12 +5,12 @@ package server import ( "context" - "live-service/app/user_center/rpc/internal/logic/draw_pool" + "live-service/app/user_center/rpc/internal/logic/coin" "live-service/app/user_center/rpc/internal/logic/gift" - "live-service/app/user_center/rpc/internal/logic/integral" "live-service/app/user_center/rpc/internal/logic/rank" "live-service/app/user_center/rpc/internal/logic/statistics" "live-service/app/user_center/rpc/internal/logic/user" + "live-service/app/user_center/rpc/internal/logic/zhg" "live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/pb" @@ -33,57 +33,53 @@ func (s *UserCenterServer) RetrievePlatformUser(ctx context.Context, in *pb.Plat return l.RetrievePlatformUser(in) } +// getUserDetails 获取用户详细信息 +func (s *UserCenterServer) GetUserDetails(ctx context.Context, in *pb.UserIdReq) (*pb.UserDetailsResp, error) { + l := user.NewGetUserDetailsLogic(ctx, s.svcCtx) + return l.GetUserDetails(in) +} + // getUserIdByPUid 通过平台用户id获取系统用户ID func (s *UserCenterServer) GetUserIdByPUid(ctx context.Context, in *pb.PlatformUserReq) (*pb.UserIdResp, error) { l := user.NewGetUserIdByPUidLogic(ctx, s.svcCtx) return l.GetUserIdByPUid(in) } -// ChangeIntegral 新增用户积分 -func (s *UserCenterServer) ChangeIntegral(ctx context.Context, in *pb.ChangeIntegralReq) (*pb.ChangeIntegralResp, error) { - l := integral.NewChangeIntegralLogic(ctx, s.svcCtx) - return l.ChangeIntegral(in) -} - -// GetUserIntegral 获取用户积分 -func (s *UserCenterServer) GetUserIntegral(ctx context.Context, in *pb.UserIdReq) (*pb.UserIntegralResp, error) { - l := integral.NewGetUserIntegralLogic(ctx, s.svcCtx) - return l.GetUserIntegral(in) -} - // UserCheckIn 用户签到|打卡 func (s *UserCenterServer) UserCheckIn(ctx context.Context, in *pb.UserIdReq) (*pb.UserCheckInResp, error) { l := user.NewUserCheckInLogic(ctx, s.svcCtx) return l.UserCheckIn(in) } -// TransferUserIntegral 转移积分 -func (s *UserCenterServer) TransferUserIntegral(ctx context.Context, in *pb.TransferUserIntegralReq) (*pb.TransferUserIntegralResp, error) { - l := integral.NewTransferUserIntegralLogic(ctx, s.svcCtx) - return l.TransferUserIntegral(in) +// changeCoin 新增或扣减用户弹币 +func (s *UserCenterServer) ChangeCoin(ctx context.Context, in *pb.ChangeCoinReq) (*pb.Empty, error) { + l := coin.NewChangeCoinLogic(ctx, s.svcCtx) + return l.ChangeCoin(in) +} + +// getUserCoin 获取用户弹币 +func (s *UserCenterServer) GetUserCoin(ctx context.Context, in *pb.UserIdReq) (*pb.GetUserCoinResp, error) { + l := coin.NewGetUserCoinLogic(ctx, s.svcCtx) + return l.GetUserCoin(in) +} + +// transferUserCoin 转移用户弹币 +func (s *UserCenterServer) TransferUserCoin(ctx context.Context, in *pb.TransferUserCoinReq) (*pb.TransferUserCoinResp, error) { + l := coin.NewTransferUserCoinLogic(ctx, s.svcCtx) + return l.TransferUserCoin(in) } // UserSendGift 用户赠送礼物 -func (s *UserCenterServer) UserSendGift(ctx context.Context, in *pb.UserSendGiftReq) (*pb.UserSendGiftResp, error) { +func (s *UserCenterServer) UserSendGift(ctx context.Context, in *pb.UserSendGiftReq) (*pb.Empty, error) { l := gift.NewUserSendGiftLogic(ctx, s.svcCtx) return l.UserSendGift(in) } -func (s *UserCenterServer) UserBuyNobility(ctx context.Context, in *pb.UserBuyNobilityReq) (*pb.UserBuyNobilityResp, error) { +func (s *UserCenterServer) UserBuyNobility(ctx context.Context, in *pb.UserBuyNobilityReq) (*pb.Empty, error) { l := gift.NewUserBuyNobilityLogic(ctx, s.svcCtx) return l.UserBuyNobility(in) } -func (s *UserCenterServer) StatPvpKill(ctx context.Context, in *pb.StatPvPKillReq) (*pb.Empty, error) { - l := statistics.NewStatPvpKillLogic(ctx, s.svcCtx) - return l.StatPvpKill(in) -} - -func (s *UserCenterServer) StatPvpFirstBlood(ctx context.Context, in *pb.StatPvPFirstBloodReq) (*pb.Empty, error) { - l := statistics.NewStatPvpFirstBloodLogic(ctx, s.svcCtx) - return l.StatPvpFirstBlood(in) -} - func (s *UserCenterServer) StatPvpReport(ctx context.Context, in *pb.StatPvPReportReq) (*pb.StatPvPReportResp, error) { l := statistics.NewStatPvpReportLogic(ctx, s.svcCtx) return l.StatPvpReport(in) @@ -94,11 +90,6 @@ func (s *UserCenterServer) DrawGiftPack(ctx context.Context, in *pb.DrawGiftPack return l.DrawGiftPack(in) } -func (s *UserCenterServer) IncreaseWelfare(ctx context.Context, in *pb.IncreaseWelfareReq) (*pb.Empty, error) { - l := draw_pool.NewIncreaseWelfareLogic(ctx, s.svcCtx) - return l.IncreaseWelfare(in) -} - // rankPvp pvp排行 func (s *UserCenterServer) RankPvp(ctx context.Context, in *pb.RankPvpReq) (*pb.RankPvpResp, error) { l := rank.NewRankPvpLogic(ctx, s.svcCtx) @@ -114,3 +105,33 @@ func (s *UserCenterServer) UserRankPvp(ctx context.Context, in *pb.UserRankReq) l := rank.NewUserRankPvpLogic(ctx, s.svcCtx) return l.UserRankPvp(in) } + +func (s *UserCenterServer) GiveElite(ctx context.Context, in *pb.GiveEliteReq) (*pb.BuyEliteResp, error) { + l := zhg.NewGiveEliteLogic(ctx, s.svcCtx) + return l.GiveElite(in) +} + +func (s *UserCenterServer) BuyElite(ctx context.Context, in *pb.EliteReq) (*pb.BuyEliteResp, error) { + l := zhg.NewBuyEliteLogic(ctx, s.svcCtx) + return l.BuyElite(in) +} + +func (s *UserCenterServer) GiveTitle(ctx context.Context, in *pb.GiveTitleReq) (*pb.BuyTitleResp, error) { + l := zhg.NewGiveTitleLogic(ctx, s.svcCtx) + return l.GiveTitle(in) +} + +func (s *UserCenterServer) BuyTitle(ctx context.Context, in *pb.TitleReq) (*pb.BuyTitleResp, error) { + l := zhg.NewBuyTitleLogic(ctx, s.svcCtx) + return l.BuyTitle(in) +} + +func (s *UserCenterServer) ChangeElite(ctx context.Context, in *pb.EliteReq) (*pb.ChangeEliteResp, error) { + l := zhg.NewChangeEliteLogic(ctx, s.svcCtx) + return l.ChangeElite(in) +} + +func (s *UserCenterServer) ChangeTitle(ctx context.Context, in *pb.TitleReq) (*pb.ChangeTitleResp, error) { + l := zhg.NewChangeTitleLogic(ctx, s.svcCtx) + return l.ChangeTitle(in) +} diff --git a/app/user_center/rpc/internal/svc/service_context.go b/app/user_center/rpc/internal/svc/service_context.go index 1e1f1bc..74033fe 100644 --- a/app/user_center/rpc/internal/svc/service_context.go +++ b/app/user_center/rpc/internal/svc/service_context.go @@ -1,41 +1,48 @@ package svc import ( - "git.noahlan.cn/northlan/ntools-go/kafka" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" "live-service/app/user_center/model" - "live-service/app/user_center/rpc/internal/common/integral_manager" - "live-service/app/user_center/rpc/internal/common/reward_pool" + "live-service/app/user_center/rpc/internal/common/coin_manager" "live-service/app/user_center/rpc/internal/config" - kfk "live-service/common/kafka" + "live-service/app/user_center/rpc/internal/mq" "log" "os" "time" ) type ServiceContext struct { - Config config.Config - Db *gorm.DB + Config *config.Config + GameConfig *config.GameConfig + Db *gorm.DB UserModel model.UserModel UserPlatformModel model.UserPlatformModel UserGiftModel model.UserGiftModel UserIntegralModel model.UserIntegralModel + UserCoinModel model.UserCoinModel UserNobilityModel model.UserNobilityModel UserCheckInModel model.UserCheckInModel - StatisticsPvpModel model.StatisticsPvpModel - RankPvpModel model.RankPvpModel + UserEliteModel model.UserEliteModel + UserTitleModel model.UserTitleModel + ZhgUserDetailsModel model.ZhgUserDetailsModel + StatisticsPvpModel model.StatisticsPvpModel + RankPvpModel model.RankPvpModel GiftModel model.GiftModel - RewardPoolManager *reward_pool.PoolManager - IntegralManager *integral_manager.Manager + ////////////// mq + UserMq *mq.UserMq // 用户MQ + RewardPoolMq *mq.RewardPool // 奖池MQ + + //RewardPoolManager *reward_pool.PoolManager + CoinManager *coin_manager.Manager } -func NewServiceContext(c config.Config) *ServiceContext { +func NewServiceContext(c *config.Config, cg *config.GameConfig) *ServiceContext { var logLevel logger.LogLevel if c.Log.Mode == "console" { logLevel = logger.Info @@ -56,32 +63,48 @@ func NewServiceContext(c config.Config) *ServiceContext { if err != nil { log.Fatal(err) } + userPlatformModel := model.NewUserPlatformModel(gormDb) userIntegralModel := model.NewUserIntegralModel(gormDb) + userCoinModel := model.NewUserCoinModel(gormDb) + + userMq := mq.NewUserMq(userPlatformModel, c.Kafka) + rewardPoolMq := mq.NewRewardPoolMq(c.Kafka) - rewardPoolManager := reward_pool.NewRewardPoolManager( - c.Integral.RewardPool.InitReward, - reward_pool.Ratio{ - Ratio: c.Integral.RewardPool.Ratio, - BattleRatio: c.Integral.RewardPool.BattleRatio, - GiftRatio: c.Integral.RewardPool.GiftRatio, - ReturnRatio: c.Integral.RewardPool.ReturnRatio, - WelfareRatio: c.Integral.RewardPool.WelfareRatio, - }, - kafka.NewKafkaProducer(kfk.DefaultProducerConfig, c.Kafka.RewardPool.Addr, c.Kafka.RewardPool.Topic)) + //rewardPoolManager := reward_pool.NewRewardPoolManager( + // c.Integral.RewardPool.InitReward, + // reward_pool.Ratio{ + // Ratio: c.Integral.RewardPool.Ratio, + // BattleRatio: c.Integral.RewardPool.BattleRatio, + // GiftRatio: c.Integral.RewardPool.GiftRatio, + // ReturnRatio: c.Integral.RewardPool.ReturnRatio, + // WelfareRatio: c.Integral.RewardPool.WelfareRatio, + // }, + // rewardPoolMq) return &ServiceContext{ - Config: c, - Db: gormDb, - UserModel: model.NewUserModel(gormDb), - UserPlatformModel: model.NewUserPlatformModel(gormDb), - UserGiftModel: model.NewUserGiftModel(gormDb), - UserIntegralModel: userIntegralModel, - UserNobilityModel: model.NewUserNobilityModel(gormDb), - UserCheckInModel: model.NewUserCheckInModel(gormDb), - StatisticsPvpModel: model.NewStatisticsPvpModel(gormDb), - RankPvpModel: model.NewRankPvpModel(gormDb), - GiftModel: model.NewGiftModel(gormDb), - RewardPoolManager: rewardPoolManager, - IntegralManager: integral_manager.NewIntegralManager(userIntegralModel, rewardPoolManager), + Config: c, + GameConfig: cg, + Db: gormDb, + + UserModel: model.NewUserModel(gormDb), + UserPlatformModel: userPlatformModel, + UserGiftModel: model.NewUserGiftModel(gormDb), + UserIntegralModel: userIntegralModel, + UserCoinModel: userCoinModel, + UserNobilityModel: model.NewUserNobilityModel(gormDb), + UserCheckInModel: model.NewUserCheckInModel(gormDb), + + UserEliteModel: model.NewUserEliteModel(gormDb), + UserTitleModel: model.NewUserTitleModel(gormDb), + ZhgUserDetailsModel: model.NewZhgUserDetailsModel(gormDb), + StatisticsPvpModel: model.NewStatisticsPvpModel(gormDb), + RankPvpModel: model.NewRankPvpModel(gormDb), + GiftModel: model.NewGiftModel(gormDb), + + UserMq: userMq, + RewardPoolMq: rewardPoolMq, + + //RewardPoolManager: rewardPoolManager, + CoinManager: coin_manager.NewCoinManager(userCoinModel, userMq), } } diff --git a/app/user_center/rpc/pb/generate.go b/app/user_center/rpc/pb/generate.go index 12c2758..b8775ae 100644 --- a/app/user_center/rpc/pb/generate.go +++ b/app/user_center/rpc/pb/generate.go @@ -1,3 +1,3 @@ package pb -//go:generate goctl rpc protoc user_center.proto --style=go_zero --go_out=../ --go-grpc_out=../ --zrpc_out=../ +//go:generate goctl rpc protoc user_center.proto --proto_path=. --proto_path=../../../pb/ --style=go_zero --go_out=../ --go-grpc_out=../ --zrpc_out=../ diff --git a/app/user_center/rpc/pb/user_center.pb.go b/app/user_center/rpc/pb/user_center.pb.go index 556bd71..17f7690 100644 --- a/app/user_center/rpc/pb/user_center.pb.go +++ b/app/user_center/rpc/pb/user_center.pb.go @@ -9,6 +9,7 @@ package pb import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + vars "live-service/app/pb/vars" reflect "reflect" sync "sync" ) @@ -20,55 +21,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type IntegralType int32 - -const ( - IntegralType_Battle IntegralType = 0 // 战斗 - IntegralType_Gift IntegralType = 1 // 礼物 - IntegralType_Other IntegralType = 10 // 其它积分 -) - -// Enum value maps for IntegralType. -var ( - IntegralType_name = map[int32]string{ - 0: "Battle", - 1: "Gift", - 10: "Other", - } - IntegralType_value = map[string]int32{ - "Battle": 0, - "Gift": 1, - "Other": 10, - } -) - -func (x IntegralType) Enum() *IntegralType { - p := new(IntegralType) - *p = x - return p -} - -func (x IntegralType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (IntegralType) Descriptor() protoreflect.EnumDescriptor { - return file_user_center_proto_enumTypes[0].Descriptor() -} - -func (IntegralType) Type() protoreflect.EnumType { - return &file_user_center_proto_enumTypes[0] -} - -func (x IntegralType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use IntegralType.Descriptor instead. -func (IntegralType) EnumDescriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{0} -} - type GiftType int32 const ( @@ -99,11 +51,11 @@ func (x GiftType) String() string { } func (GiftType) Descriptor() protoreflect.EnumDescriptor { - return file_user_center_proto_enumTypes[1].Descriptor() + return file_user_center_proto_enumTypes[0].Descriptor() } func (GiftType) Type() protoreflect.EnumType { - return &file_user_center_proto_enumTypes[1] + return &file_user_center_proto_enumTypes[0] } func (x GiftType) Number() protoreflect.EnumNumber { @@ -112,108 +64,18 @@ func (x GiftType) Number() protoreflect.EnumNumber { // Deprecated: Use GiftType.Descriptor instead. func (GiftType) EnumDescriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{1} -} - -////////////////////// rank -type RankType int32 - -const ( - RankType_Unknown RankType = 0 - RankType_Damage RankType = 1 // 伤害榜 - RankType_DeDamage RankType = 2 // 受伤榜 - RankType_General RankType = 3 // 名将榜 - RankType_DeGeneral RankType = 4 // 落马榜 - RankType_KillUnit RankType = 5 // 小兵击杀 - RankType_DeKillUnit RankType = 6 // 小兵被杀 - RankType_KillPlayer RankType = 7 // 击杀玩家 - RankType_DeKillPlayer RankType = 8 // 被杀榜 - RankType_Win RankType = 9 // 获胜榜 - RankType_Lost RankType = 10 // 战败榜 - RankType_FirstBlood RankType = 11 // 一血榜 - RankType_DeFirstBlood RankType = 12 // 被拿一血榜 -) - -// Enum value maps for RankType. -var ( - RankType_name = map[int32]string{ - 0: "Unknown", - 1: "Damage", - 2: "DeDamage", - 3: "General", - 4: "DeGeneral", - 5: "KillUnit", - 6: "DeKillUnit", - 7: "KillPlayer", - 8: "DeKillPlayer", - 9: "Win", - 10: "Lost", - 11: "FirstBlood", - 12: "DeFirstBlood", - } - RankType_value = map[string]int32{ - "Unknown": 0, - "Damage": 1, - "DeDamage": 2, - "General": 3, - "DeGeneral": 4, - "KillUnit": 5, - "DeKillUnit": 6, - "KillPlayer": 7, - "DeKillPlayer": 8, - "Win": 9, - "Lost": 10, - "FirstBlood": 11, - "DeFirstBlood": 12, - } -) - -func (x RankType) Enum() *RankType { - p := new(RankType) - *p = x - return p -} - -func (x RankType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RankType) Descriptor() protoreflect.EnumDescriptor { - return file_user_center_proto_enumTypes[2].Descriptor() -} - -func (RankType) Type() protoreflect.EnumType { - return &file_user_center_proto_enumTypes[2] -} - -func (x RankType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RankType.Descriptor instead. -func (RankType) EnumDescriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{2} + return file_user_center_proto_rawDescGZIP(), []int{0} } // model -type User struct { +type Empty struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - // platform - Platform string `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"` - PUid string `protobuf:"bytes,4,opt,name=pUid,proto3" json:"pUid,omitempty"` - PUname string `protobuf:"bytes,5,opt,name=pUname,proto3" json:"pUname,omitempty"` - PAvatar string `protobuf:"bytes,6,opt,name=pAvatar,proto3" json:"pAvatar,omitempty"` - NobilityLevel int32 `protobuf:"varint,7,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级 - Integral int64 `protobuf:"varint,8,opt,name=integral,proto3" json:"integral,omitempty"` // 用户积分(充值) } -func (x *User) Reset() { - *x = User{} +func (x *Empty) Reset() { + *x = Empty{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -221,13 +83,13 @@ func (x *User) Reset() { } } -func (x *User) String() string { +func (x *Empty) String() string { return protoimpl.X.MessageStringOf(x) } -func (*User) ProtoMessage() {} +func (*Empty) ProtoMessage() {} -func (x *User) ProtoReflect() protoreflect.Message { +func (x *Empty) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -239,75 +101,22 @@ func (x *User) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{0} } -func (x *User) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *User) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *User) GetPlatform() string { - if x != nil { - return x.Platform - } - return "" -} - -func (x *User) GetPUid() string { - if x != nil { - return x.PUid - } - return "" -} - -func (x *User) GetPUname() string { - if x != nil { - return x.PUname - } - return "" -} - -func (x *User) GetPAvatar() string { - if x != nil { - return x.PAvatar - } - return "" -} - -func (x *User) GetNobilityLevel() int32 { - if x != nil { - return x.NobilityLevel - } - return 0 -} - -func (x *User) GetIntegral() int64 { - if x != nil { - return x.Integral - } - return 0 -} - -type Empty struct { +type Response struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // code + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // msg } -func (x *Empty) Reset() { - *x = Empty{} +func (x *Response) Reset() { + *x = Response{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -315,13 +124,13 @@ func (x *Empty) Reset() { } } -func (x *Empty) String() string { +func (x *Response) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Empty) ProtoMessage() {} +func (*Response) ProtoMessage() {} -func (x *Empty) ProtoReflect() protoreflect.Message { +func (x *Response) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -333,11 +142,25 @@ func (x *Empty) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Empty.ProtoReflect.Descriptor instead. -func (*Empty) Descriptor() ([]byte, []int) { +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{1} } +func (x *Response) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Response) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + // req type PlatformUserReq struct { state protoimpl.MessageState @@ -399,7 +222,12 @@ type PlatformUserResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // platform + Platform string `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"` + PUid string `protobuf:"bytes,4,opt,name=pUid,proto3" json:"pUid,omitempty"` + PUname string `protobuf:"bytes,5,opt,name=pUname,proto3" json:"pUname,omitempty"` + PAvatar string `protobuf:"bytes,6,opt,name=pAvatar,proto3" json:"pAvatar,omitempty"` } func (x *PlatformUserResp) Reset() { @@ -434,24 +262,58 @@ func (*PlatformUserResp) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{3} } -func (x *PlatformUserResp) GetUser() *User { +func (x *PlatformUserResp) GetId() int64 { if x != nil { - return x.User + return x.Id } - return nil + return 0 } -// 用户ID请求 -type UserIdReq struct { +func (x *PlatformUserResp) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *PlatformUserResp) GetPUid() string { + if x != nil { + return x.PUid + } + return "" +} + +func (x *PlatformUserResp) GetPUname() string { + if x != nil { + return x.PUname + } + return "" +} + +func (x *PlatformUserResp) GetPAvatar() string { + if x != nil { + return x.PAvatar + } + return "" +} + +// 用户详细信息返回 +type UserDetailsResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 系统用户ID + NobilityLevel int32 `protobuf:"varint,2,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级 + Coin int64 `protobuf:"varint,3,opt,name=coin,proto3" json:"coin,omitempty"` // 金币 + CurrentTitle *UserDetailsResp_TitleItem `protobuf:"bytes,4,opt,name=currentTitle,proto3" json:"currentTitle,omitempty"` // 当前佩戴的称号ID + CurrentElite *UserDetailsResp_EliteItem `protobuf:"bytes,5,opt,name=currentElite,proto3" json:"currentElite,omitempty"` // 当前使用的精英单位ID + Titles []*UserDetailsResp_TitleItem `protobuf:"bytes,6,rep,name=titles,proto3" json:"titles,omitempty"` // 拥有的称号列表 + Elites []*UserDetailsResp_EliteItem `protobuf:"bytes,7,rep,name=elites,proto3" json:"elites,omitempty"` // 拥有的精英单位列表 } -func (x *UserIdReq) Reset() { - *x = UserIdReq{} +func (x *UserDetailsResp) Reset() { + *x = UserDetailsResp{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -459,13 +321,13 @@ func (x *UserIdReq) Reset() { } } -func (x *UserIdReq) String() string { +func (x *UserDetailsResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserIdReq) ProtoMessage() {} +func (*UserDetailsResp) ProtoMessage() {} -func (x *UserIdReq) ProtoReflect() protoreflect.Message { +func (x *UserDetailsResp) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -477,20 +339,62 @@ func (x *UserIdReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserIdReq.ProtoReflect.Descriptor instead. -func (*UserIdReq) Descriptor() ([]byte, []int) { +// Deprecated: Use UserDetailsResp.ProtoReflect.Descriptor instead. +func (*UserDetailsResp) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{4} } -func (x *UserIdReq) GetUserId() int64 { +func (x *UserDetailsResp) GetUserId() int64 { if x != nil { return x.UserId } return 0 } -// 用户ID回复 -type UserIdResp struct { +func (x *UserDetailsResp) GetNobilityLevel() int32 { + if x != nil { + return x.NobilityLevel + } + return 0 +} + +func (x *UserDetailsResp) GetCoin() int64 { + if x != nil { + return x.Coin + } + return 0 +} + +func (x *UserDetailsResp) GetCurrentTitle() *UserDetailsResp_TitleItem { + if x != nil { + return x.CurrentTitle + } + return nil +} + +func (x *UserDetailsResp) GetCurrentElite() *UserDetailsResp_EliteItem { + if x != nil { + return x.CurrentElite + } + return nil +} + +func (x *UserDetailsResp) GetTitles() []*UserDetailsResp_TitleItem { + if x != nil { + return x.Titles + } + return nil +} + +func (x *UserDetailsResp) GetElites() []*UserDetailsResp_EliteItem { + if x != nil { + return x.Elites + } + return nil +} + +// 用户ID请求 +type UserIdReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -498,8 +402,8 @@ type UserIdResp struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` } -func (x *UserIdResp) Reset() { - *x = UserIdResp{} +func (x *UserIdReq) Reset() { + *x = UserIdReq{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -507,13 +411,13 @@ func (x *UserIdResp) Reset() { } } -func (x *UserIdResp) String() string { +func (x *UserIdReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserIdResp) ProtoMessage() {} +func (*UserIdReq) ProtoMessage() {} -func (x *UserIdResp) ProtoReflect() protoreflect.Message { +func (x *UserIdReq) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -525,32 +429,29 @@ func (x *UserIdResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserIdResp.ProtoReflect.Descriptor instead. -func (*UserIdResp) Descriptor() ([]byte, []int) { +// Deprecated: Use UserIdReq.ProtoReflect.Descriptor instead. +func (*UserIdReq) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{5} } -func (x *UserIdResp) GetUserId() int64 { +func (x *UserIdReq) GetUserId() int64 { if x != nil { return x.UserId } return 0 } -// 变更积分请求 -type ChangeIntegralReq struct { +// 用户ID回复 +type UserIdResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 系统用户ID - BattleId int64 `protobuf:"varint,2,opt,name=battleId,proto3" json:"battleId,omitempty"` // 战斗ID(RPC内部) - Change int64 `protobuf:"varint,3,opt,name=change,proto3" json:"change,omitempty"` // 变更数量 - IntegralType IntegralType `protobuf:"varint,4,opt,name=integralType,proto3,enum=pb.IntegralType" json:"integralType,omitempty"` // 积分类型 + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` } -func (x *ChangeIntegralReq) Reset() { - *x = ChangeIntegralReq{} +func (x *UserIdResp) Reset() { + *x = UserIdResp{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -558,13 +459,13 @@ func (x *ChangeIntegralReq) Reset() { } } -func (x *ChangeIntegralReq) String() string { +func (x *UserIdResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ChangeIntegralReq) ProtoMessage() {} +func (*UserIdResp) ProtoMessage() {} -func (x *ChangeIntegralReq) ProtoReflect() protoreflect.Message { +func (x *UserIdResp) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -576,52 +477,29 @@ func (x *ChangeIntegralReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ChangeIntegralReq.ProtoReflect.Descriptor instead. -func (*ChangeIntegralReq) Descriptor() ([]byte, []int) { +// Deprecated: Use UserIdResp.ProtoReflect.Descriptor instead. +func (*UserIdResp) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{6} } -func (x *ChangeIntegralReq) GetUserId() int64 { +func (x *UserIdResp) GetUserId() int64 { if x != nil { return x.UserId } return 0 } -func (x *ChangeIntegralReq) GetBattleId() int64 { - if x != nil { - return x.BattleId - } - return 0 -} - -func (x *ChangeIntegralReq) GetChange() int64 { - if x != nil { - return x.Change - } - return 0 -} - -func (x *ChangeIntegralReq) GetIntegralType() IntegralType { - if x != nil { - return x.IntegralType - } - return IntegralType_Battle -} - -// 变更积分回复 -type ChangeIntegralResp struct { +type GetUserCoinResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 系统用户ID - Change int64 `protobuf:"varint,2,opt,name=change,proto3" json:"change,omitempty"` // 本次变更积分数量,负数为扣减 - Integral int64 `protobuf:"varint,3,opt,name=integral,proto3" json:"integral,omitempty"` // 用户当前总积分 + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + Current int64 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` // 当前量 } -func (x *ChangeIntegralResp) Reset() { - *x = ChangeIntegralResp{} +func (x *GetUserCoinResp) Reset() { + *x = GetUserCoinResp{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -629,13 +507,13 @@ func (x *ChangeIntegralResp) Reset() { } } -func (x *ChangeIntegralResp) String() string { +func (x *GetUserCoinResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ChangeIntegralResp) ProtoMessage() {} +func (*GetUserCoinResp) ProtoMessage() {} -func (x *ChangeIntegralResp) ProtoReflect() protoreflect.Message { +func (x *GetUserCoinResp) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -647,44 +525,39 @@ func (x *ChangeIntegralResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ChangeIntegralResp.ProtoReflect.Descriptor instead. -func (*ChangeIntegralResp) Descriptor() ([]byte, []int) { +// Deprecated: Use GetUserCoinResp.ProtoReflect.Descriptor instead. +func (*GetUserCoinResp) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{7} } -func (x *ChangeIntegralResp) GetUserId() int64 { +func (x *GetUserCoinResp) GetUserId() int64 { if x != nil { return x.UserId } return 0 } -func (x *ChangeIntegralResp) GetChange() int64 { +func (x *GetUserCoinResp) GetCurrent() int64 { if x != nil { - return x.Change + return x.Current } return 0 } -func (x *ChangeIntegralResp) GetIntegral() int64 { - if x != nil { - return x.Integral - } - return 0 -} - -// 用户积分回复 -type UserIntegralResp struct { +// 变更弹币请求 +type ChangeCoinReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 用户ID - Integral int64 `protobuf:"varint,2,opt,name=integral,proto3" json:"integral,omitempty"` // 用户当前总积分 + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 系统用户ID + BattleId int64 `protobuf:"varint,2,opt,name=battleId,proto3" json:"battleId,omitempty"` // 战局ID + Change int64 `protobuf:"varint,3,opt,name=change,proto3" json:"change,omitempty"` // 变更数量 + Reason vars.UserCoinChangedReason `protobuf:"varint,4,opt,name=reason,proto3,enum=pb.vars.UserCoinChangedReason" json:"reason,omitempty"` // 原因 } -func (x *UserIntegralResp) Reset() { - *x = UserIntegralResp{} +func (x *ChangeCoinReq) Reset() { + *x = ChangeCoinReq{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -692,13 +565,13 @@ func (x *UserIntegralResp) Reset() { } } -func (x *UserIntegralResp) String() string { +func (x *ChangeCoinReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserIntegralResp) ProtoMessage() {} +func (*ChangeCoinReq) ProtoMessage() {} -func (x *UserIntegralResp) ProtoReflect() protoreflect.Message { +func (x *ChangeCoinReq) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -710,40 +583,52 @@ func (x *UserIntegralResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserIntegralResp.ProtoReflect.Descriptor instead. -func (*UserIntegralResp) Descriptor() ([]byte, []int) { +// Deprecated: Use ChangeCoinReq.ProtoReflect.Descriptor instead. +func (*ChangeCoinReq) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{8} } -func (x *UserIntegralResp) GetUserId() int64 { +func (x *ChangeCoinReq) GetUserId() int64 { if x != nil { return x.UserId } return 0 } -func (x *UserIntegralResp) GetIntegral() int64 { +func (x *ChangeCoinReq) GetBattleId() int64 { if x != nil { - return x.Integral + return x.BattleId } return 0 } -// 用户打卡(签到)回复 -type UserCheckInResp struct { +func (x *ChangeCoinReq) GetChange() int64 { + if x != nil { + return x.Change + } + return 0 +} + +func (x *ChangeCoinReq) GetReason() vars.UserCoinChangedReason { + if x != nil { + return x.Reason + } + return vars.UserCoinChangedReason(0) +} + +// 转移用户弹币 +type TransferUserCoinReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // 消息 - IntegralChange int64 `protobuf:"varint,3,opt,name=integralChange,proto3" json:"integralChange,omitempty"` // 积分变动量 - Integral int64 `protobuf:"varint,4,opt,name=integral,proto3" json:"integral,omitempty"` // 变动后的积分量 - IsCritical bool `protobuf:"varint,5,opt,name=isCritical,proto3" json:"isCritical,omitempty"` // 是否发生了暴击奖励 + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 源用户ID + TargetUserId int64 `protobuf:"varint,2,opt,name=targetUserId,proto3" json:"targetUserId,omitempty"` // 目标用户 + Transfer int64 `protobuf:"varint,3,opt,name=transfer,proto3" json:"transfer,omitempty"` // 待转移量 } -func (x *UserCheckInResp) Reset() { - *x = UserCheckInResp{} +func (x *TransferUserCoinReq) Reset() { + *x = TransferUserCoinReq{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -751,13 +636,13 @@ func (x *UserCheckInResp) Reset() { } } -func (x *UserCheckInResp) String() string { +func (x *TransferUserCoinReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserCheckInResp) ProtoMessage() {} +func (*TransferUserCoinReq) ProtoMessage() {} -func (x *UserCheckInResp) ProtoReflect() protoreflect.Message { +func (x *TransferUserCoinReq) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -769,59 +654,50 @@ func (x *UserCheckInResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserCheckInResp.ProtoReflect.Descriptor instead. -func (*UserCheckInResp) Descriptor() ([]byte, []int) { +// Deprecated: Use TransferUserCoinReq.ProtoReflect.Descriptor instead. +func (*TransferUserCoinReq) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{9} } -func (x *UserCheckInResp) GetCode() int32 { +func (x *TransferUserCoinReq) GetUserId() int64 { if x != nil { - return x.Code + return x.UserId } return 0 } -func (x *UserCheckInResp) GetMsg() string { - if x != nil { - return x.Msg - } - return "" -} - -func (x *UserCheckInResp) GetIntegralChange() int64 { +func (x *TransferUserCoinReq) GetTargetUserId() int64 { if x != nil { - return x.IntegralChange + return x.TargetUserId } return 0 } -func (x *UserCheckInResp) GetIntegral() int64 { +func (x *TransferUserCoinReq) GetTransfer() int64 { if x != nil { - return x.Integral + return x.Transfer } return 0 } -func (x *UserCheckInResp) GetIsCritical() bool { - if x != nil { - return x.IsCritical - } - return false -} - -// 转移用户积分 -type TransferUserIntegralReq struct { +// 转移用户弹币 回复 +type TransferUserCoinResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 源用户ID - TargetUserId int64 `protobuf:"varint,2,opt,name=targetUserId,proto3" json:"targetUserId,omitempty"` // 目标用户 - Transfer int64 `protobuf:"varint,3,opt,name=transfer,proto3" json:"transfer,omitempty"` // 待转移量 + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` + Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` + TargetUserId int64 `protobuf:"varint,4,opt,name=targetUserId,proto3" json:"targetUserId,omitempty"` + TargetUname string `protobuf:"bytes,5,opt,name=targetUname,proto3" json:"targetUname,omitempty"` + TargetAvatar string `protobuf:"bytes,6,opt,name=targetAvatar,proto3" json:"targetAvatar,omitempty"` + UserCoin int64 `protobuf:"varint,10,opt,name=userCoin,proto3" json:"userCoin,omitempty"` // 源用户剩余 + TargetUserCoin int64 `protobuf:"varint,11,opt,name=targetUserCoin,proto3" json:"targetUserCoin,omitempty"` // 目标用户剩余 } -func (x *TransferUserIntegralReq) Reset() { - *x = TransferUserIntegralReq{} +func (x *TransferUserCoinResp) Reset() { + *x = TransferUserCoinResp{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -829,13 +705,13 @@ func (x *TransferUserIntegralReq) Reset() { } } -func (x *TransferUserIntegralReq) String() string { +func (x *TransferUserCoinResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*TransferUserIntegralReq) ProtoMessage() {} +func (*TransferUserCoinResp) ProtoMessage() {} -func (x *TransferUserIntegralReq) ProtoReflect() protoreflect.Message { +func (x *TransferUserCoinResp) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -847,51 +723,80 @@ func (x *TransferUserIntegralReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use TransferUserIntegralReq.ProtoReflect.Descriptor instead. -func (*TransferUserIntegralReq) Descriptor() ([]byte, []int) { +// Deprecated: Use TransferUserCoinResp.ProtoReflect.Descriptor instead. +func (*TransferUserCoinResp) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{10} } -func (x *TransferUserIntegralReq) GetUserId() int64 { +func (x *TransferUserCoinResp) GetUserId() int64 { if x != nil { return x.UserId } return 0 } -func (x *TransferUserIntegralReq) GetTargetUserId() int64 { +func (x *TransferUserCoinResp) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + +func (x *TransferUserCoinResp) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *TransferUserCoinResp) GetTargetUserId() int64 { if x != nil { return x.TargetUserId } return 0 } -func (x *TransferUserIntegralReq) GetTransfer() int64 { +func (x *TransferUserCoinResp) GetTargetUname() string { if x != nil { - return x.Transfer + return x.TargetUname + } + return "" +} + +func (x *TransferUserCoinResp) GetTargetAvatar() string { + if x != nil { + return x.TargetAvatar + } + return "" +} + +func (x *TransferUserCoinResp) GetUserCoin() int64 { + if x != nil { + return x.UserCoin + } + return 0 +} + +func (x *TransferUserCoinResp) GetTargetUserCoin() int64 { + if x != nil { + return x.TargetUserCoin } return 0 } -type TransferUserIntegralResp struct { +// 用户打卡(签到)回复 +type UserCheckInResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // 消息 - UserId int64 `protobuf:"varint,3,opt,name=userId,proto3" json:"userId,omitempty"` - Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` - Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` - TargetUserId int64 `protobuf:"varint,6,opt,name=targetUserId,proto3" json:"targetUserId,omitempty"` - TargetUname string `protobuf:"bytes,7,opt,name=targetUname,proto3" json:"targetUname,omitempty"` - TargetAvatar string `protobuf:"bytes,8,opt,name=targetAvatar,proto3" json:"targetAvatar,omitempty"` - UserIntegral int64 `protobuf:"varint,10,opt,name=userIntegral,proto3" json:"userIntegral,omitempty"` // 源用户积分剩余 - TargetUserIntegral int64 `protobuf:"varint,11,opt,name=targetUserIntegral,proto3" json:"targetUserIntegral,omitempty"` // 目标用户积分剩余 + CoinChange int64 `protobuf:"varint,1,opt,name=coinChange,proto3" json:"coinChange,omitempty"` // 弹币变更量 + CurrentCoin int64 `protobuf:"varint,2,opt,name=currentCoin,proto3" json:"currentCoin,omitempty"` // 现有弹币量 + IsCritical bool `protobuf:"varint,3,opt,name=isCritical,proto3" json:"isCritical,omitempty"` // 是否发生了暴击奖励 } -func (x *TransferUserIntegralResp) Reset() { - *x = TransferUserIntegralResp{} +func (x *UserCheckInResp) Reset() { + *x = UserCheckInResp{} if protoimpl.UnsafeEnabled { mi := &file_user_center_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -899,13 +804,13 @@ func (x *TransferUserIntegralResp) Reset() { } } -func (x *TransferUserIntegralResp) String() string { +func (x *UserCheckInResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*TransferUserIntegralResp) ProtoMessage() {} +func (*UserCheckInResp) ProtoMessage() {} -func (x *TransferUserIntegralResp) ProtoReflect() protoreflect.Message { +func (x *UserCheckInResp) ProtoReflect() protoreflect.Message { mi := &file_user_center_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -917,79 +822,30 @@ func (x *TransferUserIntegralResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use TransferUserIntegralResp.ProtoReflect.Descriptor instead. -func (*TransferUserIntegralResp) Descriptor() ([]byte, []int) { +// Deprecated: Use UserCheckInResp.ProtoReflect.Descriptor instead. +func (*UserCheckInResp) Descriptor() ([]byte, []int) { return file_user_center_proto_rawDescGZIP(), []int{11} } -func (x *TransferUserIntegralResp) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *TransferUserIntegralResp) GetMsg() string { - if x != nil { - return x.Msg - } - return "" -} - -func (x *TransferUserIntegralResp) GetUserId() int64 { +func (x *UserCheckInResp) GetCoinChange() int64 { if x != nil { - return x.UserId - } - return 0 -} - -func (x *TransferUserIntegralResp) GetUname() string { - if x != nil { - return x.Uname - } - return "" -} - -func (x *TransferUserIntegralResp) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -func (x *TransferUserIntegralResp) GetTargetUserId() int64 { - if x != nil { - return x.TargetUserId + return x.CoinChange } return 0 } -func (x *TransferUserIntegralResp) GetTargetUname() string { - if x != nil { - return x.TargetUname - } - return "" -} - -func (x *TransferUserIntegralResp) GetTargetAvatar() string { - if x != nil { - return x.TargetAvatar - } - return "" -} - -func (x *TransferUserIntegralResp) GetUserIntegral() int64 { +func (x *UserCheckInResp) GetCurrentCoin() int64 { if x != nil { - return x.UserIntegral + return x.CurrentCoin } return 0 } -func (x *TransferUserIntegralResp) GetTargetUserIntegral() int64 { +func (x *UserCheckInResp) GetIsCritical() bool { if x != nil { - return x.TargetUserIntegral + return x.IsCritical } - return 0 + return false } // 用户送礼请求 @@ -1112,54 +968,6 @@ func (x *UserSendGiftReq) GetBattleId() int64 { return 0 } -// 用户送礼回复 -type UserSendGiftResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Integral *ChangeIntegralResp `protobuf:"bytes,10,opt,name=integral,proto3" json:"integral,omitempty"` // 积分变动 -} - -func (x *UserSendGiftResp) Reset() { - *x = UserSendGiftResp{} - if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserSendGiftResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserSendGiftResp) ProtoMessage() {} - -func (x *UserSendGiftResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[13] - 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 UserSendGiftResp.ProtoReflect.Descriptor instead. -func (*UserSendGiftResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{13} -} - -func (x *UserSendGiftResp) GetIntegral() *ChangeIntegralResp { - if x != nil { - return x.Integral - } - return nil -} - // 用户购买舰长请求 type UserBuyNobilityReq struct { state protoimpl.MessageState @@ -1183,7 +991,7 @@ type UserBuyNobilityReq struct { func (x *UserBuyNobilityReq) Reset() { *x = UserBuyNobilityReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[14] + mi := &file_user_center_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1196,7 +1004,7 @@ func (x *UserBuyNobilityReq) String() string { func (*UserBuyNobilityReq) ProtoMessage() {} func (x *UserBuyNobilityReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[14] + mi := &file_user_center_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1209,7 +1017,7 @@ func (x *UserBuyNobilityReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UserBuyNobilityReq.ProtoReflect.Descriptor instead. func (*UserBuyNobilityReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{14} + return file_user_center_proto_rawDescGZIP(), []int{13} } func (x *UserBuyNobilityReq) GetPlatform() string { @@ -1296,32 +1104,35 @@ func (x *UserBuyNobilityReq) GetEndTime() int64 { return 0 } -// 用户购买舰长回复 -type UserBuyNobilityResp struct { +// 通知-PvP战报 statistics.pvp.report +type StatPvPReportReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Integral *ChangeIntegralResp `protobuf:"bytes,10,opt,name=integral,proto3" json:"integral,omitempty"` // 积分变动 + WinCamp int32 `protobuf:"varint,1,opt,name=winCamp,proto3" json:"winCamp,omitempty"` // 获胜阵营 1-蓝 2-红 + BattleId int64 `protobuf:"varint,2,opt,name=battleId,proto3" json:"battleId,omitempty"` // 战斗ID + WinItems []*StatPvPReportReq_Item `protobuf:"bytes,10,rep,name=winItems,proto3" json:"winItems,omitempty"` // 获胜方数据 + LostItems []*StatPvPReportReq_Item `protobuf:"bytes,11,rep,name=lostItems,proto3" json:"lostItems,omitempty"` // 战败方数据 } -func (x *UserBuyNobilityResp) Reset() { - *x = UserBuyNobilityResp{} +func (x *StatPvPReportReq) Reset() { + *x = StatPvPReportReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[15] + mi := &file_user_center_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UserBuyNobilityResp) String() string { +func (x *StatPvPReportReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserBuyNobilityResp) ProtoMessage() {} +func (*StatPvPReportReq) ProtoMessage() {} -func (x *UserBuyNobilityResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[15] +func (x *StatPvPReportReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1332,46 +1143,68 @@ func (x *UserBuyNobilityResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserBuyNobilityResp.ProtoReflect.Descriptor instead. -func (*UserBuyNobilityResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{15} +// Deprecated: Use StatPvPReportReq.ProtoReflect.Descriptor instead. +func (*StatPvPReportReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{14} } -func (x *UserBuyNobilityResp) GetIntegral() *ChangeIntegralResp { +func (x *StatPvPReportReq) GetWinCamp() int32 { + if x != nil { + return x.WinCamp + } + return 0 +} + +func (x *StatPvPReportReq) GetBattleId() int64 { + if x != nil { + return x.BattleId + } + return 0 +} + +func (x *StatPvPReportReq) GetWinItems() []*StatPvPReportReq_Item { + if x != nil { + return x.WinItems + } + return nil +} + +func (x *StatPvPReportReq) GetLostItems() []*StatPvPReportReq_Item { if x != nil { - return x.Integral + return x.LostItems } return nil } -// 通知-PvP杀兵营(人) statistics.pvp.kill -type StatPvPKillReq struct { +// 通知-PvP战报 回复 +type StatPvPReportResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID - TargetUid int64 `protobuf:"varint,2,opt,name=targetUid,proto3" json:"targetUid,omitempty"` // 目标用户 - IsGeneral bool `protobuf:"varint,3,opt,name=isGeneral,proto3" json:"isGeneral,omitempty"` // targetUid是否名将 + WinCamp int32 `protobuf:"varint,1,opt,name=winCamp,proto3" json:"winCamp,omitempty"` // 获胜阵营 1-蓝 2-红 + BattleId int64 `protobuf:"varint,2,opt,name=battleId,proto3" json:"battleId,omitempty"` // 战斗ID + WinItems []*StatPvPReportResp_Item `protobuf:"bytes,10,rep,name=winItems,proto3" json:"winItems,omitempty"` // 获胜方数据 + LostItems []*StatPvPReportResp_Item `protobuf:"bytes,11,rep,name=lostItems,proto3" json:"lostItems,omitempty"` // 战败方数据 } -func (x *StatPvPKillReq) Reset() { - *x = StatPvPKillReq{} +func (x *StatPvPReportResp) Reset() { + *x = StatPvPReportResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[16] + mi := &file_user_center_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *StatPvPKillReq) String() string { +func (x *StatPvPReportResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*StatPvPKillReq) ProtoMessage() {} +func (*StatPvPReportResp) ProtoMessage() {} -func (x *StatPvPKillReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[16] +func (x *StatPvPReportResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1382,244 +1215,67 @@ func (x *StatPvPKillReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use StatPvPKillReq.ProtoReflect.Descriptor instead. -func (*StatPvPKillReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{16} +// Deprecated: Use StatPvPReportResp.ProtoReflect.Descriptor instead. +func (*StatPvPReportResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{15} } -func (x *StatPvPKillReq) GetUid() int64 { +func (x *StatPvPReportResp) GetWinCamp() int32 { if x != nil { - return x.Uid + return x.WinCamp } return 0 } -func (x *StatPvPKillReq) GetTargetUid() int64 { +func (x *StatPvPReportResp) GetBattleId() int64 { if x != nil { - return x.TargetUid + return x.BattleId } return 0 } -func (x *StatPvPKillReq) GetIsGeneral() bool { +func (x *StatPvPReportResp) GetWinItems() []*StatPvPReportResp_Item { if x != nil { - return x.IsGeneral + return x.WinItems } - return false + return nil +} + +func (x *StatPvPReportResp) GetLostItems() []*StatPvPReportResp_Item { + if x != nil { + return x.LostItems + } + return nil } -// 通知-PvP一血 statistics.pvp.first -type StatPvPFirstBloodReq struct { +type GiftPackItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID - Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` // 1-拿到一血 2-被破一血 + PackType string `protobuf:"bytes,1,opt,name=packType,proto3" json:"packType,omitempty"` // 礼包类型 starter:新手礼包 + PackName string `protobuf:"bytes,2,opt,name=packName,proto3" json:"packName,omitempty"` // 礼包名称 + Coin int64 `protobuf:"varint,3,opt,name=coin,proto3" json:"coin,omitempty"` // 获取的弹币 + Title []string `protobuf:"bytes,4,rep,name=title,proto3" json:"title,omitempty"` // 获取的称号 } -func (x *StatPvPFirstBloodReq) Reset() { - *x = StatPvPFirstBloodReq{} +func (x *GiftPackItem) Reset() { + *x = GiftPackItem{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[17] + mi := &file_user_center_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *StatPvPFirstBloodReq) String() string { +func (x *GiftPackItem) String() string { return protoimpl.X.MessageStringOf(x) } -func (*StatPvPFirstBloodReq) ProtoMessage() {} +func (*GiftPackItem) ProtoMessage() {} -func (x *StatPvPFirstBloodReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[17] - 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 StatPvPFirstBloodReq.ProtoReflect.Descriptor instead. -func (*StatPvPFirstBloodReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{17} -} - -func (x *StatPvPFirstBloodReq) GetUid() int64 { - if x != nil { - return x.Uid - } - return 0 -} - -func (x *StatPvPFirstBloodReq) GetType() int32 { - if x != nil { - return x.Type - } - return 0 -} - -// 通知-PvP战报 statistics.pvp.report -type StatPvPReportReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - WinCamp int32 `protobuf:"varint,1,opt,name=winCamp,proto3" json:"winCamp,omitempty"` // 获胜阵营 1-蓝 2-红 - BattleId int64 `protobuf:"varint,2,opt,name=battleId,proto3" json:"battleId,omitempty"` // 战斗ID - WinItems []*StatPvPReportReq_Item `protobuf:"bytes,10,rep,name=winItems,proto3" json:"winItems,omitempty"` // 获胜方数据 - LostItems []*StatPvPReportReq_Item `protobuf:"bytes,11,rep,name=lostItems,proto3" json:"lostItems,omitempty"` // 战败方数据 -} - -func (x *StatPvPReportReq) Reset() { - *x = StatPvPReportReq{} - if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatPvPReportReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatPvPReportReq) ProtoMessage() {} - -func (x *StatPvPReportReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[18] - 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 StatPvPReportReq.ProtoReflect.Descriptor instead. -func (*StatPvPReportReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{18} -} - -func (x *StatPvPReportReq) GetWinCamp() int32 { - if x != nil { - return x.WinCamp - } - return 0 -} - -func (x *StatPvPReportReq) GetBattleId() int64 { - if x != nil { - return x.BattleId - } - return 0 -} - -func (x *StatPvPReportReq) GetWinItems() []*StatPvPReportReq_Item { - if x != nil { - return x.WinItems - } - return nil -} - -func (x *StatPvPReportReq) GetLostItems() []*StatPvPReportReq_Item { - if x != nil { - return x.LostItems - } - return nil -} - -// 通知-PvP战报 回复 -type StatPvPReportResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - WinItems []*StatPvPReportResp_Item `protobuf:"bytes,1,rep,name=winItems,proto3" json:"winItems,omitempty"` // 获胜方数据 - LostItems []*StatPvPReportResp_Item `protobuf:"bytes,2,rep,name=lostItems,proto3" json:"lostItems,omitempty"` // 战败方数据 -} - -func (x *StatPvPReportResp) Reset() { - *x = StatPvPReportResp{} - if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatPvPReportResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatPvPReportResp) ProtoMessage() {} - -func (x *StatPvPReportResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[19] - 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 StatPvPReportResp.ProtoReflect.Descriptor instead. -func (*StatPvPReportResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{19} -} - -func (x *StatPvPReportResp) GetWinItems() []*StatPvPReportResp_Item { - if x != nil { - return x.WinItems - } - return nil -} - -func (x *StatPvPReportResp) GetLostItems() []*StatPvPReportResp_Item { - if x != nil { - return x.LostItems - } - return nil -} - -type GiftPackItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PackType string `protobuf:"bytes,1,opt,name=packType,proto3" json:"packType,omitempty"` // 礼包类型 starter:新手礼包 - PackName string `protobuf:"bytes,2,opt,name=packName,proto3" json:"packName,omitempty"` // 礼包名称 - Integral int64 `protobuf:"varint,3,opt,name=integral,proto3" json:"integral,omitempty"` // 获取的积分 - Title []string `protobuf:"bytes,4,rep,name=title,proto3" json:"title,omitempty"` // 获取的称号 -} - -func (x *GiftPackItem) Reset() { - *x = GiftPackItem{} - if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GiftPackItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GiftPackItem) ProtoMessage() {} - -func (x *GiftPackItem) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[20] +func (x *GiftPackItem) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1632,7 +1288,7 @@ func (x *GiftPackItem) ProtoReflect() protoreflect.Message { // Deprecated: Use GiftPackItem.ProtoReflect.Descriptor instead. func (*GiftPackItem) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{20} + return file_user_center_proto_rawDescGZIP(), []int{16} } func (x *GiftPackItem) GetPackType() string { @@ -1649,9 +1305,9 @@ func (x *GiftPackItem) GetPackName() string { return "" } -func (x *GiftPackItem) GetIntegral() int64 { +func (x *GiftPackItem) GetCoin() int64 { if x != nil { - return x.Integral + return x.Coin } return 0 } @@ -1677,7 +1333,7 @@ type DrawGiftPackReq struct { func (x *DrawGiftPackReq) Reset() { *x = DrawGiftPackReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[21] + mi := &file_user_center_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1690,7 +1346,7 @@ func (x *DrawGiftPackReq) String() string { func (*DrawGiftPackReq) ProtoMessage() {} func (x *DrawGiftPackReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[21] + mi := &file_user_center_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1703,7 +1359,7 @@ func (x *DrawGiftPackReq) ProtoReflect() protoreflect.Message { // Deprecated: Use DrawGiftPackReq.ProtoReflect.Descriptor instead. func (*DrawGiftPackReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{21} + return file_user_center_proto_rawDescGZIP(), []int{17} } func (x *DrawGiftPackReq) GetUid() int64 { @@ -1734,15 +1390,13 @@ type DrawGiftPackResp struct { Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` - Code int32 `protobuf:"varint,3,opt,name=code,proto3" json:"code,omitempty"` // 领取结果 200:成功 201100:已经领取过 201101:已领取完 - Msg string `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` // 消息 [领取成功|已经领取过|该用户已领取(当日|每周|每月)完所有礼包] Item *GiftPackItem `protobuf:"bytes,10,opt,name=item,proto3" json:"item,omitempty"` } func (x *DrawGiftPackResp) Reset() { *x = DrawGiftPackResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[22] + mi := &file_user_center_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1755,7 +1409,7 @@ func (x *DrawGiftPackResp) String() string { func (*DrawGiftPackResp) ProtoMessage() {} func (x *DrawGiftPackResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[22] + mi := &file_user_center_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1768,7 +1422,7 @@ func (x *DrawGiftPackResp) ProtoReflect() protoreflect.Message { // Deprecated: Use DrawGiftPackResp.ProtoReflect.Descriptor instead. func (*DrawGiftPackResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{22} + return file_user_center_proto_rawDescGZIP(), []int{18} } func (x *DrawGiftPackResp) GetUid() int64 { @@ -1785,20 +1439,6 @@ func (x *DrawGiftPackResp) GetUname() string { return "" } -func (x *DrawGiftPackResp) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *DrawGiftPackResp) GetMsg() string { - if x != nil { - return x.Msg - } - return "" -} - func (x *DrawGiftPackResp) GetItem() *GiftPackItem { if x != nil { return x.Item @@ -1820,7 +1460,7 @@ type IncreaseWelfareReq struct { func (x *IncreaseWelfareReq) Reset() { *x = IncreaseWelfareReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[23] + mi := &file_user_center_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1833,7 +1473,7 @@ func (x *IncreaseWelfareReq) String() string { func (*IncreaseWelfareReq) ProtoMessage() {} func (x *IncreaseWelfareReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[23] + mi := &file_user_center_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1846,7 +1486,7 @@ func (x *IncreaseWelfareReq) ProtoReflect() protoreflect.Message { // Deprecated: Use IncreaseWelfareReq.ProtoReflect.Descriptor instead. func (*IncreaseWelfareReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{23} + return file_user_center_proto_rawDescGZIP(), []int{19} } func (x *IncreaseWelfareReq) GetUid() int64 { @@ -1875,14 +1515,14 @@ type RankPvpReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // rank类型 - TopN int32 `protobuf:"varint,2,opt,name=topN,proto3" json:"topN,omitempty"` // TopN + Type vars.RankType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.vars.RankType" json:"type,omitempty"` // rank类型 + TopN int32 `protobuf:"varint,2,opt,name=topN,proto3" json:"topN,omitempty"` // TopN } func (x *RankPvpReq) Reset() { *x = RankPvpReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[24] + mi := &file_user_center_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1895,7 +1535,7 @@ func (x *RankPvpReq) String() string { func (*RankPvpReq) ProtoMessage() {} func (x *RankPvpReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[24] + mi := &file_user_center_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1908,14 +1548,14 @@ func (x *RankPvpReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpReq.ProtoReflect.Descriptor instead. func (*RankPvpReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{24} + return file_user_center_proto_rawDescGZIP(), []int{20} } -func (x *RankPvpReq) GetType() int32 { +func (x *RankPvpReq) GetType() vars.RankType { if x != nil { return x.Type } - return 0 + return vars.RankType(0) } func (x *RankPvpReq) GetTopN() int32 { @@ -1930,14 +1570,14 @@ type RankPvpResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // rank类型 - Items []*RankPvpResp_Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // rank数据 + Type vars.RankType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.vars.RankType" json:"type,omitempty"` // rank类型 + Items []*RankPvpResp_Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // rank数据 } func (x *RankPvpResp) Reset() { *x = RankPvpResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[25] + mi := &file_user_center_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1950,7 +1590,7 @@ func (x *RankPvpResp) String() string { func (*RankPvpResp) ProtoMessage() {} func (x *RankPvpResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[25] + mi := &file_user_center_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1963,14 +1603,14 @@ func (x *RankPvpResp) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpResp.ProtoReflect.Descriptor instead. func (*RankPvpResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{25} + return file_user_center_proto_rawDescGZIP(), []int{21} } -func (x *RankPvpResp) GetType() int32 { +func (x *RankPvpResp) GetType() vars.RankType { if x != nil { return x.Type } - return 0 + return vars.RankType(0) } func (x *RankPvpResp) GetItems() []*RankPvpResp_Item { @@ -1986,14 +1626,14 @@ type RankPvpSubmitReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RankType int32 `protobuf:"varint,1,opt,name=rankType,proto3" json:"rankType,omitempty"` // 待结算的排行榜类型 - AllRankType bool `protobuf:"varint,2,opt,name=allRankType,proto3" json:"allRankType,omitempty"` // 是否直接结算所有排行类型 + RankType vars.RankType `protobuf:"varint,1,opt,name=rankType,proto3,enum=pb.vars.RankType" json:"rankType,omitempty"` // 待结算的排行榜类型 + AllRankType bool `protobuf:"varint,2,opt,name=allRankType,proto3" json:"allRankType,omitempty"` // 是否直接结算所有排行类型 } func (x *RankPvpSubmitReq) Reset() { *x = RankPvpSubmitReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[26] + mi := &file_user_center_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2006,7 +1646,7 @@ func (x *RankPvpSubmitReq) String() string { func (*RankPvpSubmitReq) ProtoMessage() {} func (x *RankPvpSubmitReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[26] + mi := &file_user_center_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2019,14 +1659,14 @@ func (x *RankPvpSubmitReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpSubmitReq.ProtoReflect.Descriptor instead. func (*RankPvpSubmitReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{26} + return file_user_center_proto_rawDescGZIP(), []int{22} } -func (x *RankPvpSubmitReq) GetRankType() int32 { +func (x *RankPvpSubmitReq) GetRankType() vars.RankType { if x != nil { return x.RankType } - return 0 + return vars.RankType(0) } func (x *RankPvpSubmitReq) GetAllRankType() bool { @@ -2047,7 +1687,7 @@ type RankPvpSubmitResp struct { func (x *RankPvpSubmitResp) Reset() { *x = RankPvpSubmitResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[27] + mi := &file_user_center_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2060,7 +1700,7 @@ func (x *RankPvpSubmitResp) String() string { func (*RankPvpSubmitResp) ProtoMessage() {} func (x *RankPvpSubmitResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[27] + mi := &file_user_center_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2073,45 +1713,685 @@ func (x *RankPvpSubmitResp) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpSubmitResp.ProtoReflect.Descriptor instead. func (*RankPvpSubmitResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{27} + return file_user_center_proto_rawDescGZIP(), []int{23} } func (x *RankPvpSubmitResp) GetItems() []*RankPvpSubmitResp_Item { if x != nil { return x.Items } - return nil + return nil +} + +// UserRankReq 查询用户自己的排行 +type UserRankReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 系统用户ID + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // 用户名 + RankType vars.RankType `protobuf:"varint,3,opt,name=rankType,proto3,enum=pb.vars.RankType" json:"rankType,omitempty"` // 排行榜类型 + AllRankType bool `protobuf:"varint,4,opt,name=allRankType,proto3" json:"allRankType,omitempty"` // 直接查询所有排行类型 +} + +func (x *UserRankReq) Reset() { + *x = UserRankReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserRankReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserRankReq) ProtoMessage() {} + +func (x *UserRankReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[24] + 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 UserRankReq.ProtoReflect.Descriptor instead. +func (*UserRankReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{24} +} + +func (x *UserRankReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UserRankReq) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UserRankReq) GetRankType() vars.RankType { + if x != nil { + return x.RankType + } + return vars.RankType(0) +} + +func (x *UserRankReq) GetAllRankType() bool { + if x != nil { + return x.AllRankType + } + return false +} + +type UserRankResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*UserRankResp_Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *UserRankResp) Reset() { + *x = UserRankResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserRankResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserRankResp) ProtoMessage() {} + +func (x *UserRankResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[25] + 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 UserRankResp.ProtoReflect.Descriptor instead. +func (*UserRankResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{25} +} + +func (x *UserRankResp) GetItems() []*UserRankResp_Item { + if x != nil { + return x.Items + } + return nil +} + +/////////////////////////// zhg +type EliteReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // ID + Sort int32 `protobuf:"varint,2,opt,name=sort,proto3" json:"sort,omitempty"` // 序号 +} + +func (x *EliteReq) Reset() { + *x = EliteReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EliteReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EliteReq) ProtoMessage() {} + +func (x *EliteReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[26] + 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 EliteReq.ProtoReflect.Descriptor instead. +func (*EliteReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{26} +} + +func (x *EliteReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *EliteReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type GiveEliteReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // ID + EliteId int64 `protobuf:"varint,2,opt,name=eliteId,proto3" json:"eliteId,omitempty"` // 精英单位ID + Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` // 赠送时长(天) + Forever bool `protobuf:"varint,4,opt,name=forever,proto3" json:"forever,omitempty"` // 永久赠送 +} + +func (x *GiveEliteReq) Reset() { + *x = GiveEliteReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GiveEliteReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GiveEliteReq) ProtoMessage() {} + +func (x *GiveEliteReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[27] + 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 GiveEliteReq.ProtoReflect.Descriptor instead. +func (*GiveEliteReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{27} +} + +func (x *GiveEliteReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GiveEliteReq) GetEliteId() int64 { + if x != nil { + return x.EliteId + } + return 0 +} + +func (x *GiveEliteReq) GetDuration() int32 { + if x != nil { + return x.Duration + } + return 0 +} + +func (x *GiveEliteReq) GetForever() bool { + if x != nil { + return x.Forever + } + return false +} + +type BuyEliteResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // ID + EliteId int64 `protobuf:"varint,2,opt,name=eliteId,proto3" json:"eliteId,omitempty"` // 精英单位ID + Cost int64 `protobuf:"varint,3,opt,name=cost,proto3" json:"cost,omitempty"` // 花费 + Duration int32 `protobuf:"varint,4,opt,name=duration,proto3" json:"duration,omitempty"` // 持续时间 单位(day) +} + +func (x *BuyEliteResp) Reset() { + *x = BuyEliteResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BuyEliteResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuyEliteResp) ProtoMessage() {} + +func (x *BuyEliteResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_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 BuyEliteResp.ProtoReflect.Descriptor instead. +func (*BuyEliteResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{28} +} + +func (x *BuyEliteResp) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *BuyEliteResp) GetEliteId() int64 { + if x != nil { + return x.EliteId + } + return 0 +} + +func (x *BuyEliteResp) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *BuyEliteResp) GetDuration() int32 { + if x != nil { + return x.Duration + } + return 0 +} + +type GiveTitleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // ID + TitleId int64 `protobuf:"varint,2,opt,name=titleId,proto3" json:"titleId,omitempty"` // 精英单位ID + Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` // 赠送时长(天) + Forever bool `protobuf:"varint,4,opt,name=forever,proto3" json:"forever,omitempty"` // 永久赠送 +} + +func (x *GiveTitleReq) Reset() { + *x = GiveTitleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GiveTitleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GiveTitleReq) ProtoMessage() {} + +func (x *GiveTitleReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_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 GiveTitleReq.ProtoReflect.Descriptor instead. +func (*GiveTitleReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{29} +} + +func (x *GiveTitleReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *GiveTitleReq) GetTitleId() int64 { + if x != nil { + return x.TitleId + } + return 0 +} + +func (x *GiveTitleReq) GetDuration() int32 { + if x != nil { + return x.Duration + } + return 0 +} + +func (x *GiveTitleReq) GetForever() bool { + if x != nil { + return x.Forever + } + return false +} + +type BuyTitleResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // ID + TitleId int64 `protobuf:"varint,2,opt,name=titleId,proto3" json:"titleId,omitempty"` // 称号ID + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // 称号名 + Cost int64 `protobuf:"varint,4,opt,name=cost,proto3" json:"cost,omitempty"` // 花费 + Duration int32 `protobuf:"varint,5,opt,name=duration,proto3" json:"duration,omitempty"` // 持续时间 单位(day) +} + +func (x *BuyTitleResp) Reset() { + *x = BuyTitleResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BuyTitleResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuyTitleResp) ProtoMessage() {} + +func (x *BuyTitleResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[30] + 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 BuyTitleResp.ProtoReflect.Descriptor instead. +func (*BuyTitleResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{30} +} + +func (x *BuyTitleResp) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *BuyTitleResp) GetTitleId() int64 { + if x != nil { + return x.TitleId + } + return 0 +} + +func (x *BuyTitleResp) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *BuyTitleResp) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *BuyTitleResp) GetDuration() int32 { + if x != nil { + return x.Duration + } + return 0 +} + +type ChangeEliteResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + EliteId int64 `protobuf:"varint,2,opt,name=eliteId,proto3" json:"eliteId,omitempty"` +} + +func (x *ChangeEliteResp) Reset() { + *x = ChangeEliteResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeEliteResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeEliteResp) ProtoMessage() {} + +func (x *ChangeEliteResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[31] + 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 ChangeEliteResp.ProtoReflect.Descriptor instead. +func (*ChangeEliteResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{31} +} + +func (x *ChangeEliteResp) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChangeEliteResp) GetEliteId() int64 { + if x != nil { + return x.EliteId + } + return 0 +} + +type TitleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // ID + Sort int32 `protobuf:"varint,2,opt,name=sort,proto3" json:"sort,omitempty"` // 序号 +} + +func (x *TitleReq) Reset() { + *x = TitleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TitleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TitleReq) ProtoMessage() {} + +func (x *TitleReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[32] + 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 TitleReq.ProtoReflect.Descriptor instead. +func (*TitleReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{32} +} + +func (x *TitleReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *TitleReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type ChangeTitleResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + TitleId int64 `protobuf:"varint,2,opt,name=titleId,proto3" json:"titleId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *ChangeTitleResp) Reset() { + *x = ChangeTitleResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeTitleResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeTitleResp) ProtoMessage() {} + +func (x *ChangeTitleResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[33] + 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 ChangeTitleResp.ProtoReflect.Descriptor instead. +func (*ChangeTitleResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{33} +} + +func (x *ChangeTitleResp) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ChangeTitleResp) GetTitleId() int64 { + if x != nil { + return x.TitleId + } + return 0 +} + +func (x *ChangeTitleResp) GetName() string { + if x != nil { + return x.Name + } + return "" } -// UserRankReq 查询用户自己的排行 -type UserRankReq struct { +// TitleItem 称号 +type UserDetailsResp_TitleItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 系统用户ID - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // 用户名 - RankType int32 `protobuf:"varint,3,opt,name=rankType,proto3" json:"rankType,omitempty"` // 排行榜类型 - AllRankType bool `protobuf:"varint,4,opt,name=allRankType,proto3" json:"allRankType,omitempty"` // 直接查询所有排行类型 + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // 名 + Sort int32 `protobuf:"varint,3,opt,name=sort,proto3" json:"sort,omitempty"` // 排序号 + Remain int32 `protobuf:"varint,4,opt,name=remain,proto3" json:"remain,omitempty"` // 剩余时长(单位:小时) } -func (x *UserRankReq) Reset() { - *x = UserRankReq{} +func (x *UserDetailsResp_TitleItem) Reset() { + *x = UserDetailsResp_TitleItem{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[28] + mi := &file_user_center_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UserRankReq) String() string { +func (x *UserDetailsResp_TitleItem) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserRankReq) ProtoMessage() {} +func (*UserDetailsResp_TitleItem) ProtoMessage() {} -func (x *UserRankReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[28] +func (x *UserDetailsResp_TitleItem) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2122,64 +2402,67 @@ func (x *UserRankReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserRankReq.ProtoReflect.Descriptor instead. -func (*UserRankReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{28} +// Deprecated: Use UserDetailsResp_TitleItem.ProtoReflect.Descriptor instead. +func (*UserDetailsResp_TitleItem) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{4, 0} } -func (x *UserRankReq) GetUserId() int64 { +func (x *UserDetailsResp_TitleItem) GetId() int64 { if x != nil { - return x.UserId + return x.Id } return 0 } -func (x *UserRankReq) GetUsername() string { +func (x *UserDetailsResp_TitleItem) GetName() string { if x != nil { - return x.Username + return x.Name } return "" } -func (x *UserRankReq) GetRankType() int32 { +func (x *UserDetailsResp_TitleItem) GetSort() int32 { if x != nil { - return x.RankType + return x.Sort } return 0 } -func (x *UserRankReq) GetAllRankType() bool { +func (x *UserDetailsResp_TitleItem) GetRemain() int32 { if x != nil { - return x.AllRankType + return x.Remain } - return false + return 0 } -type UserRankResp struct { +// 精英单位 +type UserDetailsResp_EliteItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Items []*UserRankResp_Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID 1000(普通x) 1001(弓骑兵) 1002(牧师) + Sort int32 `protobuf:"varint,2,opt,name=sort,proto3" json:"sort,omitempty"` // 排序号 + Remain int32 `protobuf:"varint,3,opt,name=remain,proto3" json:"remain,omitempty"` // 剩余时长(单位:天)-1无限制 } -func (x *UserRankResp) Reset() { - *x = UserRankResp{} +func (x *UserDetailsResp_EliteItem) Reset() { + *x = UserDetailsResp_EliteItem{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[29] + mi := &file_user_center_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *UserRankResp) String() string { +func (x *UserDetailsResp_EliteItem) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserRankResp) ProtoMessage() {} +func (*UserDetailsResp_EliteItem) ProtoMessage() {} -func (x *UserRankResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[29] +func (x *UserDetailsResp_EliteItem) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2190,16 +2473,30 @@ func (x *UserRankResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserRankResp.ProtoReflect.Descriptor instead. -func (*UserRankResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{29} +// Deprecated: Use UserDetailsResp_EliteItem.ProtoReflect.Descriptor instead. +func (*UserDetailsResp_EliteItem) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{4, 1} } -func (x *UserRankResp) GetItems() []*UserRankResp_Item { +func (x *UserDetailsResp_EliteItem) GetId() int64 { if x != nil { - return x.Items + return x.Id } - return nil + return 0 +} + +func (x *UserDetailsResp_EliteItem) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *UserDetailsResp_EliteItem) GetRemain() int32 { + if x != nil { + return x.Remain + } + return 0 } type StatPvPReportReq_Item struct { @@ -2207,19 +2504,23 @@ type StatPvPReportReq_Item struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID - Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名 - Position int32 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` // 名次(特指在某一方的名次) - Damage int64 `protobuf:"varint,4,opt,name=damage,proto3" json:"damage,omitempty"` // 伤害量 - DeDamage int64 `protobuf:"varint,5,opt,name=deDamage,proto3" json:"deDamage,omitempty"` // 承受伤害 - KillUnit int64 `protobuf:"varint,6,opt,name=killUnit,proto3" json:"killUnit,omitempty"` // 击杀单位数量 - DeKillUnit int64 `protobuf:"varint,7,opt,name=deKillUnit,proto3" json:"deKillUnit,omitempty"` // 被杀单位数量 + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名 + Damage int64 `protobuf:"varint,3,opt,name=damage,proto3" json:"damage,omitempty"` // 伤害量 + DeDamage int64 `protobuf:"varint,4,opt,name=deDamage,proto3" json:"deDamage,omitempty"` // 承受伤害 + KillUnit int64 `protobuf:"varint,5,opt,name=killUnit,proto3" json:"killUnit,omitempty"` // 击杀单位数量 + DeKillUnit int64 `protobuf:"varint,6,opt,name=deKillUnit,proto3" json:"deKillUnit,omitempty"` // 被杀单位数量 + FirstBlood bool `protobuf:"varint,7,opt,name=firstBlood,proto3" json:"firstBlood,omitempty"` // 拿到一血 + DeFirstBlood bool `protobuf:"varint,8,opt,name=deFirstBlood,proto3" json:"deFirstBlood,omitempty"` // 被拿一血 + KillPlayer int64 `protobuf:"varint,9,opt,name=killPlayer,proto3" json:"killPlayer,omitempty"` // 击杀玩家数 + DeKillPlayer bool `protobuf:"varint,10,opt,name=deKillPlayer,proto3" json:"deKillPlayer,omitempty"` // 是否被击杀 + IsGeneral bool `protobuf:"varint,11,opt,name=isGeneral,proto3" json:"isGeneral,omitempty"` // 是否上一把名将? } func (x *StatPvPReportReq_Item) Reset() { *x = StatPvPReportReq_Item{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[30] + mi := &file_user_center_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2232,7 +2533,7 @@ func (x *StatPvPReportReq_Item) String() string { func (*StatPvPReportReq_Item) ProtoMessage() {} func (x *StatPvPReportReq_Item) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[30] + mi := &file_user_center_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2245,7 +2546,7 @@ func (x *StatPvPReportReq_Item) ProtoReflect() protoreflect.Message { // Deprecated: Use StatPvPReportReq_Item.ProtoReflect.Descriptor instead. func (*StatPvPReportReq_Item) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{18, 0} + return file_user_center_proto_rawDescGZIP(), []int{14, 0} } func (x *StatPvPReportReq_Item) GetUid() int64 { @@ -2262,13 +2563,6 @@ func (x *StatPvPReportReq_Item) GetUname() string { return "" } -func (x *StatPvPReportReq_Item) GetPosition() int32 { - if x != nil { - return x.Position - } - return 0 -} - func (x *StatPvPReportReq_Item) GetDamage() int64 { if x != nil { return x.Damage @@ -2297,26 +2591,56 @@ func (x *StatPvPReportReq_Item) GetDeKillUnit() int64 { return 0 } +func (x *StatPvPReportReq_Item) GetFirstBlood() bool { + if x != nil { + return x.FirstBlood + } + return false +} + +func (x *StatPvPReportReq_Item) GetDeFirstBlood() bool { + if x != nil { + return x.DeFirstBlood + } + return false +} + +func (x *StatPvPReportReq_Item) GetKillPlayer() int64 { + if x != nil { + return x.KillPlayer + } + return 0 +} + +func (x *StatPvPReportReq_Item) GetDeKillPlayer() bool { + if x != nil { + return x.DeKillPlayer + } + return false +} + +func (x *StatPvPReportReq_Item) GetIsGeneral() bool { + if x != nil { + return x.IsGeneral + } + return false +} + type StatPvPReportResp_Item struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID - Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名 - Position int32 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` // 名次(特指在某一方的名次) - ReturnsIntegral int64 `protobuf:"varint,4,opt,name=returnsIntegral,proto3" json:"returnsIntegral,omitempty"` // 回收的积分(获胜方才能回收,0不要展示) - RewardPoolIntegral int64 `protobuf:"varint,5,opt,name=rewardPoolIntegral,proto3" json:"rewardPoolIntegral,omitempty"` // 瓜分奖池分 - GeneralIntegral int64 `protobuf:"varint,6,opt,name=generalIntegral,proto3" json:"generalIntegral,omitempty"` // 名将 - NobilityIntegral int64 `protobuf:"varint,7,opt,name=nobilityIntegral,proto3" json:"nobilityIntegral,omitempty"` // 舰长|总督|贵族 加成分 - BattleIntegral int64 `protobuf:"varint,8,opt,name=battleIntegral,proto3" json:"battleIntegral,omitempty"` // 战斗结算奖励(普通) - TotalIntegral int64 `protobuf:"varint,10,opt,name=totalIntegral,proto3" json:"totalIntegral,omitempty"` // 总计加分 + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名 + Position int32 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` // 名次(特指在某一方的名次) + Score float32 `protobuf:"fixed32,4,opt,name=score,proto3" json:"score,omitempty"` // 评分(一位小数) } func (x *StatPvPReportResp_Item) Reset() { *x = StatPvPReportResp_Item{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[31] + mi := &file_user_center_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2329,7 +2653,7 @@ func (x *StatPvPReportResp_Item) String() string { func (*StatPvPReportResp_Item) ProtoMessage() {} func (x *StatPvPReportResp_Item) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[31] + mi := &file_user_center_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2342,7 +2666,7 @@ func (x *StatPvPReportResp_Item) ProtoReflect() protoreflect.Message { // Deprecated: Use StatPvPReportResp_Item.ProtoReflect.Descriptor instead. func (*StatPvPReportResp_Item) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{19, 0} + return file_user_center_proto_rawDescGZIP(), []int{15, 0} } func (x *StatPvPReportResp_Item) GetUid() int64 { @@ -2366,44 +2690,9 @@ func (x *StatPvPReportResp_Item) GetPosition() int32 { return 0 } -func (x *StatPvPReportResp_Item) GetReturnsIntegral() int64 { - if x != nil { - return x.ReturnsIntegral - } - return 0 -} - -func (x *StatPvPReportResp_Item) GetRewardPoolIntegral() int64 { +func (x *StatPvPReportResp_Item) GetScore() float32 { if x != nil { - return x.RewardPoolIntegral - } - return 0 -} - -func (x *StatPvPReportResp_Item) GetGeneralIntegral() int64 { - if x != nil { - return x.GeneralIntegral - } - return 0 -} - -func (x *StatPvPReportResp_Item) GetNobilityIntegral() int64 { - if x != nil { - return x.NobilityIntegral - } - return 0 -} - -func (x *StatPvPReportResp_Item) GetBattleIntegral() int64 { - if x != nil { - return x.BattleIntegral - } - return 0 -} - -func (x *StatPvPReportResp_Item) GetTotalIntegral() int64 { - if x != nil { - return x.TotalIntegral + return x.Score } return 0 } @@ -2422,7 +2711,7 @@ type RankPvpResp_Item struct { func (x *RankPvpResp_Item) Reset() { *x = RankPvpResp_Item{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[32] + mi := &file_user_center_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2435,7 +2724,7 @@ func (x *RankPvpResp_Item) String() string { func (*RankPvpResp_Item) ProtoMessage() {} func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[32] + mi := &file_user_center_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2448,7 +2737,7 @@ func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpResp_Item.ProtoReflect.Descriptor instead. func (*RankPvpResp_Item) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{25, 0} + return file_user_center_proto_rawDescGZIP(), []int{21, 0} } func (x *RankPvpResp_Item) GetUid() int64 { @@ -2487,7 +2776,7 @@ type RankPvpSubmitResp_Result struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` - Integral int64 `protobuf:"varint,4,opt,name=integral,proto3" json:"integral,omitempty"` // 获取到的积分数 + Coin int64 `protobuf:"varint,4,opt,name=coin,proto3" json:"coin,omitempty"` // 获取到的积分数 Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` // 获取到的称号 TitleDuration int64 `protobuf:"varint,6,opt,name=titleDuration,proto3" json:"titleDuration,omitempty"` // 称号持续时间(单位: 秒,负数为无限长) } @@ -2495,7 +2784,7 @@ type RankPvpSubmitResp_Result struct { func (x *RankPvpSubmitResp_Result) Reset() { *x = RankPvpSubmitResp_Result{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[33] + mi := &file_user_center_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2508,7 +2797,7 @@ func (x *RankPvpSubmitResp_Result) String() string { func (*RankPvpSubmitResp_Result) ProtoMessage() {} func (x *RankPvpSubmitResp_Result) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[33] + mi := &file_user_center_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2521,7 +2810,7 @@ func (x *RankPvpSubmitResp_Result) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpSubmitResp_Result.ProtoReflect.Descriptor instead. func (*RankPvpSubmitResp_Result) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{27, 0} + return file_user_center_proto_rawDescGZIP(), []int{23, 0} } func (x *RankPvpSubmitResp_Result) GetUserId() int64 { @@ -2545,9 +2834,9 @@ func (x *RankPvpSubmitResp_Result) GetAvatar() string { return "" } -func (x *RankPvpSubmitResp_Result) GetIntegral() int64 { +func (x *RankPvpSubmitResp_Result) GetCoin() int64 { if x != nil { - return x.Integral + return x.Coin } return 0 } @@ -2571,14 +2860,14 @@ type RankPvpSubmitResp_Item struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RankType int32 `protobuf:"varint,1,opt,name=rankType,proto3" json:"rankType,omitempty"` // 排行榜类型 - Results []*RankPvpSubmitResp_Result `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` // 上榜玩家? + RankType vars.RankType `protobuf:"varint,1,opt,name=rankType,proto3,enum=pb.vars.RankType" json:"rankType,omitempty"` // 排行榜类型 + Results []*RankPvpSubmitResp_Result `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` // 上榜玩家? } func (x *RankPvpSubmitResp_Item) Reset() { *x = RankPvpSubmitResp_Item{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[34] + mi := &file_user_center_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2591,7 +2880,7 @@ func (x *RankPvpSubmitResp_Item) String() string { func (*RankPvpSubmitResp_Item) ProtoMessage() {} func (x *RankPvpSubmitResp_Item) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[34] + mi := &file_user_center_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2604,14 +2893,14 @@ func (x *RankPvpSubmitResp_Item) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpSubmitResp_Item.ProtoReflect.Descriptor instead. func (*RankPvpSubmitResp_Item) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{27, 1} + return file_user_center_proto_rawDescGZIP(), []int{23, 1} } -func (x *RankPvpSubmitResp_Item) GetRankType() int32 { +func (x *RankPvpSubmitResp_Item) GetRankType() vars.RankType { if x != nil { return x.RankType } - return 0 + return vars.RankType(0) } func (x *RankPvpSubmitResp_Item) GetResults() []*RankPvpSubmitResp_Result { @@ -2626,15 +2915,15 @@ type UserRankResp_Item struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RankType int32 `protobuf:"varint,1,opt,name=rankType,proto3" json:"rankType,omitempty"` // 排行类型 - Pos int32 `protobuf:"varint,2,opt,name=pos,proto3" json:"pos,omitempty"` // 名次 - Score int64 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` // 分数 + RankType vars.RankType `protobuf:"varint,1,opt,name=rankType,proto3,enum=pb.vars.RankType" json:"rankType,omitempty"` // 排行类型 + Pos int32 `protobuf:"varint,2,opt,name=pos,proto3" json:"pos,omitempty"` // 名次 + Score int64 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` // 分数 } func (x *UserRankResp_Item) Reset() { *x = UserRankResp_Item{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[35] + mi := &file_user_center_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2647,7 +2936,7 @@ func (x *UserRankResp_Item) String() string { func (*UserRankResp_Item) ProtoMessage() {} func (x *UserRankResp_Item) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[35] + mi := &file_user_center_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2660,14 +2949,14 @@ func (x *UserRankResp_Item) ProtoReflect() protoreflect.Message { // Deprecated: Use UserRankResp_Item.ProtoReflect.Descriptor instead. func (*UserRankResp_Item) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{29, 0} + return file_user_center_proto_rawDescGZIP(), []int{25, 0} } -func (x *UserRankResp_Item) GetRankType() int32 { +func (x *UserRankResp_Item) GetRankType() vars.RankType { if x != nil { return x.RankType } - return 0 + return vars.RankType(0) } func (x *UserRankResp_Item) GetPos() int32 { @@ -2688,146 +2977,142 @@ var File_user_center_proto protoreflect.FileDescriptor var file_user_center_proto_rawDesc = []byte{ 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xd6, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x55, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x55, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x24, - 0x0a, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, - 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x41, 0x0a, 0x0f, 0x50, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x10, - 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, - 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x23, - 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x22, 0x24, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x73, + 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x0f, 0x76, 0x61, 0x72, 0x73, 0x2f, 0x76, 0x61, + 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x30, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6d, 0x73, 0x67, 0x22, 0x41, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, + 0x55, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x55, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0xfd, 0x03, + 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x95, 0x01, 0x0a, 0x11, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, + 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, + 0x6f, 0x69, 0x6e, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, + 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x2e, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0c, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x73, + 0x12, 0x35, 0x0a, 0x06, 0x65, 0x6c, 0x69, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x06, 0x65, 0x6c, 0x69, 0x74, 0x65, 0x73, 0x1a, 0x5b, 0x0a, 0x09, 0x54, 0x69, 0x74, 0x6c, 0x65, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x65, + 0x6d, 0x61, 0x69, 0x6e, 0x1a, 0x47, 0x0a, 0x09, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x23, 0x0a, + 0x09, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x22, 0x24, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x93, 0x01, + 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x0c, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x60, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x22, 0x46, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, 0x9b, 0x01, 0x0a, 0x0f, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x43, - 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, - 0x73, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x22, 0x71, 0x0a, 0x17, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x6c, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x22, 0xc4, 0x02, 0x0a, - 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, - 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, - 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x55, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, - 0x22, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x22, 0x81, 0x02, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, - 0x47, 0x69, 0x66, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x55, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, - 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6e, - 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, - 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x62, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x6e, 0x64, 0x47, 0x69, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x08, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x6c, 0x52, 0x65, 0x73, 0x70, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, - 0xba, 0x02, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x55, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x12, 0x1a, - 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, - 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, - 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, - 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, - 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x13, - 0x55, 0x73, 0x65, 0x72, 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x52, 0x08, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, 0x5e, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x50, - 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x22, 0x3c, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x50, - 0x76, 0x50, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xf5, 0x02, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x62, + 0x2e, 0x76, 0x61, 0x72, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x22, 0x6d, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x22, 0x8a, 0x02, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, + 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x55, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x22, + 0x73, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x69, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x6f, 0x69, 0x6e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x69, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, + 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x43, 0x72, 0x69, 0x74, + 0x69, 0x63, 0x61, 0x6c, 0x22, 0x81, 0x02, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x6e, + 0x64, 0x47, 0x69, 0x66, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x55, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, + 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x22, 0xba, 0x02, 0x0a, 0x12, 0x55, 0x73, 0x65, + 0x72, 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, + 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, + 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, + 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, + 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xff, 0x03, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x64, @@ -2839,211 +3124,251 @@ var file_user_center_proto_rawDesc = []byte{ 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x09, 0x6c, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x1a, 0xba, 0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, + 0x1a, 0xc4, 0x02, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, - 0x06, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x64, - 0x61, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x44, 0x61, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x65, 0x44, 0x61, 0x6d, 0x61, 0x67, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x1e, 0x0a, - 0x0a, 0x64, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0a, 0x64, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x22, 0xd0, 0x03, - 0x0a, 0x11, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x44, + 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x65, 0x44, + 0x61, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, + 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, + 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, + 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x65, 0x46, 0x69, 0x72, 0x73, 0x74, + 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6b, 0x69, 0x6c, 0x6c, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x65, 0x4b, + 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x22, 0x9d, 0x02, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x74, + 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x77, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x6c, - 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x09, 0x6c, 0x6f, 0x73, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0xc8, 0x02, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x49, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x74, - 0x75, 0x72, 0x6e, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x12, - 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, - 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x50, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x28, 0x0a, 0x0f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x49, 0x6e, - 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x10, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x10, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, - 0x61, 0x6c, 0x12, 0x26, 0x0a, 0x0e, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x74, 0x65, - 0x67, 0x72, 0x61, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x62, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, - 0x22, 0x78, 0x0a, 0x0c, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x49, 0x74, 0x65, 0x6d, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x61, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x61, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, - 0x67, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, - 0x67, 0x72, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x55, 0x0a, 0x0f, 0x44, 0x72, - 0x61, 0x77, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, + 0x49, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x60, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x86, 0x01, 0x0a, 0x10, 0x44, 0x72, 0x61, 0x77, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6d, 0x73, 0x67, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x56, 0x0a, 0x12, 0x49, 0x6e, - 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x57, 0x65, 0x6c, 0x66, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, - 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x6c, 0x66, - 0x61, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x77, 0x65, 0x6c, 0x66, 0x61, - 0x72, 0x65, 0x22, 0x34, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x71, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x22, 0xab, 0x01, 0x0a, 0x0b, 0x52, 0x61, 0x6e, - 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x05, - 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, - 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, - 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x5c, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, - 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, - 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x50, 0x0a, 0x10, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, - 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x61, - 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x61, - 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x52, 0x61, 0x6e, - 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x6c, 0x6c, - 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0xd0, 0x02, 0x0a, 0x11, 0x52, 0x61, 0x6e, - 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, - 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x1a, 0xac, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x74, 0x69, 0x74, - 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0d, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x5a, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, - 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x7f, 0x0a, 0x0b, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, + 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x70, 0x0a, 0x0c, 0x47, 0x69, 0x66, 0x74, 0x50, + 0x61, 0x63, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, + 0x6f, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x55, 0x0a, 0x0f, 0x44, 0x72, 0x61, + 0x77, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x60, 0x0a, 0x10, 0x44, 0x72, 0x61, 0x77, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x04, + 0x69, 0x74, 0x65, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, + 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x69, 0x74, + 0x65, 0x6d, 0x22, 0x56, 0x0a, 0x12, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x57, 0x65, + 0x6c, 0x66, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x6c, 0x66, 0x61, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x77, 0x65, 0x6c, 0x66, 0x61, 0x72, 0x65, 0x22, 0x47, 0x0a, 0x0a, 0x52, 0x61, + 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x71, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x61, 0x72, 0x73, + 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, + 0x6f, 0x70, 0x4e, 0x22, 0xbe, 0x01, 0x0a, 0x0b, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x61, 0x72, 0x73, 0x2e, 0x52, 0x61, 0x6e, 0x6b, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, + 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x5c, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, + 0x61, 0x74, 0x61, 0x72, 0x22, 0x63, 0x0a, 0x10, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x2d, 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x6b, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, + 0x76, 0x61, 0x72, 0x73, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x72, + 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x52, 0x61, + 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x6c, + 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0xdb, 0x02, 0x0a, 0x11, 0x52, 0x61, + 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x30, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x1a, 0xa4, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x69, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x6d, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, + 0x12, 0x2d, 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x61, 0x72, 0x73, 0x2e, 0x52, 0x61, 0x6e, + 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x36, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x92, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x72, + 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, + 0x70, 0x62, 0x2e, 0x76, 0x61, 0x72, 0x73, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0b, 0x61, 0x6c, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x87, 0x01, 0x0a, + 0x0b, 0x61, 0x6c, 0x6c, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x4a, 0x0a, 0x04, 0x49, 0x74, - 0x65, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x6f, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x2a, 0x2f, 0x0a, 0x0c, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, - 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x47, 0x69, 0x66, 0x74, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, - 0x4f, 0x74, 0x68, 0x65, 0x72, 0x10, 0x0a, 0x2a, 0x28, 0x0a, 0x08, 0x47, 0x69, 0x66, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x72, 0x10, 0x00, - 0x12, 0x0f, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x10, - 0x01, 0x2a, 0xc2, 0x01, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, - 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, - 0x61, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x65, 0x44, 0x61, 0x6d, - 0x61, 0x67, 0x65, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, - 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x10, - 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x10, 0x05, 0x12, - 0x0e, 0x0a, 0x0a, 0x44, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x10, 0x06, 0x12, - 0x0e, 0x0a, 0x0a, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x07, 0x12, - 0x10, 0x0a, 0x0c, 0x44, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, - 0x08, 0x12, 0x07, 0x0a, 0x03, 0x57, 0x69, 0x6e, 0x10, 0x09, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x6f, - 0x73, 0x74, 0x10, 0x0a, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, - 0x6f, 0x64, 0x10, 0x0b, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x65, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, - 0x6c, 0x6f, 0x6f, 0x64, 0x10, 0x0c, 0x32, 0xb8, 0x07, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x43, - 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x14, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, - 0x65, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, - 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x0f, 0x67, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x42, 0x79, 0x50, 0x55, 0x69, 0x64, 0x12, 0x13, 0x2e, 0x70, 0x62, - 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x3f, 0x0a, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, - 0x61, 0x6c, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, - 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x36, 0x0a, 0x0f, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, - 0x67, 0x72, 0x61, 0x6c, 0x12, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0b, 0x75, 0x73, 0x65, - 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x12, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x14, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, - 0x67, 0x72, 0x61, 0x6c, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, - 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x65, - 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x39, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x69, 0x66, 0x74, 0x12, - 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x47, 0x69, 0x66, - 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x6e, 0x64, 0x47, 0x69, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x0f, 0x75, 0x73, - 0x65, 0x72, 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x2e, - 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, - 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, - 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x50, 0x76, 0x70, 0x4b, 0x69, 0x6c, 0x6c, 0x12, 0x12, 0x2e, - 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, - 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x11, - 0x73, 0x74, 0x61, 0x74, 0x50, 0x76, 0x70, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, - 0x64, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x46, 0x69, - 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x50, 0x76, - 0x70, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, - 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x0c, 0x64, 0x72, 0x61, 0x77, 0x47, 0x69, 0x66, 0x74, - 0x50, 0x61, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x47, 0x69, - 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x44, - 0x72, 0x61, 0x77, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x34, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x57, 0x65, 0x6c, 0x66, 0x61, - 0x72, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, - 0x57, 0x65, 0x6c, 0x66, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, - 0x12, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x71, - 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x3c, 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, - 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, - 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x30, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x12, 0x0f, - 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x1a, - 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x5d, 0x0a, 0x04, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x2d, 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x61, 0x72, 0x73, 0x2e, 0x52, + 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x70, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x36, 0x0a, 0x08, 0x45, 0x6c, 0x69, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, + 0x74, 0x22, 0x76, 0x0a, 0x0c, 0x47, 0x69, 0x76, 0x65, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6c, 0x69, + 0x74, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6c, 0x69, 0x74, + 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x18, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x65, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x66, 0x6f, 0x72, 0x65, 0x76, 0x65, 0x72, 0x22, 0x70, 0x0a, 0x0c, 0x42, 0x75, 0x79, + 0x45, 0x6c, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6c, 0x69, 0x74, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x65, 0x6c, 0x69, 0x74, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x76, 0x0a, 0x0c, 0x47, + 0x69, 0x76, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x6f, 0x72, + 0x65, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x66, 0x6f, 0x72, 0x65, + 0x76, 0x65, 0x72, 0x22, 0x84, 0x01, 0x0a, 0x0c, 0x42, 0x75, 0x79, 0x54, 0x69, 0x74, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x43, 0x0a, 0x0f, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6c, 0x69, 0x74, 0x65, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6c, 0x69, 0x74, 0x65, 0x49, 0x64, 0x22, + 0x36, 0x0a, 0x08, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x57, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x2a, 0x28, 0x0a, 0x08, 0x47, 0x69, 0x66, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x72, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x73, 0x75, 0x62, + 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x10, 0x01, 0x32, 0xaf, 0x08, 0x0a, 0x0a, 0x75, + 0x73, 0x65, 0x72, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x14, 0x72, 0x65, 0x74, + 0x72, 0x69, 0x65, 0x76, 0x65, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x0e, + 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x0d, + 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, + 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x36, 0x0a, 0x0f, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x42, + 0x79, 0x50, 0x55, 0x69, 0x64, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0b, 0x75, 0x73, + 0x65, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x12, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, + 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x11, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x09, + 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x31, 0x0a, 0x0b, 0x67, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x10, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, + 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x69, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x2e, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x47, + 0x69, 0x66, 0x74, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x6e, + 0x64, 0x47, 0x69, 0x66, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x42, 0x75, 0x79, 0x4e, 0x6f, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x09, + 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x74, 0x61, + 0x74, 0x50, 0x76, 0x70, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x0c, 0x64, 0x72, 0x61, 0x77, 0x47, + 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x72, 0x61, + 0x77, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x47, 0x69, 0x66, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x12, 0x0e, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, + 0x0a, 0x0d, 0x72, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, + 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, + 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, + 0x75, 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x12, 0x0f, 0x2e, 0x70, 0x62, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, + 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, + 0x0a, 0x09, 0x67, 0x69, 0x76, 0x65, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x69, 0x76, 0x65, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, + 0x70, 0x62, 0x2e, 0x42, 0x75, 0x79, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x2a, 0x0a, 0x08, 0x62, 0x75, 0x79, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x62, + 0x2e, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x42, + 0x75, 0x79, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x09, 0x67, + 0x69, 0x76, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x69, + 0x76, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e, + 0x42, 0x75, 0x79, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x08, + 0x62, 0x75, 0x79, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x69, + 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x79, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6c, 0x69, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x45, 0x6c, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, 0x63, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3058,100 +3383,121 @@ func file_user_center_proto_rawDescGZIP() []byte { return file_user_center_proto_rawDescData } -var file_user_center_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 36) +var file_user_center_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 42) var file_user_center_proto_goTypes = []interface{}{ - (IntegralType)(0), // 0: pb.IntegralType - (GiftType)(0), // 1: pb.GiftType - (RankType)(0), // 2: pb.RankType - (*User)(nil), // 3: pb.User - (*Empty)(nil), // 4: pb.Empty - (*PlatformUserReq)(nil), // 5: pb.PlatformUserReq - (*PlatformUserResp)(nil), // 6: pb.PlatformUserResp - (*UserIdReq)(nil), // 7: pb.UserIdReq - (*UserIdResp)(nil), // 8: pb.UserIdResp - (*ChangeIntegralReq)(nil), // 9: pb.ChangeIntegralReq - (*ChangeIntegralResp)(nil), // 10: pb.ChangeIntegralResp - (*UserIntegralResp)(nil), // 11: pb.UserIntegralResp - (*UserCheckInResp)(nil), // 12: pb.UserCheckInResp - (*TransferUserIntegralReq)(nil), // 13: pb.TransferUserIntegralReq - (*TransferUserIntegralResp)(nil), // 14: pb.TransferUserIntegralResp - (*UserSendGiftReq)(nil), // 15: pb.UserSendGiftReq - (*UserSendGiftResp)(nil), // 16: pb.UserSendGiftResp - (*UserBuyNobilityReq)(nil), // 17: pb.UserBuyNobilityReq - (*UserBuyNobilityResp)(nil), // 18: pb.UserBuyNobilityResp - (*StatPvPKillReq)(nil), // 19: pb.StatPvPKillReq - (*StatPvPFirstBloodReq)(nil), // 20: pb.StatPvPFirstBloodReq - (*StatPvPReportReq)(nil), // 21: pb.StatPvPReportReq - (*StatPvPReportResp)(nil), // 22: pb.StatPvPReportResp - (*GiftPackItem)(nil), // 23: pb.GiftPackItem - (*DrawGiftPackReq)(nil), // 24: pb.DrawGiftPackReq - (*DrawGiftPackResp)(nil), // 25: pb.DrawGiftPackResp - (*IncreaseWelfareReq)(nil), // 26: pb.IncreaseWelfareReq - (*RankPvpReq)(nil), // 27: pb.RankPvpReq - (*RankPvpResp)(nil), // 28: pb.RankPvpResp - (*RankPvpSubmitReq)(nil), // 29: pb.RankPvpSubmitReq - (*RankPvpSubmitResp)(nil), // 30: pb.RankPvpSubmitResp - (*UserRankReq)(nil), // 31: pb.UserRankReq - (*UserRankResp)(nil), // 32: pb.UserRankResp - (*StatPvPReportReq_Item)(nil), // 33: pb.StatPvPReportReq.Item - (*StatPvPReportResp_Item)(nil), // 34: pb.StatPvPReportResp.Item - (*RankPvpResp_Item)(nil), // 35: pb.RankPvpResp.Item - (*RankPvpSubmitResp_Result)(nil), // 36: pb.RankPvpSubmitResp.Result - (*RankPvpSubmitResp_Item)(nil), // 37: pb.RankPvpSubmitResp.Item - (*UserRankResp_Item)(nil), // 38: pb.UserRankResp.Item + (GiftType)(0), // 0: pb.GiftType + (*Empty)(nil), // 1: pb.Empty + (*Response)(nil), // 2: pb.Response + (*PlatformUserReq)(nil), // 3: pb.PlatformUserReq + (*PlatformUserResp)(nil), // 4: pb.PlatformUserResp + (*UserDetailsResp)(nil), // 5: pb.UserDetailsResp + (*UserIdReq)(nil), // 6: pb.UserIdReq + (*UserIdResp)(nil), // 7: pb.UserIdResp + (*GetUserCoinResp)(nil), // 8: pb.GetUserCoinResp + (*ChangeCoinReq)(nil), // 9: pb.ChangeCoinReq + (*TransferUserCoinReq)(nil), // 10: pb.TransferUserCoinReq + (*TransferUserCoinResp)(nil), // 11: pb.TransferUserCoinResp + (*UserCheckInResp)(nil), // 12: pb.UserCheckInResp + (*UserSendGiftReq)(nil), // 13: pb.UserSendGiftReq + (*UserBuyNobilityReq)(nil), // 14: pb.UserBuyNobilityReq + (*StatPvPReportReq)(nil), // 15: pb.StatPvPReportReq + (*StatPvPReportResp)(nil), // 16: pb.StatPvPReportResp + (*GiftPackItem)(nil), // 17: pb.GiftPackItem + (*DrawGiftPackReq)(nil), // 18: pb.DrawGiftPackReq + (*DrawGiftPackResp)(nil), // 19: pb.DrawGiftPackResp + (*IncreaseWelfareReq)(nil), // 20: pb.IncreaseWelfareReq + (*RankPvpReq)(nil), // 21: pb.RankPvpReq + (*RankPvpResp)(nil), // 22: pb.RankPvpResp + (*RankPvpSubmitReq)(nil), // 23: pb.RankPvpSubmitReq + (*RankPvpSubmitResp)(nil), // 24: pb.RankPvpSubmitResp + (*UserRankReq)(nil), // 25: pb.UserRankReq + (*UserRankResp)(nil), // 26: pb.UserRankResp + (*EliteReq)(nil), // 27: pb.EliteReq + (*GiveEliteReq)(nil), // 28: pb.GiveEliteReq + (*BuyEliteResp)(nil), // 29: pb.BuyEliteResp + (*GiveTitleReq)(nil), // 30: pb.GiveTitleReq + (*BuyTitleResp)(nil), // 31: pb.BuyTitleResp + (*ChangeEliteResp)(nil), // 32: pb.ChangeEliteResp + (*TitleReq)(nil), // 33: pb.TitleReq + (*ChangeTitleResp)(nil), // 34: pb.ChangeTitleResp + (*UserDetailsResp_TitleItem)(nil), // 35: pb.UserDetailsResp.TitleItem + (*UserDetailsResp_EliteItem)(nil), // 36: pb.UserDetailsResp.EliteItem + (*StatPvPReportReq_Item)(nil), // 37: pb.StatPvPReportReq.Item + (*StatPvPReportResp_Item)(nil), // 38: pb.StatPvPReportResp.Item + (*RankPvpResp_Item)(nil), // 39: pb.RankPvpResp.Item + (*RankPvpSubmitResp_Result)(nil), // 40: pb.RankPvpSubmitResp.Result + (*RankPvpSubmitResp_Item)(nil), // 41: pb.RankPvpSubmitResp.Item + (*UserRankResp_Item)(nil), // 42: pb.UserRankResp.Item + (vars.UserCoinChangedReason)(0), // 43: pb.vars.UserCoinChangedReason + (vars.RankType)(0), // 44: pb.vars.RankType } var file_user_center_proto_depIdxs = []int32{ - 3, // 0: pb.PlatformUserResp.user:type_name -> pb.User - 0, // 1: pb.ChangeIntegralReq.integralType:type_name -> pb.IntegralType - 10, // 2: pb.UserSendGiftResp.integral:type_name -> pb.ChangeIntegralResp - 10, // 3: pb.UserBuyNobilityResp.integral:type_name -> pb.ChangeIntegralResp - 33, // 4: pb.StatPvPReportReq.winItems:type_name -> pb.StatPvPReportReq.Item - 33, // 5: pb.StatPvPReportReq.lostItems:type_name -> pb.StatPvPReportReq.Item - 34, // 6: pb.StatPvPReportResp.winItems:type_name -> pb.StatPvPReportResp.Item - 34, // 7: pb.StatPvPReportResp.lostItems:type_name -> pb.StatPvPReportResp.Item - 23, // 8: pb.DrawGiftPackResp.item:type_name -> pb.GiftPackItem - 35, // 9: pb.RankPvpResp.items:type_name -> pb.RankPvpResp.Item - 37, // 10: pb.RankPvpSubmitResp.items:type_name -> pb.RankPvpSubmitResp.Item - 38, // 11: pb.UserRankResp.items:type_name -> pb.UserRankResp.Item - 36, // 12: pb.RankPvpSubmitResp.Item.results:type_name -> pb.RankPvpSubmitResp.Result - 5, // 13: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq - 5, // 14: pb.userCenter.getUserIdByPUid:input_type -> pb.PlatformUserReq - 9, // 15: pb.userCenter.changeIntegral:input_type -> pb.ChangeIntegralReq - 7, // 16: pb.userCenter.getUserIntegral:input_type -> pb.UserIdReq - 7, // 17: pb.userCenter.userCheckIn:input_type -> pb.UserIdReq - 13, // 18: pb.userCenter.transferUserIntegral:input_type -> pb.TransferUserIntegralReq - 15, // 19: pb.userCenter.userSendGift:input_type -> pb.UserSendGiftReq - 17, // 20: pb.userCenter.userBuyNobility:input_type -> pb.UserBuyNobilityReq - 19, // 21: pb.userCenter.statPvpKill:input_type -> pb.StatPvPKillReq - 20, // 22: pb.userCenter.statPvpFirstBlood:input_type -> pb.StatPvPFirstBloodReq - 21, // 23: pb.userCenter.statPvpReport:input_type -> pb.StatPvPReportReq - 24, // 24: pb.userCenter.drawGiftPack:input_type -> pb.DrawGiftPackReq - 26, // 25: pb.userCenter.increaseWelfare:input_type -> pb.IncreaseWelfareReq - 27, // 26: pb.userCenter.rankPvp:input_type -> pb.RankPvpReq - 29, // 27: pb.userCenter.rankPvpSubmit:input_type -> pb.RankPvpSubmitReq - 31, // 28: pb.userCenter.userRankPvp:input_type -> pb.UserRankReq - 6, // 29: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp - 8, // 30: pb.userCenter.getUserIdByPUid:output_type -> pb.UserIdResp - 10, // 31: pb.userCenter.changeIntegral:output_type -> pb.ChangeIntegralResp - 11, // 32: pb.userCenter.getUserIntegral:output_type -> pb.UserIntegralResp - 12, // 33: pb.userCenter.userCheckIn:output_type -> pb.UserCheckInResp - 14, // 34: pb.userCenter.transferUserIntegral:output_type -> pb.TransferUserIntegralResp - 16, // 35: pb.userCenter.userSendGift:output_type -> pb.UserSendGiftResp - 18, // 36: pb.userCenter.userBuyNobility:output_type -> pb.UserBuyNobilityResp - 4, // 37: pb.userCenter.statPvpKill:output_type -> pb.Empty - 4, // 38: pb.userCenter.statPvpFirstBlood:output_type -> pb.Empty - 22, // 39: pb.userCenter.statPvpReport:output_type -> pb.StatPvPReportResp - 25, // 40: pb.userCenter.drawGiftPack:output_type -> pb.DrawGiftPackResp - 4, // 41: pb.userCenter.increaseWelfare:output_type -> pb.Empty - 28, // 42: pb.userCenter.rankPvp:output_type -> pb.RankPvpResp - 30, // 43: pb.userCenter.rankPvpSubmit:output_type -> pb.RankPvpSubmitResp - 32, // 44: pb.userCenter.userRankPvp:output_type -> pb.UserRankResp - 29, // [29:45] is the sub-list for method output_type - 13, // [13:29] 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 + 35, // 0: pb.UserDetailsResp.currentTitle:type_name -> pb.UserDetailsResp.TitleItem + 36, // 1: pb.UserDetailsResp.currentElite:type_name -> pb.UserDetailsResp.EliteItem + 35, // 2: pb.UserDetailsResp.titles:type_name -> pb.UserDetailsResp.TitleItem + 36, // 3: pb.UserDetailsResp.elites:type_name -> pb.UserDetailsResp.EliteItem + 43, // 4: pb.ChangeCoinReq.reason:type_name -> pb.vars.UserCoinChangedReason + 37, // 5: pb.StatPvPReportReq.winItems:type_name -> pb.StatPvPReportReq.Item + 37, // 6: pb.StatPvPReportReq.lostItems:type_name -> pb.StatPvPReportReq.Item + 38, // 7: pb.StatPvPReportResp.winItems:type_name -> pb.StatPvPReportResp.Item + 38, // 8: pb.StatPvPReportResp.lostItems:type_name -> pb.StatPvPReportResp.Item + 17, // 9: pb.DrawGiftPackResp.item:type_name -> pb.GiftPackItem + 44, // 10: pb.RankPvpReq.type:type_name -> pb.vars.RankType + 44, // 11: pb.RankPvpResp.type:type_name -> pb.vars.RankType + 39, // 12: pb.RankPvpResp.items:type_name -> pb.RankPvpResp.Item + 44, // 13: pb.RankPvpSubmitReq.rankType:type_name -> pb.vars.RankType + 41, // 14: pb.RankPvpSubmitResp.items:type_name -> pb.RankPvpSubmitResp.Item + 44, // 15: pb.UserRankReq.rankType:type_name -> pb.vars.RankType + 42, // 16: pb.UserRankResp.items:type_name -> pb.UserRankResp.Item + 44, // 17: pb.RankPvpSubmitResp.Item.rankType:type_name -> pb.vars.RankType + 40, // 18: pb.RankPvpSubmitResp.Item.results:type_name -> pb.RankPvpSubmitResp.Result + 44, // 19: pb.UserRankResp.Item.rankType:type_name -> pb.vars.RankType + 3, // 20: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq + 6, // 21: pb.userCenter.getUserDetails:input_type -> pb.UserIdReq + 3, // 22: pb.userCenter.getUserIdByPUid:input_type -> pb.PlatformUserReq + 6, // 23: pb.userCenter.userCheckIn:input_type -> pb.UserIdReq + 9, // 24: pb.userCenter.changeCoin:input_type -> pb.ChangeCoinReq + 6, // 25: pb.userCenter.getUserCoin:input_type -> pb.UserIdReq + 10, // 26: pb.userCenter.transferUserCoin:input_type -> pb.TransferUserCoinReq + 13, // 27: pb.userCenter.userSendGift:input_type -> pb.UserSendGiftReq + 14, // 28: pb.userCenter.userBuyNobility:input_type -> pb.UserBuyNobilityReq + 15, // 29: pb.userCenter.statPvpReport:input_type -> pb.StatPvPReportReq + 18, // 30: pb.userCenter.drawGiftPack:input_type -> pb.DrawGiftPackReq + 21, // 31: pb.userCenter.rankPvp:input_type -> pb.RankPvpReq + 23, // 32: pb.userCenter.rankPvpSubmit:input_type -> pb.RankPvpSubmitReq + 25, // 33: pb.userCenter.userRankPvp:input_type -> pb.UserRankReq + 28, // 34: pb.userCenter.giveElite:input_type -> pb.GiveEliteReq + 27, // 35: pb.userCenter.buyElite:input_type -> pb.EliteReq + 30, // 36: pb.userCenter.giveTitle:input_type -> pb.GiveTitleReq + 33, // 37: pb.userCenter.buyTitle:input_type -> pb.TitleReq + 27, // 38: pb.userCenter.changeElite:input_type -> pb.EliteReq + 33, // 39: pb.userCenter.changeTitle:input_type -> pb.TitleReq + 4, // 40: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp + 5, // 41: pb.userCenter.getUserDetails:output_type -> pb.UserDetailsResp + 7, // 42: pb.userCenter.getUserIdByPUid:output_type -> pb.UserIdResp + 12, // 43: pb.userCenter.userCheckIn:output_type -> pb.UserCheckInResp + 1, // 44: pb.userCenter.changeCoin:output_type -> pb.Empty + 8, // 45: pb.userCenter.getUserCoin:output_type -> pb.GetUserCoinResp + 11, // 46: pb.userCenter.transferUserCoin:output_type -> pb.TransferUserCoinResp + 1, // 47: pb.userCenter.userSendGift:output_type -> pb.Empty + 1, // 48: pb.userCenter.userBuyNobility:output_type -> pb.Empty + 16, // 49: pb.userCenter.statPvpReport:output_type -> pb.StatPvPReportResp + 19, // 50: pb.userCenter.drawGiftPack:output_type -> pb.DrawGiftPackResp + 22, // 51: pb.userCenter.rankPvp:output_type -> pb.RankPvpResp + 24, // 52: pb.userCenter.rankPvpSubmit:output_type -> pb.RankPvpSubmitResp + 26, // 53: pb.userCenter.userRankPvp:output_type -> pb.UserRankResp + 29, // 54: pb.userCenter.giveElite:output_type -> pb.BuyEliteResp + 29, // 55: pb.userCenter.buyElite:output_type -> pb.BuyEliteResp + 31, // 56: pb.userCenter.giveTitle:output_type -> pb.BuyTitleResp + 31, // 57: pb.userCenter.buyTitle:output_type -> pb.BuyTitleResp + 32, // 58: pb.userCenter.changeElite:output_type -> pb.ChangeEliteResp + 34, // 59: pb.userCenter.changeTitle:output_type -> pb.ChangeTitleResp + 40, // [40:60] is the sub-list for method output_type + 20, // [20:40] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_user_center_proto_init() } @@ -3161,7 +3507,7 @@ func file_user_center_proto_init() { } if !protoimpl.UnsafeEnabled { file_user_center_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -3173,7 +3519,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + switch v := v.(*Response); i { case 0: return &v.state case 1: @@ -3209,7 +3555,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserIdReq); i { + switch v := v.(*UserDetailsResp); i { case 0: return &v.state case 1: @@ -3221,7 +3567,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserIdResp); i { + switch v := v.(*UserIdReq); i { case 0: return &v.state case 1: @@ -3233,7 +3579,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeIntegralReq); i { + switch v := v.(*UserIdResp); i { case 0: return &v.state case 1: @@ -3245,7 +3591,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeIntegralResp); i { + switch v := v.(*GetUserCoinResp); i { case 0: return &v.state case 1: @@ -3257,7 +3603,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserIntegralResp); i { + switch v := v.(*ChangeCoinReq); i { case 0: return &v.state case 1: @@ -3269,7 +3615,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCheckInResp); i { + switch v := v.(*TransferUserCoinReq); i { case 0: return &v.state case 1: @@ -3281,7 +3627,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferUserIntegralReq); i { + switch v := v.(*TransferUserCoinResp); i { case 0: return &v.state case 1: @@ -3293,7 +3639,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransferUserIntegralResp); i { + switch v := v.(*UserCheckInResp); i { case 0: return &v.state case 1: @@ -3317,7 +3663,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserSendGiftResp); i { + switch v := v.(*UserBuyNobilityReq); i { case 0: return &v.state case 1: @@ -3329,7 +3675,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserBuyNobilityReq); i { + switch v := v.(*StatPvPReportReq); i { case 0: return &v.state case 1: @@ -3341,7 +3687,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserBuyNobilityResp); i { + switch v := v.(*StatPvPReportResp); i { case 0: return &v.state case 1: @@ -3353,7 +3699,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPKillReq); i { + switch v := v.(*GiftPackItem); i { case 0: return &v.state case 1: @@ -3365,7 +3711,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPFirstBloodReq); i { + switch v := v.(*DrawGiftPackReq); i { case 0: return &v.state case 1: @@ -3377,7 +3723,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPReportReq); i { + switch v := v.(*DrawGiftPackResp); i { case 0: return &v.state case 1: @@ -3389,7 +3735,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPReportResp); i { + switch v := v.(*IncreaseWelfareReq); i { case 0: return &v.state case 1: @@ -3401,7 +3747,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GiftPackItem); i { + switch v := v.(*RankPvpReq); i { case 0: return &v.state case 1: @@ -3413,7 +3759,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DrawGiftPackReq); i { + switch v := v.(*RankPvpResp); i { case 0: return &v.state case 1: @@ -3425,7 +3771,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DrawGiftPackResp); i { + switch v := v.(*RankPvpSubmitReq); i { case 0: return &v.state case 1: @@ -3437,7 +3783,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IncreaseWelfareReq); i { + switch v := v.(*RankPvpSubmitResp); i { case 0: return &v.state case 1: @@ -3449,7 +3795,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpReq); i { + switch v := v.(*UserRankReq); i { case 0: return &v.state case 1: @@ -3461,7 +3807,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpResp); i { + switch v := v.(*UserRankResp); i { case 0: return &v.state case 1: @@ -3473,7 +3819,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpSubmitReq); i { + switch v := v.(*EliteReq); i { case 0: return &v.state case 1: @@ -3485,7 +3831,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpSubmitResp); i { + switch v := v.(*GiveEliteReq); i { case 0: return &v.state case 1: @@ -3497,7 +3843,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserRankReq); i { + switch v := v.(*BuyEliteResp); i { case 0: return &v.state case 1: @@ -3509,7 +3855,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserRankResp); i { + switch v := v.(*GiveTitleReq); i { case 0: return &v.state case 1: @@ -3521,7 +3867,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPReportReq_Item); i { + switch v := v.(*BuyTitleResp); i { case 0: return &v.state case 1: @@ -3533,7 +3879,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPReportResp_Item); i { + switch v := v.(*ChangeEliteResp); i { case 0: return &v.state case 1: @@ -3545,7 +3891,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpResp_Item); i { + switch v := v.(*TitleReq); i { case 0: return &v.state case 1: @@ -3557,7 +3903,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpSubmitResp_Result); i { + switch v := v.(*ChangeTitleResp); i { case 0: return &v.state case 1: @@ -3569,7 +3915,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpSubmitResp_Item); i { + switch v := v.(*UserDetailsResp_TitleItem); i { case 0: return &v.state case 1: @@ -3581,6 +3927,78 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserDetailsResp_EliteItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPReportReq_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPReportResp_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpResp_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpSubmitResp_Result); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpSubmitResp_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserRankResp_Item); i { case 0: return &v.state @@ -3598,8 +4016,8 @@ func file_user_center_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_center_proto_rawDesc, - NumEnums: 3, - NumMessages: 36, + NumEnums: 1, + NumMessages: 42, NumExtensions: 0, NumServices: 1, }, diff --git a/app/user_center/rpc/pb/user_center.proto b/app/user_center/rpc/pb/user_center.proto index 6e80cb2..584c9f8 100644 --- a/app/user_center/rpc/pb/user_center.proto +++ b/app/user_center/rpc/pb/user_center.proto @@ -2,31 +2,57 @@ syntax = "proto3"; package pb; +import "vars/vars.proto"; + option go_package = "./pb"; // model -message User { +message Empty {} + +message Response { + int32 code = 1; // code + string msg = 2; // msg +} + +// req +message PlatformUserReq { + string platform = 1; + string pUid = 2; +} + +message PlatformUserResp { int64 id = 1; - string username = 2; // platform string platform = 3; string pUid = 4; string pUname = 5; string pAvatar = 6; - int32 nobilityLevel = 7; // 贵族等级 - int64 integral = 8; // 用户积分(充值) } -message Empty {} +// 用户详细信息返回 +message UserDetailsResp { + // TitleItem 称号 + message TitleItem { + int64 id = 1; // ID + string name = 2; // 名 + int32 sort = 3; // 排序号 + int32 remain = 4; // 剩余时长(单位:小时) + } + // 精英单位 + message EliteItem { + int64 id = 1; // ID 1000(普通x) 1001(弓骑兵) 1002(牧师) + int32 sort = 2; // 排序号 + int32 remain = 3; // 剩余时长(单位:天)-1无限制 + } -// req -message PlatformUserReq { - string platform = 1; - string pUid = 2; -} + int64 userId = 1; // 系统用户ID + int32 nobilityLevel = 2; // 贵族等级 + int64 coin = 3; // 金币 -message PlatformUserResp { - User user = 1; + TitleItem currentTitle = 4; // 当前佩戴的称号ID + EliteItem currentElite = 5; // 当前使用的精英单位ID + repeated TitleItem titles = 6; // 拥有的称号列表 + repeated EliteItem elites = 7; // 拥有的精英单位列表 } // 用户ID请求 @@ -39,63 +65,45 @@ message UserIdResp { int64 userId = 1; } -enum IntegralType { - Battle = 0; // 战斗 - Gift = 1; // 礼物 - Other = 10; // 其它积分 +message GetUserCoinResp { + int64 userId = 1; + int64 current = 2; // 当前量 } -// 变更积分请求 -message ChangeIntegralReq { +// 变更弹币请求 +message ChangeCoinReq { int64 userId = 1; // 系统用户ID - int64 battleId = 2; // 战斗ID(RPC内部) + int64 battleId = 2; // 战局ID int64 change = 3; // 变更数量 - IntegralType integralType = 4; // 积分类型 -} - -// 变更积分回复 -message ChangeIntegralResp { - int64 userId = 1; // 系统用户ID - int64 change = 2; // 本次变更积分数量,负数为扣减 - int64 integral = 3; // 用户当前总积分 -} - -// 用户积分回复 -message UserIntegralResp { - int64 userId = 1; // 用户ID - int64 integral = 2; // 用户当前总积分 -} - -// 用户打卡(签到)回复 -message UserCheckInResp { - int32 code = 1; - string msg = 2; // 消息 - int64 integralChange = 3; // 积分变动量 - int64 integral = 4; // 变动后的积分量 - bool isCritical = 5; // 是否发生了暴击奖励 + pb.vars.UserCoinChangedReason reason = 4; // 原因 } -// 转移用户积分 -message TransferUserIntegralReq { +// 转移用户弹币 +message TransferUserCoinReq { int64 userId = 1; // 源用户ID int64 targetUserId = 2; // 目标用户 int64 transfer = 3; // 待转移量 } -message TransferUserIntegralResp { - int32 code = 1; - string msg = 2; // 消息 +// 转移用户弹币 回复 +message TransferUserCoinResp { + int64 userId = 1; + string uname = 2; + string avatar = 3; - int64 userId = 3; - string uname = 4; - string avatar = 5; + int64 targetUserId = 4; + string targetUname = 5; + string targetAvatar = 6; - int64 targetUserId = 6; - string targetUname = 7; - string targetAvatar = 8; + int64 userCoin = 10; // 源用户剩余 + int64 targetUserCoin = 11; // 目标用户剩余 +} - int64 userIntegral = 10; // 源用户积分剩余 - int64 targetUserIntegral = 11; // 目标用户积分剩余 +// 用户打卡(签到)回复 +message UserCheckInResp { + int64 coinChange = 1; // 弹币变更量 + int64 currentCoin = 2; // 现有弹币量 + bool isCritical = 3; // 是否发生了暴击奖励 } // 用户送礼请求 @@ -112,11 +120,6 @@ message UserSendGiftReq { int64 battleId = 10; // 战局ID } -// 用户送礼回复 -message UserSendGiftResp { - ChangeIntegralResp integral = 10; // 积分变动 -} - // 用户购买舰长请求 message UserBuyNobilityReq { string platform = 1; // 平台 @@ -134,34 +137,20 @@ message UserBuyNobilityReq { int64 endTime = 12; // 结束时间 } -// 用户购买舰长回复 -message UserBuyNobilityResp { - ChangeIntegralResp integral = 10; // 积分变动 -} - -// 通知-PvP杀兵营(人) statistics.pvp.kill -message StatPvPKillReq { - int64 uid = 1; // 用户ID - int64 targetUid = 2; // 目标用户 - bool isGeneral = 3; // targetUid是否名将 -} - -// 通知-PvP一血 statistics.pvp.first -message StatPvPFirstBloodReq { - int64 uid = 1; // 用户ID - int32 type = 2; // 1-拿到一血 2-被破一血 -} - // 通知-PvP战报 statistics.pvp.report message StatPvPReportReq { message Item { int64 uid = 1; // 用户ID string uname = 2; // 用户名 - int32 position = 3; // 名次(特指在某一方的名次) - int64 damage = 4; // 伤害量 - int64 deDamage = 5; // 承受伤害 - int64 killUnit = 6; // 击杀单位数量 - int64 deKillUnit = 7; // 被杀单位数量 + int64 damage = 3; // 伤害量 + int64 deDamage = 4; // 承受伤害 + int64 killUnit = 5; // 击杀单位数量 + int64 deKillUnit = 6; // 被杀单位数量 + bool firstBlood = 7; // 拿到一血 + bool deFirstBlood = 8; // 被拿一血 + int64 killPlayer = 9; // 击杀玩家数 + bool deKillPlayer = 10; // 是否被击杀 + bool isGeneral = 11; // 是否上一把名将? } int32 winCamp = 1; // 获胜阵营 1-蓝 2-红 int64 battleId = 2; // 战斗ID @@ -175,15 +164,12 @@ message StatPvPReportResp { int64 uid = 1; // 用户ID string uname = 2; // 用户名 int32 position = 3; // 名次(特指在某一方的名次) - int64 returnsIntegral = 4; // 回收的积分(获胜方才能回收,0不要展示) - int64 rewardPoolIntegral = 5; // 瓜分奖池分 - int64 generalIntegral = 6; // 名将 - int64 nobilityIntegral = 7; // 舰长|总督|贵族 加成分 - int64 battleIntegral = 8; // 战斗结算奖励(普通) - int64 totalIntegral = 10; // 总计加分 + float score = 4; // 评分(一位小数) } - repeated Item winItems = 1; // 获胜方数据 - repeated Item lostItems = 2; // 战败方数据 + int32 winCamp = 1; // 获胜阵营 1-蓝 2-红 + int64 battleId = 2; // 战斗ID + repeated Item winItems = 10; // 获胜方数据 + repeated Item lostItems = 11; // 战败方数据 } //////////////////// 礼包 @@ -196,7 +182,7 @@ enum GiftType { message GiftPackItem { string packType = 1; // 礼包类型 starter:新手礼包 string packName = 2; // 礼包名称 - int64 integral = 3; // 获取的积分 + int64 coin = 3; // 获取的弹币 repeated string title = 4; // 获取的称号 } @@ -210,8 +196,7 @@ message DrawGiftPackReq { message DrawGiftPackResp { int64 uid = 1; string uname = 2; - int32 code = 3; // 领取结果 200:成功 201100:已经领取过 201101:已领取完 - string msg = 4; // 消息 [领取成功|已经领取过|该用户已领取(当日|每周|每月)完所有礼包] + GiftPackItem item = 10; } @@ -225,24 +210,9 @@ message IncreaseWelfareReq { } ////////////////////// rank -enum RankType { - Unknown = 0; - Damage = 1; // 伤害榜 - DeDamage = 2; // 受伤榜 - General = 3; // 名将榜 - DeGeneral = 4; // 落马榜 - KillUnit = 5; // 小兵击杀 - DeKillUnit = 6; // 小兵被杀 - KillPlayer = 7; // 击杀玩家 - DeKillPlayer = 8; // 被杀榜 - Win = 9; // 获胜榜 - Lost = 10; // 战败榜 - FirstBlood = 11; // 一血榜 - DeFirstBlood = 12; // 被拿一血榜 -} message RankPvpReq { - int32 type = 1; // rank类型 + pb.vars.RankType type = 1; // rank类型 int32 topN = 2; // TopN } @@ -253,13 +223,13 @@ message RankPvpResp { int64 score = 3; string avatar = 4; } - int32 type = 1; // rank类型 + pb.vars.RankType type = 1; // rank类型 repeated Item items = 2; // rank数据 } // RankPvpSubmitReq 手动排行榜结算 message RankPvpSubmitReq { - int32 rankType = 1; // 待结算的排行榜类型 + pb.vars.RankType rankType = 1; // 待结算的排行榜类型 bool allRankType = 2; // 是否直接结算所有排行类型 } @@ -268,12 +238,12 @@ message RankPvpSubmitResp { int64 userId = 1; string username = 2; string avatar = 3; - int64 integral = 4; // 获取到的积分数 + int64 coin = 4; // 获取到的积分数 string title = 5; // 获取到的称号 int64 titleDuration = 6; // 称号持续时间(单位: 秒,负数为无限长) } message Item { - int32 rankType = 1; // 排行榜类型 + pb.vars.RankType rankType = 1; // 排行榜类型 repeated Result results = 2; // 上榜玩家? } @@ -284,48 +254,100 @@ message RankPvpSubmitResp { message UserRankReq { int64 userId = 1; // 系统用户ID string username = 2; // 用户名 - int32 rankType = 3; // 排行榜类型 + pb.vars.RankType rankType = 3; // 排行榜类型 bool allRankType = 4; // 直接查询所有排行类型 } message UserRankResp { message Item { - int32 rankType = 1; // 排行类型 + pb.vars.RankType rankType = 1; // 排行类型 int32 pos = 2; // 名次 int64 score = 3; // 分数 } repeated Item items = 1; } +/////////////////////////// zhg +message EliteReq { + int64 userId = 1; // ID + int32 sort = 2; // 序号 +} + +message GiveEliteReq { + int64 userId = 1; // ID + int64 eliteId = 2; // 精英单位ID + int32 duration = 3; // 赠送时长(天) + bool forever = 4; // 永久赠送 +} + +message BuyEliteResp { + int64 userId = 1; // ID + int64 eliteId = 2; // 精英单位ID + int64 cost = 3; // 花费 + int32 duration = 4; // 持续时间 单位(day) +} + +message GiveTitleReq { + int64 userId = 1; // ID + int64 titleId = 2; // 精英单位ID + int32 duration = 3; // 赠送时长(天) + bool forever = 4; // 永久赠送 +} + +message BuyTitleResp { + int64 userId = 1; // ID + int64 titleId = 2; // 称号ID + string name = 3; // 称号名 + int64 cost = 4; // 花费 + int32 duration = 5; // 持续时间 单位(day) +} + +message ChangeEliteResp { + int64 userId = 1; + int64 eliteId = 2; +} + +message TitleReq { + int64 userId = 1; // ID + int32 sort = 2; // 序号 +} + +message ChangeTitleResp { + int64 userId = 1; + int64 titleId = 2; + string name = 3; +} + + service userCenter { /// @ZeroGroup: platform_user // retrievePlatformUser 新增或获取用户 rpc retrievePlatformUser(PlatformUserReq) returns (PlatformUserResp); + //getUserDetails 获取用户详细信息 + rpc getUserDetails(UserIdReq) returns (UserDetailsResp); // getUserIdByPUid 通过平台用户id获取系统用户ID rpc getUserIdByPUid(PlatformUserReq) returns (UserIdResp); - - /// @ZeroGroup: integral - - //ChangeIntegral 新增用户积分 - rpc changeIntegral(ChangeIntegralReq) returns (ChangeIntegralResp); - //GetUserIntegral 获取用户积分 - rpc getUserIntegral(UserIdReq) returns (UserIntegralResp); //UserCheckIn 用户签到|打卡 rpc userCheckIn(UserIdReq) returns (UserCheckInResp); - //TransferUserIntegral 转移积分 - rpc transferUserIntegral(TransferUserIntegralReq) returns (TransferUserIntegralResp); + + /// @ZeroGroup: coin + + //changeCoin 新增或扣减用户弹币 + rpc changeCoin(ChangeCoinReq) returns (Empty); + //getUserCoin 获取用户弹币 + rpc getUserCoin(UserIdReq) returns (GetUserCoinResp); + //transferUserCoin 转移用户弹币 + rpc transferUserCoin(TransferUserCoinReq) returns (TransferUserCoinResp); /// @ZeroGroup: gift // UserSendGift 用户赠送礼物 - rpc userSendGift(UserSendGiftReq) returns(UserSendGiftResp); - rpc userBuyNobility(UserBuyNobilityReq) returns(UserBuyNobilityResp); + rpc userSendGift(UserSendGiftReq) returns(Empty); + rpc userBuyNobility(UserBuyNobilityReq) returns(Empty); /// @ZeroGroup: statistics - rpc statPvpKill(StatPvPKillReq) returns (Empty); - rpc statPvpFirstBlood(StatPvPFirstBloodReq) returns (Empty); rpc statPvpReport(StatPvPReportReq) returns (StatPvPReportResp); /// @ZeroGroup: giftPack @@ -334,7 +356,7 @@ service userCenter { /// @ZeroGroup: drawPool - rpc increaseWelfare(IncreaseWelfareReq) returns (Empty); + // rpc increaseWelfare(IncreaseWelfareReq) returns (Empty); /// @ZeroGroup: rank @@ -342,4 +364,13 @@ service userCenter { rpc rankPvp(RankPvpReq) returns(RankPvpResp); rpc rankPvpSubmit(RankPvpSubmitReq) returns(RankPvpSubmitResp); rpc userRankPvp(UserRankReq) returns (UserRankResp); + + /// @ZeroGroup: zhg + + rpc giveElite(GiveEliteReq) returns(BuyEliteResp); + rpc buyElite(EliteReq) returns(BuyEliteResp); + rpc giveTitle(GiveTitleReq) returns(BuyTitleResp); + rpc buyTitle(TitleReq) returns(BuyTitleResp); + rpc changeElite(EliteReq) returns(ChangeEliteResp); + rpc changeTitle(TitleReq) returns(ChangeTitleResp); } \ No newline at end of file diff --git a/app/user_center/rpc/pb/user_center_grpc.pb.go b/app/user_center/rpc/pb/user_center_grpc.pb.go index 3db7050..ea6f48d 100644 --- a/app/user_center/rpc/pb/user_center_grpc.pb.go +++ b/app/user_center/rpc/pb/user_center_grpc.pb.go @@ -24,28 +24,33 @@ const _ = grpc.SupportPackageIsVersion7 type UserCenterClient interface { // retrievePlatformUser 新增或获取用户 RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) + //getUserDetails 获取用户详细信息 + GetUserDetails(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserDetailsResp, error) // getUserIdByPUid 通过平台用户id获取系统用户ID GetUserIdByPUid(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*UserIdResp, error) - //ChangeIntegral 新增用户积分 - ChangeIntegral(ctx context.Context, in *ChangeIntegralReq, opts ...grpc.CallOption) (*ChangeIntegralResp, error) - //GetUserIntegral 获取用户积分 - GetUserIntegral(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserIntegralResp, error) //UserCheckIn 用户签到|打卡 UserCheckIn(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserCheckInResp, error) - //TransferUserIntegral 转移积分 - TransferUserIntegral(ctx context.Context, in *TransferUserIntegralReq, opts ...grpc.CallOption) (*TransferUserIntegralResp, error) + //changeCoin 新增或扣减用户弹币 + ChangeCoin(ctx context.Context, in *ChangeCoinReq, opts ...grpc.CallOption) (*Empty, error) + //getUserCoin 获取用户弹币 + GetUserCoin(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*GetUserCoinResp, error) + //transferUserCoin 转移用户弹币 + TransferUserCoin(ctx context.Context, in *TransferUserCoinReq, opts ...grpc.CallOption) (*TransferUserCoinResp, error) // UserSendGift 用户赠送礼物 - UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*UserSendGiftResp, error) - UserBuyNobility(ctx context.Context, in *UserBuyNobilityReq, opts ...grpc.CallOption) (*UserBuyNobilityResp, error) - StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) - StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, opts ...grpc.CallOption) (*Empty, error) + UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*Empty, error) + UserBuyNobility(ctx context.Context, in *UserBuyNobilityReq, opts ...grpc.CallOption) (*Empty, error) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*StatPvPReportResp, error) DrawGiftPack(ctx context.Context, in *DrawGiftPackReq, opts ...grpc.CallOption) (*DrawGiftPackResp, error) - IncreaseWelfare(ctx context.Context, in *IncreaseWelfareReq, opts ...grpc.CallOption) (*Empty, error) // rankPvp pvp排行 RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) RankPvpSubmit(ctx context.Context, in *RankPvpSubmitReq, opts ...grpc.CallOption) (*RankPvpSubmitResp, error) UserRankPvp(ctx context.Context, in *UserRankReq, opts ...grpc.CallOption) (*UserRankResp, error) + GiveElite(ctx context.Context, in *GiveEliteReq, opts ...grpc.CallOption) (*BuyEliteResp, error) + BuyElite(ctx context.Context, in *EliteReq, opts ...grpc.CallOption) (*BuyEliteResp, error) + GiveTitle(ctx context.Context, in *GiveTitleReq, opts ...grpc.CallOption) (*BuyTitleResp, error) + BuyTitle(ctx context.Context, in *TitleReq, opts ...grpc.CallOption) (*BuyTitleResp, error) + ChangeElite(ctx context.Context, in *EliteReq, opts ...grpc.CallOption) (*ChangeEliteResp, error) + ChangeTitle(ctx context.Context, in *TitleReq, opts ...grpc.CallOption) (*ChangeTitleResp, error) } type userCenterClient struct { @@ -65,27 +70,18 @@ func (c *userCenterClient) RetrievePlatformUser(ctx context.Context, in *Platfor return out, nil } -func (c *userCenterClient) GetUserIdByPUid(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*UserIdResp, error) { - out := new(UserIdResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/getUserIdByPUid", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) ChangeIntegral(ctx context.Context, in *ChangeIntegralReq, opts ...grpc.CallOption) (*ChangeIntegralResp, error) { - out := new(ChangeIntegralResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/changeIntegral", in, out, opts...) +func (c *userCenterClient) GetUserDetails(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserDetailsResp, error) { + out := new(UserDetailsResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/getUserDetails", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userCenterClient) GetUserIntegral(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserIntegralResp, error) { - out := new(UserIntegralResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/getUserIntegral", in, out, opts...) +func (c *userCenterClient) GetUserIdByPUid(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*UserIdResp, error) { + out := new(UserIdResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/getUserIdByPUid", in, out, opts...) if err != nil { return nil, err } @@ -101,45 +97,45 @@ func (c *userCenterClient) UserCheckIn(ctx context.Context, in *UserIdReq, opts return out, nil } -func (c *userCenterClient) TransferUserIntegral(ctx context.Context, in *TransferUserIntegralReq, opts ...grpc.CallOption) (*TransferUserIntegralResp, error) { - out := new(TransferUserIntegralResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/transferUserIntegral", in, out, opts...) +func (c *userCenterClient) ChangeCoin(ctx context.Context, in *ChangeCoinReq, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.userCenter/changeCoin", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userCenterClient) UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*UserSendGiftResp, error) { - out := new(UserSendGiftResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/userSendGift", in, out, opts...) +func (c *userCenterClient) GetUserCoin(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*GetUserCoinResp, error) { + out := new(GetUserCoinResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/getUserCoin", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userCenterClient) UserBuyNobility(ctx context.Context, in *UserBuyNobilityReq, opts ...grpc.CallOption) (*UserBuyNobilityResp, error) { - out := new(UserBuyNobilityResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/userBuyNobility", in, out, opts...) +func (c *userCenterClient) TransferUserCoin(ctx context.Context, in *TransferUserCoinReq, opts ...grpc.CallOption) (*TransferUserCoinResp, error) { + out := new(TransferUserCoinResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/transferUserCoin", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userCenterClient) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) { +func (c *userCenterClient) UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) - err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpKill", in, out, opts...) + err := c.cc.Invoke(ctx, "/pb.userCenter/userSendGift", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userCenterClient) StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, opts ...grpc.CallOption) (*Empty, error) { +func (c *userCenterClient) UserBuyNobility(ctx context.Context, in *UserBuyNobilityReq, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) - err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpFirstBlood", in, out, opts...) + err := c.cc.Invoke(ctx, "/pb.userCenter/userBuyNobility", in, out, opts...) if err != nil { return nil, err } @@ -164,15 +160,6 @@ func (c *userCenterClient) DrawGiftPack(ctx context.Context, in *DrawGiftPackReq return out, nil } -func (c *userCenterClient) IncreaseWelfare(ctx context.Context, in *IncreaseWelfareReq, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/pb.userCenter/increaseWelfare", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *userCenterClient) RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) { out := new(RankPvpResp) err := c.cc.Invoke(ctx, "/pb.userCenter/rankPvp", in, out, opts...) @@ -200,34 +187,93 @@ func (c *userCenterClient) UserRankPvp(ctx context.Context, in *UserRankReq, opt return out, nil } +func (c *userCenterClient) GiveElite(ctx context.Context, in *GiveEliteReq, opts ...grpc.CallOption) (*BuyEliteResp, error) { + out := new(BuyEliteResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/giveElite", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) BuyElite(ctx context.Context, in *EliteReq, opts ...grpc.CallOption) (*BuyEliteResp, error) { + out := new(BuyEliteResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/buyElite", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) GiveTitle(ctx context.Context, in *GiveTitleReq, opts ...grpc.CallOption) (*BuyTitleResp, error) { + out := new(BuyTitleResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/giveTitle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) BuyTitle(ctx context.Context, in *TitleReq, opts ...grpc.CallOption) (*BuyTitleResp, error) { + out := new(BuyTitleResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/buyTitle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) ChangeElite(ctx context.Context, in *EliteReq, opts ...grpc.CallOption) (*ChangeEliteResp, error) { + out := new(ChangeEliteResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/changeElite", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) ChangeTitle(ctx context.Context, in *TitleReq, opts ...grpc.CallOption) (*ChangeTitleResp, error) { + out := new(ChangeTitleResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/changeTitle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // UserCenterServer is the server API for UserCenter service. // All implementations must embed UnimplementedUserCenterServer // for forward compatibility type UserCenterServer interface { // retrievePlatformUser 新增或获取用户 RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) + //getUserDetails 获取用户详细信息 + GetUserDetails(context.Context, *UserIdReq) (*UserDetailsResp, error) // getUserIdByPUid 通过平台用户id获取系统用户ID GetUserIdByPUid(context.Context, *PlatformUserReq) (*UserIdResp, error) - //ChangeIntegral 新增用户积分 - ChangeIntegral(context.Context, *ChangeIntegralReq) (*ChangeIntegralResp, error) - //GetUserIntegral 获取用户积分 - GetUserIntegral(context.Context, *UserIdReq) (*UserIntegralResp, error) //UserCheckIn 用户签到|打卡 UserCheckIn(context.Context, *UserIdReq) (*UserCheckInResp, error) - //TransferUserIntegral 转移积分 - TransferUserIntegral(context.Context, *TransferUserIntegralReq) (*TransferUserIntegralResp, error) + //changeCoin 新增或扣减用户弹币 + ChangeCoin(context.Context, *ChangeCoinReq) (*Empty, error) + //getUserCoin 获取用户弹币 + GetUserCoin(context.Context, *UserIdReq) (*GetUserCoinResp, error) + //transferUserCoin 转移用户弹币 + TransferUserCoin(context.Context, *TransferUserCoinReq) (*TransferUserCoinResp, error) // UserSendGift 用户赠送礼物 - UserSendGift(context.Context, *UserSendGiftReq) (*UserSendGiftResp, error) - UserBuyNobility(context.Context, *UserBuyNobilityReq) (*UserBuyNobilityResp, error) - StatPvpKill(context.Context, *StatPvPKillReq) (*Empty, error) - StatPvpFirstBlood(context.Context, *StatPvPFirstBloodReq) (*Empty, error) + UserSendGift(context.Context, *UserSendGiftReq) (*Empty, error) + UserBuyNobility(context.Context, *UserBuyNobilityReq) (*Empty, error) StatPvpReport(context.Context, *StatPvPReportReq) (*StatPvPReportResp, error) DrawGiftPack(context.Context, *DrawGiftPackReq) (*DrawGiftPackResp, error) - IncreaseWelfare(context.Context, *IncreaseWelfareReq) (*Empty, error) // rankPvp pvp排行 RankPvp(context.Context, *RankPvpReq) (*RankPvpResp, error) RankPvpSubmit(context.Context, *RankPvpSubmitReq) (*RankPvpSubmitResp, error) UserRankPvp(context.Context, *UserRankReq) (*UserRankResp, error) + GiveElite(context.Context, *GiveEliteReq) (*BuyEliteResp, error) + BuyElite(context.Context, *EliteReq) (*BuyEliteResp, error) + GiveTitle(context.Context, *GiveTitleReq) (*BuyTitleResp, error) + BuyTitle(context.Context, *TitleReq) (*BuyTitleResp, error) + ChangeElite(context.Context, *EliteReq) (*ChangeEliteResp, error) + ChangeTitle(context.Context, *TitleReq) (*ChangeTitleResp, error) mustEmbedUnimplementedUserCenterServer() } @@ -238,32 +284,29 @@ type UnimplementedUserCenterServer struct { func (UnimplementedUserCenterServer) RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) { return nil, status.Errorf(codes.Unimplemented, "method RetrievePlatformUser not implemented") } +func (UnimplementedUserCenterServer) GetUserDetails(context.Context, *UserIdReq) (*UserDetailsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserDetails not implemented") +} func (UnimplementedUserCenterServer) GetUserIdByPUid(context.Context, *PlatformUserReq) (*UserIdResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUserIdByPUid not implemented") } -func (UnimplementedUserCenterServer) ChangeIntegral(context.Context, *ChangeIntegralReq) (*ChangeIntegralResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChangeIntegral not implemented") -} -func (UnimplementedUserCenterServer) GetUserIntegral(context.Context, *UserIdReq) (*UserIntegralResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUserIntegral not implemented") -} func (UnimplementedUserCenterServer) UserCheckIn(context.Context, *UserIdReq) (*UserCheckInResp, error) { return nil, status.Errorf(codes.Unimplemented, "method UserCheckIn not implemented") } -func (UnimplementedUserCenterServer) TransferUserIntegral(context.Context, *TransferUserIntegralReq) (*TransferUserIntegralResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method TransferUserIntegral not implemented") +func (UnimplementedUserCenterServer) ChangeCoin(context.Context, *ChangeCoinReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeCoin not implemented") } -func (UnimplementedUserCenterServer) UserSendGift(context.Context, *UserSendGiftReq) (*UserSendGiftResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserSendGift not implemented") +func (UnimplementedUserCenterServer) GetUserCoin(context.Context, *UserIdReq) (*GetUserCoinResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserCoin not implemented") } -func (UnimplementedUserCenterServer) UserBuyNobility(context.Context, *UserBuyNobilityReq) (*UserBuyNobilityResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserBuyNobility not implemented") +func (UnimplementedUserCenterServer) TransferUserCoin(context.Context, *TransferUserCoinReq) (*TransferUserCoinResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferUserCoin not implemented") } -func (UnimplementedUserCenterServer) StatPvpKill(context.Context, *StatPvPKillReq) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method StatPvpKill not implemented") +func (UnimplementedUserCenterServer) UserSendGift(context.Context, *UserSendGiftReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserSendGift not implemented") } -func (UnimplementedUserCenterServer) StatPvpFirstBlood(context.Context, *StatPvPFirstBloodReq) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method StatPvpFirstBlood not implemented") +func (UnimplementedUserCenterServer) UserBuyNobility(context.Context, *UserBuyNobilityReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UserBuyNobility not implemented") } func (UnimplementedUserCenterServer) StatPvpReport(context.Context, *StatPvPReportReq) (*StatPvPReportResp, error) { return nil, status.Errorf(codes.Unimplemented, "method StatPvpReport not implemented") @@ -271,9 +314,6 @@ func (UnimplementedUserCenterServer) StatPvpReport(context.Context, *StatPvPRepo func (UnimplementedUserCenterServer) DrawGiftPack(context.Context, *DrawGiftPackReq) (*DrawGiftPackResp, error) { return nil, status.Errorf(codes.Unimplemented, "method DrawGiftPack not implemented") } -func (UnimplementedUserCenterServer) IncreaseWelfare(context.Context, *IncreaseWelfareReq) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method IncreaseWelfare not implemented") -} func (UnimplementedUserCenterServer) RankPvp(context.Context, *RankPvpReq) (*RankPvpResp, error) { return nil, status.Errorf(codes.Unimplemented, "method RankPvp not implemented") } @@ -283,6 +323,24 @@ func (UnimplementedUserCenterServer) RankPvpSubmit(context.Context, *RankPvpSubm func (UnimplementedUserCenterServer) UserRankPvp(context.Context, *UserRankReq) (*UserRankResp, error) { return nil, status.Errorf(codes.Unimplemented, "method UserRankPvp not implemented") } +func (UnimplementedUserCenterServer) GiveElite(context.Context, *GiveEliteReq) (*BuyEliteResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GiveElite not implemented") +} +func (UnimplementedUserCenterServer) BuyElite(context.Context, *EliteReq) (*BuyEliteResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuyElite not implemented") +} +func (UnimplementedUserCenterServer) GiveTitle(context.Context, *GiveTitleReq) (*BuyTitleResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GiveTitle not implemented") +} +func (UnimplementedUserCenterServer) BuyTitle(context.Context, *TitleReq) (*BuyTitleResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuyTitle not implemented") +} +func (UnimplementedUserCenterServer) ChangeElite(context.Context, *EliteReq) (*ChangeEliteResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeElite not implemented") +} +func (UnimplementedUserCenterServer) ChangeTitle(context.Context, *TitleReq) (*ChangeTitleResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChangeTitle not implemented") +} func (UnimplementedUserCenterServer) mustEmbedUnimplementedUserCenterServer() {} // UnsafeUserCenterServer may be embedded to opt out of forward compatibility for this service. @@ -314,6 +372,24 @@ func _UserCenter_RetrievePlatformUser_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _UserCenter_GetUserDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UserIdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).GetUserDetails(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/getUserDetails", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).GetUserDetails(ctx, req.(*UserIdReq)) + } + return interceptor(ctx, in, info, handler) +} + func _UserCenter_GetUserIdByPUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PlatformUserReq) if err := dec(in); err != nil { @@ -332,74 +408,74 @@ func _UserCenter_GetUserIdByPUid_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } -func _UserCenter_ChangeIntegral_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeIntegralReq) +func _UserCenter_UserCheckIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UserIdReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).ChangeIntegral(ctx, in) + return srv.(UserCenterServer).UserCheckIn(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/changeIntegral", + FullMethod: "/pb.userCenter/userCheckIn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).ChangeIntegral(ctx, req.(*ChangeIntegralReq)) + return srv.(UserCenterServer).UserCheckIn(ctx, req.(*UserIdReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_GetUserIntegral_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserIdReq) +func _UserCenter_ChangeCoin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeCoinReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).GetUserIntegral(ctx, in) + return srv.(UserCenterServer).ChangeCoin(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/getUserIntegral", + FullMethod: "/pb.userCenter/changeCoin", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).GetUserIntegral(ctx, req.(*UserIdReq)) + return srv.(UserCenterServer).ChangeCoin(ctx, req.(*ChangeCoinReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_UserCheckIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _UserCenter_GetUserCoin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UserIdReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).UserCheckIn(ctx, in) + return srv.(UserCenterServer).GetUserCoin(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/userCheckIn", + FullMethod: "/pb.userCenter/getUserCoin", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).UserCheckIn(ctx, req.(*UserIdReq)) + return srv.(UserCenterServer).GetUserCoin(ctx, req.(*UserIdReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_TransferUserIntegral_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TransferUserIntegralReq) +func _UserCenter_TransferUserCoin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TransferUserCoinReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).TransferUserIntegral(ctx, in) + return srv.(UserCenterServer).TransferUserCoin(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/transferUserIntegral", + FullMethod: "/pb.userCenter/transferUserCoin", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).TransferUserIntegral(ctx, req.(*TransferUserIntegralReq)) + return srv.(UserCenterServer).TransferUserCoin(ctx, req.(*TransferUserCoinReq)) } return interceptor(ctx, in, info, handler) } @@ -440,146 +516,200 @@ func _UserCenter_UserBuyNobility_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } -func _UserCenter_StatPvpKill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatPvPKillReq) +func _UserCenter_StatPvpReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatPvPReportReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).StatPvpKill(ctx, in) + return srv.(UserCenterServer).StatPvpReport(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/statPvpKill", + FullMethod: "/pb.userCenter/statPvpReport", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).StatPvpKill(ctx, req.(*StatPvPKillReq)) + return srv.(UserCenterServer).StatPvpReport(ctx, req.(*StatPvPReportReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_StatPvpFirstBlood_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatPvPFirstBloodReq) +func _UserCenter_DrawGiftPack_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DrawGiftPackReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).StatPvpFirstBlood(ctx, in) + return srv.(UserCenterServer).DrawGiftPack(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/statPvpFirstBlood", + FullMethod: "/pb.userCenter/drawGiftPack", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).StatPvpFirstBlood(ctx, req.(*StatPvPFirstBloodReq)) + return srv.(UserCenterServer).DrawGiftPack(ctx, req.(*DrawGiftPackReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_StatPvpReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatPvPReportReq) +func _UserCenter_RankPvp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RankPvpReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).StatPvpReport(ctx, in) + return srv.(UserCenterServer).RankPvp(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/statPvpReport", + FullMethod: "/pb.userCenter/rankPvp", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).StatPvpReport(ctx, req.(*StatPvPReportReq)) + return srv.(UserCenterServer).RankPvp(ctx, req.(*RankPvpReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_DrawGiftPack_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DrawGiftPackReq) +func _UserCenter_RankPvpSubmit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RankPvpSubmitReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).DrawGiftPack(ctx, in) + return srv.(UserCenterServer).RankPvpSubmit(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/drawGiftPack", + FullMethod: "/pb.userCenter/rankPvpSubmit", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).DrawGiftPack(ctx, req.(*DrawGiftPackReq)) + return srv.(UserCenterServer).RankPvpSubmit(ctx, req.(*RankPvpSubmitReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_IncreaseWelfare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IncreaseWelfareReq) +func _UserCenter_UserRankPvp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UserRankReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).IncreaseWelfare(ctx, in) + return srv.(UserCenterServer).UserRankPvp(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/increaseWelfare", + FullMethod: "/pb.userCenter/userRankPvp", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).IncreaseWelfare(ctx, req.(*IncreaseWelfareReq)) + return srv.(UserCenterServer).UserRankPvp(ctx, req.(*UserRankReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_RankPvp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RankPvpReq) +func _UserCenter_GiveElite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GiveEliteReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).RankPvp(ctx, in) + return srv.(UserCenterServer).GiveElite(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/rankPvp", + FullMethod: "/pb.userCenter/giveElite", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).RankPvp(ctx, req.(*RankPvpReq)) + return srv.(UserCenterServer).GiveElite(ctx, req.(*GiveEliteReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_RankPvpSubmit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RankPvpSubmitReq) +func _UserCenter_BuyElite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EliteReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).RankPvpSubmit(ctx, in) + return srv.(UserCenterServer).BuyElite(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/rankPvpSubmit", + FullMethod: "/pb.userCenter/buyElite", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).RankPvpSubmit(ctx, req.(*RankPvpSubmitReq)) + return srv.(UserCenterServer).BuyElite(ctx, req.(*EliteReq)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_UserRankPvp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserRankReq) +func _UserCenter_GiveTitle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GiveTitleReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).UserRankPvp(ctx, in) + return srv.(UserCenterServer).GiveTitle(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/userRankPvp", + FullMethod: "/pb.userCenter/giveTitle", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).UserRankPvp(ctx, req.(*UserRankReq)) + return srv.(UserCenterServer).GiveTitle(ctx, req.(*GiveTitleReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserCenter_BuyTitle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TitleReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).BuyTitle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/buyTitle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).BuyTitle(ctx, req.(*TitleReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserCenter_ChangeElite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EliteReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).ChangeElite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/changeElite", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).ChangeElite(ctx, req.(*EliteReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserCenter_ChangeTitle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TitleReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).ChangeTitle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/changeTitle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).ChangeTitle(ctx, req.(*TitleReq)) } return interceptor(ctx, in, info, handler) } @@ -595,25 +725,29 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{ MethodName: "retrievePlatformUser", Handler: _UserCenter_RetrievePlatformUser_Handler, }, + { + MethodName: "getUserDetails", + Handler: _UserCenter_GetUserDetails_Handler, + }, { MethodName: "getUserIdByPUid", Handler: _UserCenter_GetUserIdByPUid_Handler, }, { - MethodName: "changeIntegral", - Handler: _UserCenter_ChangeIntegral_Handler, + MethodName: "userCheckIn", + Handler: _UserCenter_UserCheckIn_Handler, }, { - MethodName: "getUserIntegral", - Handler: _UserCenter_GetUserIntegral_Handler, + MethodName: "changeCoin", + Handler: _UserCenter_ChangeCoin_Handler, }, { - MethodName: "userCheckIn", - Handler: _UserCenter_UserCheckIn_Handler, + MethodName: "getUserCoin", + Handler: _UserCenter_GetUserCoin_Handler, }, { - MethodName: "transferUserIntegral", - Handler: _UserCenter_TransferUserIntegral_Handler, + MethodName: "transferUserCoin", + Handler: _UserCenter_TransferUserCoin_Handler, }, { MethodName: "userSendGift", @@ -623,14 +757,6 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{ MethodName: "userBuyNobility", Handler: _UserCenter_UserBuyNobility_Handler, }, - { - MethodName: "statPvpKill", - Handler: _UserCenter_StatPvpKill_Handler, - }, - { - MethodName: "statPvpFirstBlood", - Handler: _UserCenter_StatPvpFirstBlood_Handler, - }, { MethodName: "statPvpReport", Handler: _UserCenter_StatPvpReport_Handler, @@ -639,10 +765,6 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{ MethodName: "drawGiftPack", Handler: _UserCenter_DrawGiftPack_Handler, }, - { - MethodName: "increaseWelfare", - Handler: _UserCenter_IncreaseWelfare_Handler, - }, { MethodName: "rankPvp", Handler: _UserCenter_RankPvp_Handler, @@ -655,6 +777,30 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{ MethodName: "userRankPvp", Handler: _UserCenter_UserRankPvp_Handler, }, + { + MethodName: "giveElite", + Handler: _UserCenter_GiveElite_Handler, + }, + { + MethodName: "buyElite", + Handler: _UserCenter_BuyElite_Handler, + }, + { + MethodName: "giveTitle", + Handler: _UserCenter_GiveTitle_Handler, + }, + { + MethodName: "buyTitle", + Handler: _UserCenter_BuyTitle_Handler, + }, + { + MethodName: "changeElite", + Handler: _UserCenter_ChangeElite_Handler, + }, + { + MethodName: "changeTitle", + Handler: _UserCenter_ChangeTitle_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "user_center.proto", diff --git a/app/user_center/rpc/user_center.go b/app/user_center/rpc/user_center.go index 4d29200..b8f15c1 100644 --- a/app/user_center/rpc/user_center.go +++ b/app/user_center/rpc/user_center.go @@ -3,6 +3,7 @@ package main import ( "flag" "fmt" + "github.com/zeromicro/go-zero/core/conf" "live-service/app/user_center/rpc/internal/config" "live-service/app/user_center/rpc/internal/logic/gift_collect" "live-service/app/user_center/rpc/internal/logic/platform_user" @@ -12,7 +13,6 @@ import ( "live-service/app/user_center/rpc/pb" "live-service/common/interceptor/rpcserver" - "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/service" "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc" @@ -26,7 +26,11 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - ctx := svc.NewServiceContext(c) + + var cg config.GameConfig + config.MustLoad(*configFile, &cg) + + ctx := svc.NewServiceContext(&c, &cg) svr := server.NewUserCenterServer(ctx) platform_user.InitUserRetriever(ctx) diff --git a/app/user_center/rpc/usercenter/user_center.go b/app/user_center/rpc/usercenter/user_center.go index 602e8e4..43eae36 100644 --- a/app/user_center/rpc/usercenter/user_center.go +++ b/app/user_center/rpc/usercenter/user_center.go @@ -13,68 +13,79 @@ import ( ) type ( - ChangeIntegralReq = pb.ChangeIntegralReq - ChangeIntegralResp = pb.ChangeIntegralResp - DrawGiftPackReq = pb.DrawGiftPackReq - DrawGiftPackResp = pb.DrawGiftPackResp - Empty = pb.Empty - GiftPackItem = pb.GiftPackItem - IncreaseWelfareReq = pb.IncreaseWelfareReq - PlatformUserReq = pb.PlatformUserReq - PlatformUserResp = pb.PlatformUserResp - RankPvpReq = pb.RankPvpReq - RankPvpResp = pb.RankPvpResp - RankPvpResp_Item = pb.RankPvpResp_Item - RankPvpSubmitReq = pb.RankPvpSubmitReq - RankPvpSubmitResp = pb.RankPvpSubmitResp - RankPvpSubmitResp_Item = pb.RankPvpSubmitResp_Item - RankPvpSubmitResp_Result = pb.RankPvpSubmitResp_Result - StatPvPFirstBloodReq = pb.StatPvPFirstBloodReq - StatPvPKillReq = pb.StatPvPKillReq - StatPvPReportReq = pb.StatPvPReportReq - StatPvPReportReq_Item = pb.StatPvPReportReq_Item - StatPvPReportResp = pb.StatPvPReportResp - StatPvPReportResp_Item = pb.StatPvPReportResp_Item - TransferUserIntegralReq = pb.TransferUserIntegralReq - TransferUserIntegralResp = pb.TransferUserIntegralResp - User = pb.User - UserBuyNobilityReq = pb.UserBuyNobilityReq - UserBuyNobilityResp = pb.UserBuyNobilityResp - UserCheckInResp = pb.UserCheckInResp - UserIdReq = pb.UserIdReq - UserIdResp = pb.UserIdResp - UserIntegralResp = pb.UserIntegralResp - UserRankReq = pb.UserRankReq - UserRankResp = pb.UserRankResp - UserRankResp_Item = pb.UserRankResp_Item - UserSendGiftReq = pb.UserSendGiftReq - UserSendGiftResp = pb.UserSendGiftResp + BuyEliteResp = pb.BuyEliteResp + BuyTitleResp = pb.BuyTitleResp + ChangeCoinReq = pb.ChangeCoinReq + ChangeEliteResp = pb.ChangeEliteResp + ChangeTitleResp = pb.ChangeTitleResp + DrawGiftPackReq = pb.DrawGiftPackReq + DrawGiftPackResp = pb.DrawGiftPackResp + EliteReq = pb.EliteReq + Empty = pb.Empty + GetUserCoinResp = pb.GetUserCoinResp + GiftPackItem = pb.GiftPackItem + GiveEliteReq = pb.GiveEliteReq + GiveTitleReq = pb.GiveTitleReq + IncreaseWelfareReq = pb.IncreaseWelfareReq + PlatformUserReq = pb.PlatformUserReq + PlatformUserResp = pb.PlatformUserResp + RankPvpReq = pb.RankPvpReq + RankPvpResp = pb.RankPvpResp + RankPvpResp_Item = pb.RankPvpResp_Item + RankPvpSubmitReq = pb.RankPvpSubmitReq + RankPvpSubmitResp = pb.RankPvpSubmitResp + RankPvpSubmitResp_Item = pb.RankPvpSubmitResp_Item + RankPvpSubmitResp_Result = pb.RankPvpSubmitResp_Result + Response = pb.Response + StatPvPReportReq = pb.StatPvPReportReq + StatPvPReportReq_Item = pb.StatPvPReportReq_Item + StatPvPReportResp = pb.StatPvPReportResp + StatPvPReportResp_Item = pb.StatPvPReportResp_Item + TitleReq = pb.TitleReq + TransferUserCoinReq = pb.TransferUserCoinReq + TransferUserCoinResp = pb.TransferUserCoinResp + UserBuyNobilityReq = pb.UserBuyNobilityReq + UserCheckInResp = pb.UserCheckInResp + UserDetailsResp = pb.UserDetailsResp + UserDetailsResp_EliteItem = pb.UserDetailsResp_EliteItem + UserDetailsResp_TitleItem = pb.UserDetailsResp_TitleItem + UserIdReq = pb.UserIdReq + UserIdResp = pb.UserIdResp + UserRankReq = pb.UserRankReq + UserRankResp = pb.UserRankResp + UserRankResp_Item = pb.UserRankResp_Item + UserSendGiftReq = pb.UserSendGiftReq UserCenter interface { // retrievePlatformUser 新增或获取用户 RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) + // getUserDetails 获取用户详细信息 + GetUserDetails(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserDetailsResp, error) // getUserIdByPUid 通过平台用户id获取系统用户ID GetUserIdByPUid(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*UserIdResp, error) - // ChangeIntegral 新增用户积分 - ChangeIntegral(ctx context.Context, in *ChangeIntegralReq, opts ...grpc.CallOption) (*ChangeIntegralResp, error) - // GetUserIntegral 获取用户积分 - GetUserIntegral(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserIntegralResp, error) // UserCheckIn 用户签到|打卡 UserCheckIn(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserCheckInResp, error) - // TransferUserIntegral 转移积分 - TransferUserIntegral(ctx context.Context, in *TransferUserIntegralReq, opts ...grpc.CallOption) (*TransferUserIntegralResp, error) + // changeCoin 新增或扣减用户弹币 + ChangeCoin(ctx context.Context, in *ChangeCoinReq, opts ...grpc.CallOption) (*Empty, error) + // getUserCoin 获取用户弹币 + GetUserCoin(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*GetUserCoinResp, error) + // transferUserCoin 转移用户弹币 + TransferUserCoin(ctx context.Context, in *TransferUserCoinReq, opts ...grpc.CallOption) (*TransferUserCoinResp, error) // UserSendGift 用户赠送礼物 - UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*UserSendGiftResp, error) - UserBuyNobility(ctx context.Context, in *UserBuyNobilityReq, opts ...grpc.CallOption) (*UserBuyNobilityResp, error) - StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) - StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, opts ...grpc.CallOption) (*Empty, error) + UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*Empty, error) + UserBuyNobility(ctx context.Context, in *UserBuyNobilityReq, opts ...grpc.CallOption) (*Empty, error) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*StatPvPReportResp, error) DrawGiftPack(ctx context.Context, in *DrawGiftPackReq, opts ...grpc.CallOption) (*DrawGiftPackResp, error) - IncreaseWelfare(ctx context.Context, in *IncreaseWelfareReq, opts ...grpc.CallOption) (*Empty, error) // rankPvp pvp排行 RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) RankPvpSubmit(ctx context.Context, in *RankPvpSubmitReq, opts ...grpc.CallOption) (*RankPvpSubmitResp, error) UserRankPvp(ctx context.Context, in *UserRankReq, opts ...grpc.CallOption) (*UserRankResp, error) + GiveElite(ctx context.Context, in *GiveEliteReq, opts ...grpc.CallOption) (*BuyEliteResp, error) + BuyElite(ctx context.Context, in *EliteReq, opts ...grpc.CallOption) (*BuyEliteResp, error) + GiveTitle(ctx context.Context, in *GiveTitleReq, opts ...grpc.CallOption) (*BuyTitleResp, error) + BuyTitle(ctx context.Context, in *TitleReq, opts ...grpc.CallOption) (*BuyTitleResp, error) + ChangeElite(ctx context.Context, in *EliteReq, opts ...grpc.CallOption) (*ChangeEliteResp, error) + ChangeTitle(ctx context.Context, in *TitleReq, opts ...grpc.CallOption) (*ChangeTitleResp, error) } defaultUserCenter struct { @@ -94,22 +105,16 @@ func (m *defaultUserCenter) RetrievePlatformUser(ctx context.Context, in *Platfo return client.RetrievePlatformUser(ctx, in, opts...) } -// getUserIdByPUid 通过平台用户id获取系统用户ID -func (m *defaultUserCenter) GetUserIdByPUid(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*UserIdResp, error) { +// getUserDetails 获取用户详细信息 +func (m *defaultUserCenter) GetUserDetails(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserDetailsResp, error) { client := pb.NewUserCenterClient(m.cli.Conn()) - return client.GetUserIdByPUid(ctx, in, opts...) + return client.GetUserDetails(ctx, in, opts...) } -// ChangeIntegral 新增用户积分 -func (m *defaultUserCenter) ChangeIntegral(ctx context.Context, in *ChangeIntegralReq, opts ...grpc.CallOption) (*ChangeIntegralResp, error) { - client := pb.NewUserCenterClient(m.cli.Conn()) - return client.ChangeIntegral(ctx, in, opts...) -} - -// GetUserIntegral 获取用户积分 -func (m *defaultUserCenter) GetUserIntegral(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserIntegralResp, error) { +// getUserIdByPUid 通过平台用户id获取系统用户ID +func (m *defaultUserCenter) GetUserIdByPUid(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*UserIdResp, error) { client := pb.NewUserCenterClient(m.cli.Conn()) - return client.GetUserIntegral(ctx, in, opts...) + return client.GetUserIdByPUid(ctx, in, opts...) } // UserCheckIn 用户签到|打卡 @@ -118,31 +123,33 @@ func (m *defaultUserCenter) UserCheckIn(ctx context.Context, in *UserIdReq, opts return client.UserCheckIn(ctx, in, opts...) } -// TransferUserIntegral 转移积分 -func (m *defaultUserCenter) TransferUserIntegral(ctx context.Context, in *TransferUserIntegralReq, opts ...grpc.CallOption) (*TransferUserIntegralResp, error) { +// changeCoin 新增或扣减用户弹币 +func (m *defaultUserCenter) ChangeCoin(ctx context.Context, in *ChangeCoinReq, opts ...grpc.CallOption) (*Empty, error) { client := pb.NewUserCenterClient(m.cli.Conn()) - return client.TransferUserIntegral(ctx, in, opts...) + return client.ChangeCoin(ctx, in, opts...) } -// UserSendGift 用户赠送礼物 -func (m *defaultUserCenter) UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*UserSendGiftResp, error) { +// getUserCoin 获取用户弹币 +func (m *defaultUserCenter) GetUserCoin(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*GetUserCoinResp, error) { client := pb.NewUserCenterClient(m.cli.Conn()) - return client.UserSendGift(ctx, in, opts...) + return client.GetUserCoin(ctx, in, opts...) } -func (m *defaultUserCenter) UserBuyNobility(ctx context.Context, in *UserBuyNobilityReq, opts ...grpc.CallOption) (*UserBuyNobilityResp, error) { +// transferUserCoin 转移用户弹币 +func (m *defaultUserCenter) TransferUserCoin(ctx context.Context, in *TransferUserCoinReq, opts ...grpc.CallOption) (*TransferUserCoinResp, error) { client := pb.NewUserCenterClient(m.cli.Conn()) - return client.UserBuyNobility(ctx, in, opts...) + return client.TransferUserCoin(ctx, in, opts...) } -func (m *defaultUserCenter) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) { +// UserSendGift 用户赠送礼物 +func (m *defaultUserCenter) UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*Empty, error) { client := pb.NewUserCenterClient(m.cli.Conn()) - return client.StatPvpKill(ctx, in, opts...) + return client.UserSendGift(ctx, in, opts...) } -func (m *defaultUserCenter) StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, opts ...grpc.CallOption) (*Empty, error) { +func (m *defaultUserCenter) UserBuyNobility(ctx context.Context, in *UserBuyNobilityReq, opts ...grpc.CallOption) (*Empty, error) { client := pb.NewUserCenterClient(m.cli.Conn()) - return client.StatPvpFirstBlood(ctx, in, opts...) + return client.UserBuyNobility(ctx, in, opts...) } func (m *defaultUserCenter) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*StatPvPReportResp, error) { @@ -155,11 +162,6 @@ func (m *defaultUserCenter) DrawGiftPack(ctx context.Context, in *DrawGiftPackRe return client.DrawGiftPack(ctx, in, opts...) } -func (m *defaultUserCenter) IncreaseWelfare(ctx context.Context, in *IncreaseWelfareReq, opts ...grpc.CallOption) (*Empty, error) { - client := pb.NewUserCenterClient(m.cli.Conn()) - return client.IncreaseWelfare(ctx, in, opts...) -} - // rankPvp pvp排行 func (m *defaultUserCenter) RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) { client := pb.NewUserCenterClient(m.cli.Conn()) @@ -175,3 +177,33 @@ func (m *defaultUserCenter) UserRankPvp(ctx context.Context, in *UserRankReq, op client := pb.NewUserCenterClient(m.cli.Conn()) return client.UserRankPvp(ctx, in, opts...) } + +func (m *defaultUserCenter) GiveElite(ctx context.Context, in *GiveEliteReq, opts ...grpc.CallOption) (*BuyEliteResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.GiveElite(ctx, in, opts...) +} + +func (m *defaultUserCenter) BuyElite(ctx context.Context, in *EliteReq, opts ...grpc.CallOption) (*BuyEliteResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.BuyElite(ctx, in, opts...) +} + +func (m *defaultUserCenter) GiveTitle(ctx context.Context, in *GiveTitleReq, opts ...grpc.CallOption) (*BuyTitleResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.GiveTitle(ctx, in, opts...) +} + +func (m *defaultUserCenter) BuyTitle(ctx context.Context, in *TitleReq, opts ...grpc.CallOption) (*BuyTitleResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.BuyTitle(ctx, in, opts...) +} + +func (m *defaultUserCenter) ChangeElite(ctx context.Context, in *EliteReq, opts ...grpc.CallOption) (*ChangeEliteResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.ChangeElite(ctx, in, opts...) +} + +func (m *defaultUserCenter) ChangeTitle(ctx context.Context, in *TitleReq, opts ...grpc.CallOption) (*ChangeTitleResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.ChangeTitle(ctx, in, opts...) +} diff --git a/common/nerr/err_code.go b/common/nerr/err_code.go index 413f537..7dad983 100644 --- a/common/nerr/err_code.go +++ b/common/nerr/err_code.go @@ -19,38 +19,51 @@ const ( // 业务错误 -// 用户积分相关 UserIntegral const ( - UserIntegralNotEnoughError uint32 = iota + 200100 // 用户积分不足 - NewUserIntegralError // 新建用户积分失败 - GetUserIntegralError // 获取用户积分失败 - UpdateUserIntegralError // 更新用户积分失败 -) + // UserAlreadyCheckIn 用户相关 + UserAlreadyCheckIn uint32 = iota + 200100 // 用户已打过卡了 -// 礼包相关 GiftPack + // UserIntegralNotEnoughError 用户积分相关 UserIntegral + UserIntegralNotEnoughError // 用户积分不足 + NewUserIntegralError // 新建用户积分失败 + GetUserIntegralError // 获取用户积分失败 + UpdateUserIntegralError // 更新用户积分失败 -const ( - GiftPackHasDrawError uint32 = 201100 // 该礼包已经领取过 - GiftPackDrawCountLimitedError = 201101 // 该礼包已领取完 -) + // UserCoinNotEnoughErr 用户金币(Coin)相关 UserCoin + UserCoinNotEnoughErr // 用户金币不足 + NewUserCoinErr // 新建用户金币失败 + GetUserCoinErr // 获取用户金币失败 + UpdateUserCoinErr // 更新用户金币失败 -// 礼物相关 Gift + // UserEliteExpiresErr 用户精英单位相关 + UserEliteExpiresErr // 用户精英单位过期 + UserEliteNotFoundErr // 用户没有此单位 + UserChangeEliteErr // 用户切换精英单位失败 -const ( - GiftRecordErr uint32 = 202100 // 礼物记录失败 - GiftNobilityUpdateErr = 202101 // 更新贵族信息失败 + // UserTitleExpiresErr 用户称号相关 + UserTitleExpiresErr // 用户称号过期 + UserTitleNotFoundErr // 用户没有此称号 + UserChangeTitleErr // 用户切换称号失败 ) -// 排行相关 +// 其它业务 const ( - RankStatisticsSelectError uint32 = 203100 // 获取统计数据失败 -) + // GiftPackHasDrawError 礼包相关 GiftPack + GiftPackHasDrawError uint32 = iota + 201100 // 该礼包已经领取过 + GiftPackDrawCountLimitedError // 该礼包已领取完 -// 用户金币(Coin)相关 UserCoin -const ( - UserCoinNotEnoughErr uint32 = iota + 204100 // 用户金币不足 - NewUserCoinErr // 新建用户金币失败 - GetUserCoinErr // 获取用户金币失败 - UpdateUserCoinErr // 更新用户金币失败 + // GiftRecordErr 礼物相关 Gift + GiftRecordErr // 礼物记录失败 + GiftNobilityUpdateErr // 更新贵族信息失败 + + // RankStatisticsSelectError 排行相关 + RankStatisticsSelectError // 获取统计数据失败 + + // EliteConfigNotFoundErr 精英单位 + EliteConfigNotFoundErr // 精英单位配置不存在 + + // TitleConfigNotFoundErr 称号相关 + TitleConfigNotFoundErr // 称号配置不存在 + TitleCannotBuyErr // 该称号禁止购买 ) diff --git a/common/timex/expire.go b/common/timex/expire.go new file mode 100644 index 0000000..806135e --- /dev/null +++ b/common/timex/expire.go @@ -0,0 +1,28 @@ +package timex + +import ( + "github.com/jinzhu/now" + "time" +) + +// DayExpire 日期是否过期 +// 使用 BeginningOfDay 判断 +func DayExpire(nowTime time.Time, src time.Time, forever bool) bool { + if forever { + return false + } + today := now.With(nowTime).BeginningOfDay() + return !today.Before(now.With(src).BeginningOfDay()) +} + +// DayRemain 剩余天数(包括今天) +func DayRemain(nowTime time.Time, src time.Time, forever bool) int32 { + if forever { + return -1 + } + resp := int32(src.YearDay() - nowTime.YearDay()) + if resp < 0 { + resp = 0 + } + return resp +} diff --git a/go.mod b/go.mod index d32615a..62b13bd 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,13 @@ module live-service go 1.18 require ( - git.noahlan.cn/northlan/ntools-go/gorm-zero v1.0.6 + git.noahlan.cn/northlan/ntools-go/gorm-zero v1.0.8 git.noahlan.cn/northlan/ntools-go/kafka v1.0.1 git.noahlan.cn/northlan/ntools-go/uuid v1.0.0 github.com/Shopify/sarama v1.33.0 github.com/hashicorp/golang-lru v0.5.1 github.com/jinzhu/now v1.1.5 + github.com/knadh/koanf v1.4.1 github.com/longzhiri/gozset v0.0.0-20210113140059-91f2d281daf1 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.0 @@ -31,6 +32,7 @@ require ( github.com/eapache/go-resiliency v1.2.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect github.com/eapache/queue v1.1.0 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect @@ -54,6 +56,9 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.15.4 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/openzipkin/zipkin-go v0.4.0 // indirect diff --git a/go.sum b/go.sum index 02956a6..40a0c80 100644 --- a/go.sum +++ b/go.sum @@ -31,10 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -git.noahlan.cn/northlan/ntools-go/gorm-zero v1.0.4 h1:r9jH+tJ1YoeX0gtt26lWeW2hxJGbKH1DksnIrjrLaMk= -git.noahlan.cn/northlan/ntools-go/gorm-zero v1.0.4/go.mod h1:ExV9s96axCdMcaXqsezoUxnbTptkMqwvNWvON05uzjE= -git.noahlan.cn/northlan/ntools-go/gorm-zero v1.0.6 h1:Y59SvkmIFsAAF3BifOxMjOwj/USsZDLuMuliPS2r4OA= -git.noahlan.cn/northlan/ntools-go/gorm-zero v1.0.6/go.mod h1:ExV9s96axCdMcaXqsezoUxnbTptkMqwvNWvON05uzjE= +git.noahlan.cn/northlan/ntools-go/gorm-zero v1.0.8 h1:k2dEdCJWj0rFqOWy8XHolKnw896Dn4RYqWtLqlp+7zI= +git.noahlan.cn/northlan/ntools-go/gorm-zero v1.0.8/go.mod h1:ExV9s96axCdMcaXqsezoUxnbTptkMqwvNWvON05uzjE= git.noahlan.cn/northlan/ntools-go/kafka v1.0.1 h1:SDUwYRzksZ3Vcu7PTZxk+TEMF2f3gBiQEboKOhi1yfI= git.noahlan.cn/northlan/ntools-go/kafka v1.0.1/go.mod h1:RxX9JSUIr3Gbk+cvUwE5k+i08AgIK3TA9ayDJCMn2n8= git.noahlan.cn/northlan/ntools-go/uuid v1.0.0 h1:C0PazSzG3+e/Hfh2C6Qf8R46sNZmZKTOcWS990yUmrE= @@ -71,13 +69,26 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn github.com/alicebob/miniredis/v2 v2.17.0 h1:EwLdrIS50uczw71Jc7iVSxZluTKj5nfSP8n7ARRnJy0= github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= +github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= +github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= +github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= +github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -127,7 +138,9 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= @@ -146,6 +159,7 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -174,6 +188,7 @@ github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfC github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -261,14 +276,33 @@ github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplb github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= +github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -297,7 +331,11 @@ github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkr github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -315,6 +353,8 @@ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.4 h1:1kn4/7MepF/CHmYub99/nNX8az0IJjfSOU/jbnTVfqQ= github.com/klauspost/compress v1.15.4/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= +github.com/knadh/koanf v1.4.1/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -334,7 +374,9 @@ github.com/longzhiri/gozset v0.0.0-20210113140059-91f2d281daf1 h1:fCVAFg3S0Q/jm7 github.com/longzhiri/gozset v0.0.0-20210113140059-91f2d281daf1/go.mod h1:BlQbuXS7HqF9F+ZfnUG+GXrKndMZXa0xspzG/wY3IGk= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -343,7 +385,21 @@ github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/K github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -357,9 +413,11 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -377,6 +435,9 @@ github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/openzipkin/zipkin-go v0.3.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= github.com/openzipkin/zipkin-go v0.4.0 h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfUuBUUw= github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= @@ -387,6 +448,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -412,6 +474,7 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E= github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= @@ -420,6 +483,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -610,13 +675,16 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -672,6 +740,7 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -763,6 +832,7 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -794,9 +864,11 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20220422154200-b37d22cd5731 h1:nquqdM9+ps0JZcIiI70+tqoaIFS5Ql4ZuK8UXnz3HfE= google.golang.org/genproto v0.0.0-20220422154200-b37d22cd5731/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -829,6 +901,7 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -841,6 +914,7 @@ gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=