diff --git a/app/pb/mq/mq.proto b/app/pb/mq/mq.proto index f5a1b1a..c77c195 100644 --- a/app/pb/mq/mq.proto +++ b/app/pb/mq/mq.proto @@ -30,4 +30,13 @@ message MqGift { string giftName = 7; int64 totalCoin = 8; int64 sendTime = 9; +} + +// MqUserInfoUpdate 用户信息更新 +message MqUserInfoUpdate { + int64 userId = 1; // 用户ID +} + +// MqRankUpdate 排行榜更新 +message MqRankUpdate { } \ No newline at end of file diff --git a/app/user_center/genModel.bat b/app/user_center/genModel.bat index 7f6b8f4..4e39f1d 100644 --- a/app/user_center/genModel.bat +++ b/app/user_center/genModel.bat @@ -1,9 +1,7 @@ @echo off @echo ?????????????? -::set tables=user,user_platform -::set tables=rank_pvp -set tables=gift +set tables=user_check_in set targetDir=.\model set templateDir=..\..\doc\template diff --git a/app/user_center/model/user_check_in_model.go b/app/user_center/model/user_check_in_model.go new file mode 100644 index 0000000..3dba276 --- /dev/null +++ b/app/user_center/model/user_check_in_model.go @@ -0,0 +1,76 @@ +package model + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormc" + "github.com/jinzhu/now" + "gorm.io/gorm" + "time" +) + +var _ UserCheckInModel = (*customUserCheckInModel)(nil) + +type ( + // UserCheckInModel is an interface to be customized, add more methods here, + // and implement the added methods in customUserCheckInModel. + UserCheckInModel interface { + userCheckInModel + InsertTx(ctx context.Context, tx *gorm.DB, data *UserCheckIn) error + // FindThisWeek 查询用户本周签到记录 + FindThisWeek(ctx context.Context, tx *gorm.DB, userId int64) ([]UserCheckIn, error) + // CheckInToday 查询用户本日是否已签到 + CheckInToday(ctx context.Context, tx *gorm.DB, userId int64) (bool, error) + } + + customUserCheckInModel struct { + *defaultUserCheckInModel + } +) + +// NewUserCheckInModel returns a model for the database table. +func NewUserCheckInModel(conn *gorm.DB) UserCheckInModel { + return &customUserCheckInModel{ + defaultUserCheckInModel: newUserCheckInModel(conn), + } +} + +func (m *customUserCheckInModel) InsertTx(ctx context.Context, tx *gorm.DB, data *UserCheckIn) error { + err := withTx(ctx, m.conn, tx).Create(&data).Error + return err +} + +func (m *customUserCheckInModel) FindThisWeek(ctx context.Context, tx *gorm.DB, userId int64) ([]UserCheckIn, error) { + db := withTx(ctx, m.conn, tx) + // 取签到时间大于本周一的所有该用户签到记录,按签到时间升序排列 + var resp []UserCheckIn + err := db.Model(&UserCheckIn{}). + Where("user_id = ? AND check_in_time >= ", userId, now.Monday()). + Order("check_in_time ASC").Find(resp).Error + switch err { + case nil: + return resp, nil + case gormc.ErrNotFound: + return []UserCheckIn{}, nil + default: + return nil, err + } +} + +func (m *customUserCheckInModel) CheckInToday(ctx context.Context, tx *gorm.DB, userId int64) (bool, error) { + db := withTx(ctx, m.conn, tx) + n := time.Now() + + var count int64 + err := db.Table(m.table). + Where("user_id = ? AND check_in_time >= ? AND check_in_time <= ?", userId, now.With(n).BeginningOfDay(), now.With(n).EndOfDay()). + Count(&count). + Error + switch err { + case nil: + return count > 0, nil + case gormc.ErrNotFound: + return false, nil + default: + return false, err + } +} diff --git a/app/user_center/model/user_check_in_model_gen.go b/app/user_center/model/user_check_in_model_gen.go new file mode 100644 index 0000000..8704a41 --- /dev/null +++ b/app/user_center/model/user_check_in_model_gen.go @@ -0,0 +1,86 @@ +// Code generated by goctl. DO NOT EDIT! + +package model + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormc" + "strings" + "time" + + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stringx" + "gorm.io/gorm" +) + +var ( + userCheckInFieldNames = builder.RawFieldNames(&UserCheckIn{}) + userCheckInRows = strings.Join(userCheckInFieldNames, ",") + userCheckInRowsExpectAutoSet = strings.Join(stringx.Remove(userCheckInFieldNames, "`create_time`", "`update_time`"), ",") + userCheckInRowsWithPlaceHolder = strings.Join(stringx.Remove(userCheckInFieldNames, "`id`", "`create_time`", "`update_time`"), "=?,") + "=?" +) + +type ( + userCheckInModel interface { + Insert(ctx context.Context, data *UserCheckIn) error + FindOne(ctx context.Context, id int64) (*UserCheckIn, error) + Update(ctx context.Context, data *UserCheckIn) error + Delete(ctx context.Context, id int64) error + } + + defaultUserCheckInModel struct { + conn *gorm.DB + table string + } + + UserCheckIn struct { + Id int64 `gorm:"column:id;primaryKey"` // ID + UserId int64 `gorm:"column:user_id"` // 用户ID + CheckInTime time.Time `gorm:"column:check_in_time;default:null"` // 签到时间 + } +) + +func newUserCheckInModel(conn *gorm.DB) *defaultUserCheckInModel { + return &defaultUserCheckInModel{ + conn: conn, + table: "`user_check_in`", + } +} + +func (m *defaultUserCheckInModel) Insert(ctx context.Context, data *UserCheckIn) error { + err := m.conn.WithContext(ctx).Create(&data).Error + return err +} + +func (m *defaultUserCheckInModel) FindOne(ctx context.Context, id int64) (*UserCheckIn, error) { + var resp UserCheckIn + err := m.conn.WithContext(ctx).Model(&UserCheckIn{}).Where("`id` = ?", id).Take(&resp).Error + switch err { + case nil: + return &resp, nil + case gormc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} + +func (m *defaultUserCheckInModel) Update(ctx context.Context, data *UserCheckIn) error { + err := m.conn.WithContext(ctx).Save(data).Error + return err +} + +func (m *defaultUserCheckInModel) Delete(ctx context.Context, id int64) error { + err := m.conn.WithContext(ctx).Delete(&UserCheckIn{}, id).Error + + return err +} + +func (m *defaultUserCheckInModel) tableName() string { + return m.table +} + +func (UserCheckIn) TableName() string { + model := newUserCheckInModel(nil) + return model.tableName() +} diff --git a/app/user_center/model/user_integral_model.go b/app/user_center/model/user_integral_model.go index 3c1b636..912c34d 100644 --- a/app/user_center/model/user_integral_model.go +++ b/app/user_center/model/user_integral_model.go @@ -6,6 +6,7 @@ import ( "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormc" "github.com/pkg/errors" "gorm.io/gorm" + "live-service/common/nerr" ) var _ UserIntegralModel = (*customUserIntegralModel)(nil) @@ -19,6 +20,8 @@ type ( InsertTx(ctx context.Context, tx *gorm.DB, data *UserIntegral) error UpdateIntegralTx(ctx context.Context, tx *gorm.DB, userId, addon int64) error FindIntegral(ctx context.Context, tx *gorm.DB, userId int64) (int64, error) + // ChangeIntegral 用户积分变动 + ChangeIntegral(ctx context.Context, tx *gorm.DB, userId int64, change int64) (int64, error) } customUserIntegralModel struct { @@ -74,3 +77,36 @@ func (m *customUserIntegralModel) FindIntegral(ctx context.Context, tx *gorm.DB, return 0, err } } + +func (m *customUserIntegralModel) ChangeIntegral(ctx context.Context, tx *gorm.DB, userId int64, change int64) (int64, error) { + resp := change + err := withTx(ctx, m.conn, tx).Transaction(func(tx *gorm.DB) error { + integral, err := m.FindIntegral(ctx, tx, userId) + if err != nil { + if errors.Is(err, ErrNotFound) { + if change < 0 { + return nerr.NewWithCode(nerr.UserIntegralNotEnoughError) + } + // 用户积分记录不存在,进行插入 + if err = m.InsertTx(ctx, tx, &UserIntegral{ + UserId: userId, + Integral: change, + }); err != nil { + return errors.Wrap(err, "插入用户积分失败") + } + return nil + } else { + return errors.Wrap(err, "获取当前用户积分失败") + } + } + if integral+change < 0 { + return errors.New("用户积分不足") + } + if err = m.UpdateIntegralTx(ctx, tx, userId, integral+change); err != nil { + return errors.Wrap(err, "更新用户积分失败") + } + resp = integral + change + return nil + }) + return resp, err +} diff --git a/app/user_center/model/user_model.go b/app/user_center/model/user_model.go index 7a397ce..b78e4f8 100644 --- a/app/user_center/model/user_model.go +++ b/app/user_center/model/user_model.go @@ -13,6 +13,7 @@ type ( // and implement the added methods in customUserModel. UserModel interface { userModel + Transact(ctx context.Context, tx *gorm.DB, fn func(tx *gorm.DB) error) error // InsertTx 插入事务 InsertTx(ctx context.Context, tx *gorm.DB, data *User) error FindOneTx(ctx context.Context, tx *gorm.DB, id int64) (*User, error) @@ -30,6 +31,10 @@ func NewUserModel(conn *gorm.DB) UserModel { } } +func (m *customUserModel) Transact(ctx context.Context, tx *gorm.DB, fn func(tx *gorm.DB) error) error { + return withTx(ctx, m.conn, tx).Transaction(fn) +} + func (m *customUserModel) InsertTx(ctx context.Context, tx *gorm.DB, data *User) error { return withTx(ctx, m.conn, tx).Create(data).Error } diff --git a/app/user_center/rpc/etc/user_center-dev.yaml b/app/user_center/rpc/etc/user_center-dev.yaml index 374a503..467afe6 100644 --- a/app/user_center/rpc/etc/user_center-dev.yaml +++ b/app/user_center/rpc/etc/user_center-dev.yaml @@ -4,7 +4,7 @@ Timeout: 5000 Etcd: Hosts: - 127.0.0.1:2379 - Key: usercenter.rpc.v2.dev + Key: usercenter.rpc.dev Timeout: 5000 # default is 2000 NonBlock: true Log: @@ -14,6 +14,13 @@ Log: 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: + Addr: [ "127.0.0.1:9093" ] + Topic: "notify-user" + RankUpdate: + Addr: [ "127.0.0.1:9093" ] + Topic: "rank-update" UserRetriever: Enabled: false UpdateDuration: 720 # 720 hours = 30 Day = 1 Month @@ -37,6 +44,15 @@ GiftCollector: Cron: CollectGift: "0 0 0/6 * * ?" # 每隔6小时执行一次 Integral: + # 签到积分配置 + CheckIn: + # 签到积分 一周 0(周日) 1 2 3 4 5 6 + Points: [ 10000,2500,2500,3500,5000,6500,8000 ] + Critical: 0.15 # 签到积分暴击率 + CriticalRadio: [ 1.0, 1.0, 1.2, 1.5, 1.8 ] # 暴击倍率 + BattleReport: + WinRadio: 0.02 # 伤害量 1/50 + LostRadio: 0.008 # 伤害量 1/120 # RMB到积分的转换 RMBToIntegral: 1000 # 平台礼物到RMB的转换 @@ -44,4 +60,4 @@ Integral: bilibili: 0.001 # 平台免费礼物到积分的转换 FreeToIntegral: - bilibili: 0.0001 \ No newline at end of file + bilibili: 0.00025 \ No newline at end of file diff --git a/app/user_center/rpc/etc/user_center.yaml b/app/user_center/rpc/etc/user_center.yaml index abe990d..f986570 100644 --- a/app/user_center/rpc/etc/user_center.yaml +++ b/app/user_center/rpc/etc/user_center.yaml @@ -4,7 +4,7 @@ Timeout: 5000 Etcd: Hosts: - 127.0.0.1:2379 - Key: usercenter.rpc.v2 + Key: usercenter.rpc Timeout: 5000 # default is 2000 NonBlock: true Log: @@ -14,6 +14,13 @@ Log: 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: + Addr: [ "127.0.0.1:9093" ] + Topic: "notify-user" + RankUpdate: + Addr: [ "127.0.0.1:9093" ] + Topic: "rank-update" UserRetriever: Enabled: true UpdateDuration: 720 # 720 hours = 30 Day = 1 Month @@ -37,6 +44,15 @@ GiftCollector: Cron: CollectGift: "0 0 0/6 * * ?" # 每隔6小时执行一次 Integral: + # 签到积分配置 + CheckIn: + # 签到积分 一周 0(周日) 1 2 3 4 5 6 + Points: [ 10000,2500,2500,3500,5000,6500,8000 ] + Critical: 0.15 # 签到积分暴击率 + CriticalRadio: [ 1.0, 1.0, 1.2, 1.5, 1.8 ] # 暴击倍率 + BattleReport: + WinRadio: 0.02 # 伤害量 1/50 + LostRadio: 0.008 # 伤害量 1/120 # RMB到积分的转换 RMBToIntegral: 1000 # 平台礼物到RMB的转换 @@ -44,4 +60,4 @@ Integral: bilibili: 0.001 # 平台免费礼物到积分的转换 FreeToIntegral: - bilibili: 0.0001 \ No newline at end of file + bilibili: 0.00025 \ No newline at end of file diff --git a/app/user_center/rpc/internal/config/config.go b/app/user_center/rpc/internal/config/config.go index 091895d..3a90a27 100644 --- a/app/user_center/rpc/internal/config/config.go +++ b/app/user_center/rpc/internal/config/config.go @@ -6,13 +6,10 @@ import ( ) type ( - /* - Kafka struct { - Addr []string - Topic string - ConsumerGroupId string - } - */ + Kafka struct { + Addr []string // 连接地址 + Topic string + } // Config 配置 Config struct { @@ -21,7 +18,11 @@ type ( DB struct { DataSource string } - + // Kafka 消息队列配置 + Kafka struct { + UserNotify Kafka // 用户信息通知队列 + RankUpdate Kafka // 排行榜更新通知队列 + } UserRetriever struct { Enabled bool // 是否开启 UpdateDuration int64 // 用户信息更新最短间隔 单位 h @@ -37,7 +38,6 @@ type ( TopListApi string } } - Rank struct { Enabled bool // 是否开启 Cron struct { @@ -45,7 +45,6 @@ type ( Persistence string // 持久化 } } - GiftCollector struct { Enabled bool // 是否开启 Platforms []string // 需搜集的平台 @@ -54,6 +53,17 @@ type ( } } Integral struct { + // CheckIn 签到 + CheckIn struct { + Points []int64 // 签到积分 次数分数 + Critical float32 // 暴击率(百分比) + CriticalRadio []float32 // 暴击倍数 + } + // 战局积分 + BattleReport struct { + WinRadio float64 // 获胜方积分因子 乘法 + LostRadio float64 // 失败方积分因子 乘法 + } RMBToIntegral float64 // RMB到积分的转换 GiftToRMB map[string]float64 // 平台礼物到RMB的转换 FreeToIntegral map[string]float64 // 平台免费礼物到积分的转换 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 b81efe5..541b11d 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 @@ -6,7 +6,6 @@ import ( "live-service/app/user_center/model" "live-service/app/user_center/rpc/internal/logic/gift_collect" "live-service/app/user_center/rpc/internal/logic/integral" - "live-service/app/user_center/rpc/internal/logic/platform_user" "live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/pb" "strconv" @@ -32,25 +31,12 @@ func NewUserSendGiftLogic(ctx context.Context, svcCtx *svc.ServiceContext) *User // 1. 记录用户赠送信息 // 2. 新增用户积分 func (l *UserSendGiftLogic) UserSendGift(in *pb.UserSendGiftReq) (*pb.UserSendGiftResp, error) { - // 首先获取用户id - var err error - sysUser, err := platform_user.NewRetrievePlatformUserLogic(l.ctx, l.svcCtx).RetrievePlatformUser(&pb.PlatformUserReq{ - Platform: in.Platform, - PUid: in.PUid, - }) - if err != nil { - return nil, err - } - - resp := &pb.UserSendGiftResp{ - User: sysUser.User, - } - + resp := &pb.UserSendGiftResp{} // 记录送礼信息 { dbUserGift := &model.UserGift{ Id: uuid.NextId(), - UserId: sysUser.User.Id, + UserId: in.UserId, Platform: in.Platform, RoomId: in.RoomId, GiftId: strconv.FormatInt(in.GiftId, 10), @@ -62,23 +48,22 @@ func (l *UserSendGiftLogic) UserSendGift(in *pb.UserSendGiftReq) (*pb.UserSendGi } else { dbUserGift.FreePrice = in.Price } - if err = l.svcCtx.UserGiftModel.Insert(l.ctx, dbUserGift); err != nil { - l.Logger.Errorf("记录用户[%d]送礼信息 [%d:%s:%d] 失败,操作继续...", sysUser.User.Id, in.GiftId, in.GiftName, in.Num) + if err := l.svcCtx.UserGiftModel.Insert(l.ctx, dbUserGift); err != nil { + l.Logger.Errorf("记录用户[%d]送礼信息 [%d:%s:%d] 失败,操作继续...", in.UserId, in.GiftId, in.GiftName, in.Num) } } // 积分 { - // 待增加的积分 + // 计算积分 addonIntegral := calcIntegral(l.svcCtx.Config, 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) } } - newIntegral, err := integral.NewChangeIntegralLogic(l.ctx, l.svcCtx).ChangeIntegral(&pb.ChangeIntegralReq{ - UserId: sysUser.User.Id, + UserId: in.UserId, Change: addonIntegral, }) if err != nil { @@ -86,6 +71,5 @@ func (l *UserSendGiftLogic) UserSendGift(in *pb.UserSendGiftReq) (*pb.UserSendGi } resp.Integral = newIntegral } - return resp, nil } 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 index 414bb26..900d67b 100644 --- a/app/user_center/rpc/internal/logic/integral/change_integral_logic.go +++ b/app/user_center/rpc/internal/logic/integral/change_integral_logic.go @@ -3,8 +3,6 @@ package integral import ( "context" "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" @@ -29,41 +27,9 @@ func NewChangeIntegralLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ch // ChangeIntegral 新增用户积分 func (l *ChangeIntegralLogic) ChangeIntegral(in *pb.ChangeIntegralReq) (*pb.ChangeIntegralResp, error) { - if err := l.svcCtx.UserIntegralModel.Transact(l.ctx, nil, func(tx *gorm.DB) error { - integral, err := l.svcCtx.UserIntegralModel.FindIntegral(l.ctx, tx, in.UserId) - if err != nil { - if errors.Is(err, model.ErrNotFound) { - if in.Change < 0 { - return errors.New("用户积分不足") - } - // 用户积分记录不存在,进行插入 - if err = l.svcCtx.UserIntegralModel.InsertTx(l.ctx, tx, &model.UserIntegral{ - UserId: in.UserId, - Integral: in.Change, - }); err != nil { - return errors.Wrap(err, "插入用户积分失败") - } - return nil - } else { - return errors.Wrap(err, "获取当前用户积分失败") - } - } - if integral+in.Change < 0 { - return errors.New("用户积分不足") - } - - if err = l.svcCtx.UserIntegralModel.UpdateIntegralTx(l.ctx, tx, in.UserId, integral+in.Change); err != nil { - return errors.Wrap(err, "更新用户积分失败") - } - return nil - }); err != nil { - return nil, errors.Wrapf(nerr.NewWithErr(err), "记录积分-事务执行失败, err:%+v", err) - } - - // 查询当前用户积分 - integral, err := l.svcCtx.UserIntegralModel.FindIntegral(l.ctx, nil, in.UserId) + integral, err := l.svcCtx.UserIntegralModel.ChangeIntegral(l.ctx, nil, in.UserId, in.Change) if err != nil { - return nil, errors.Wrapf(nerr.NewWithMsg("查询用户积分失败"), "查询用户积分失败, err:%+v", err) + return nil, errors.Wrapf(nerr.NewWithErr(err), "记录积分-事务执行失败, err:%+v", err) } return &pb.ChangeIntegralResp{ 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 index c83f62e..5b93aa7 100644 --- 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 @@ -26,7 +26,7 @@ func NewGetUserIntegralLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G } // GetUserIntegral 获取用户积分 -func (l *GetUserIntegralLogic) GetUserIntegral(in *pb.UserIdResp) (*pb.UserIntegralResp, error) { +func (l *GetUserIntegralLogic) GetUserIntegral(in *pb.UserIdReq) (*pb.UserIntegralResp, error) { // 查询当前用户积分 integral, err := l.svcCtx.UserIntegralModel.FindIntegral(l.ctx, nil, in.UserId) if err != 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 322b321..7275995 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 @@ -83,7 +83,7 @@ func (r *UserRetriever) retrieveNobility(platform ...string) { if handle, ok := r.nobilityMapper[plat]; ok { list, err := handle(r.svcCtx) if err != nil { - r.Logger.Errorf("获取贵族列表失败, err: %+v\n", err) + r.Logger.Errorf("获取贵族列表失败, err: %v\n", err) return } for _, data := range list { @@ -128,7 +128,7 @@ func (r *UserRetriever) retrieveList(list []model.UserPlatform) { func (r *UserRetriever) retrieveUser(platform, pUid string) *PlatformUser { if handle, ok := r.platformRetrieverMapper[platform]; ok { if p, err := handle(pUid); err != nil { - r.Logger.Errorf("获取平台用户信息错误: err: %s\n", err.Error()) + //r.Logger.Errorf("获取平台用户信息错误: err: %s\n", err.Error()) } else { return p } 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 6c8b39a..d4c5e92 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 @@ -8,7 +8,6 @@ import ( "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" ) type StatPvpReportLogic struct { @@ -25,47 +24,87 @@ func NewStatPvpReportLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Sta } } -func (l *StatPvpReportLogic) StatPvpReport(in *pb.StatPvPReportReq) (*pb.Empty, error) { - // 虚拟UID - if in.GeneralUid <= 0 { - return &pb.Empty{}, nil - } - - err := l.svcCtx.StatisticsPvpModel.Transaction(l.ctx, nil, func(tx *gorm.DB) error { - // 名将 - if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, in.GeneralUid, - &model.UpdateRecordProps{General: true}); err != nil { - if errors.Is(err, model.ErrRowsAffectedZero) { - // insert - if err = l.svcCtx.StatisticsPvpModel.InsertTx(l.ctx, tx, &model.StatisticsPvp{ - UserId: in.GeneralUid, - GeneralCount: 1, - }); err != nil { - return errors.Wrapf(err, ErrInsertErr, err) +func (l *StatPvpReportLogic) StatPvpReport(in *pb.StatPvPReportReq) (*pb.StatPvPReportResp, error) { + resp := &pb.StatPvPReportResp{} + // 名将记录 + { + if in.GeneralUid > 0 { + if err := l.svcCtx.Db.Transaction(func(tx *gorm.DB) error { + if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, in.GeneralUid, + &model.UpdateRecordProps{General: true}); err != nil { + if errors.Is(err, model.ErrRowsAffectedZero) { + // insert + if err = l.svcCtx.StatisticsPvpModel.InsertTx(l.ctx, tx, &model.StatisticsPvp{ + UserId: in.GeneralUid, + GeneralCount: 1, + }); err != nil { + return errors.Wrapf(err, ErrInsertErr, err) + } + } else { + return errors.Wrapf(err, ErrUpdateErr, err) + } } - } else { - return errors.Wrapf(err, ErrUpdateErr, err) + return nil + }); err != nil { + l.Logger.Errorf("PvP名将记录事务执行失败, err:%v", err) } } + } + // 玩家记录 + { // 获胜记录 - if err := l.reports(tx, true, in.WinItems); err != nil { - return errors.Wrapf(err, "获胜PvP记录失败: %+v", err) + if err := l.reports(true, in.WinItems); err != nil { + l.Logger.Errorf("获胜PvP记录失败, err:%v", err) } // 战败记录 - if err := l.reports(tx, false, in.LostItems); err != nil { - return errors.Wrapf(err, "获胜PvP记录失败: %+v", err) + if err := l.reports(false, in.LostItems); err != nil { + l.Logger.Errorf("战败PvP记录失败, err:%v", err) } - return nil - }) + } + // 积分记录 + { + winItemResp := make([]*pb.StatPvPReportResp_Item, 0, len(in.WinItems)) + lostItemResp := make([]*pb.StatPvPReportResp_Item, 0, len(in.LostItems)) - if err != nil { - return nil, errors.Wrapf(nerr.NewWithCode(nerr.DBError), "PvP战报-事务执行失败 err: %+v", err) + battleReportCfg := l.svcCtx.Config.Integral.BattleReport + if err := l.svcCtx.Db.Transaction(func(tx *gorm.DB) error { + for _, item := range in.WinItems { + uid, damage := item.Uid, item.Damage + addIntegral := int64(float64(damage) * battleReportCfg.WinRadio) + _, err := l.svcCtx.UserIntegralModel.ChangeIntegral(l.ctx, tx, uid, addIntegral) + if err != nil { + return err + } + winItemResp = append(winItemResp, &pb.StatPvPReportResp_Item{ + Uid: uid, + AddonIntegral: addIntegral, + }) + } + for _, item := range in.LostItems { + uid, damage := item.Uid, item.Damage + addIntegral := int64(float64(damage) * battleReportCfg.LostRadio) + _, err := l.svcCtx.UserIntegralModel.ChangeIntegral(l.ctx, tx, uid, addIntegral) + if err != nil { + return err + } + lostItemResp = append(winItemResp, &pb.StatPvPReportResp_Item{ + Uid: uid, + AddonIntegral: addIntegral, + }) + } + return nil + }); err != nil { + l.Logger.Errorf("战局积分计算失败, err:%v", err) + } + resp.WinItems = winItemResp + resp.LostItems = lostItemResp } - return &pb.Empty{}, nil + l.Logger.Info("PvP战报,记录成功...") + return resp, nil } -func (l *StatPvpReportLogic) reports(tx *gorm.DB, win bool, items []*pb.StatPvPReportReq_Item) error { - return l.svcCtx.StatisticsPvpModel.Transaction(l.ctx, tx, func(tx *gorm.DB) error { +func (l *StatPvpReportLogic) reports(win bool, items []*pb.StatPvPReportReq_Item) error { + return l.svcCtx.Db.Transaction(func(tx *gorm.DB) error { for _, item := range items { if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, item.Uid, &model.UpdateRecordProps{ diff --git a/app/user_center/rpc/internal/logic/platform_user/get_user_id_by_p_uid_logic.go b/app/user_center/rpc/internal/logic/user/get_user_id_by_p_uid_logic.go similarity index 97% rename from app/user_center/rpc/internal/logic/platform_user/get_user_id_by_p_uid_logic.go rename to app/user_center/rpc/internal/logic/user/get_user_id_by_p_uid_logic.go index 5f8ef08..0c9ed52 100644 --- a/app/user_center/rpc/internal/logic/platform_user/get_user_id_by_p_uid_logic.go +++ b/app/user_center/rpc/internal/logic/user/get_user_id_by_p_uid_logic.go @@ -1,4 +1,4 @@ -package platform_user +package user import ( "context" diff --git a/app/user_center/rpc/internal/logic/platform_user/retrieve_platform_user_logic.go b/app/user_center/rpc/internal/logic/user/retrieve_platform_user_logic.go similarity index 99% rename from app/user_center/rpc/internal/logic/platform_user/retrieve_platform_user_logic.go rename to app/user_center/rpc/internal/logic/user/retrieve_platform_user_logic.go index 3b04269..d837a26 100644 --- a/app/user_center/rpc/internal/logic/platform_user/retrieve_platform_user_logic.go +++ b/app/user_center/rpc/internal/logic/user/retrieve_platform_user_logic.go @@ -1,4 +1,4 @@ -package platform_user +package user import ( "context" 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 new file mode 100644 index 0000000..f1b021e --- /dev/null +++ b/app/user_center/rpc/internal/logic/user/user_check_in_logic.go @@ -0,0 +1,106 @@ +package user + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/uuid" + "github.com/pkg/errors" + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/gorm" + "live-service/app/user_center/model" + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + "math/rand" + "time" +) + +type UserCheckInLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUserCheckInLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserCheckInLogic { + return &UserCheckInLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +const ( + MsgAlreadyCheckIn = "今天已打过卡了!" + MsgCheckInSuccess = "打卡成功,哔哩哔哩 (゜-゜)つロ 干杯" +) + +var ( + ErrAlreadyCheckIn = errors.New(MsgAlreadyCheckIn) +) + +// UserCheckIn 用户签到|打卡 +func (l *UserCheckInLogic) UserCheckIn(in *pb.UserIdReq) (*pb.UserCheckInResp, error) { + resp := &pb.UserCheckInResp{ + Success: false, + Msg: "", + IntegralChange: 0, + Integral: 0, + 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 + } + if isCheckInToday { + return ErrAlreadyCheckIn + } + // 打卡记录 + if err = l.svcCtx.UserCheckInModel.InsertTx(l.ctx, tx, &model.UserCheckIn{ + Id: uuid.NextId(), + UserId: in.UserId, + CheckInTime: time.Now(), + }); err != nil { + return err + } + + // 积分记录,计算当日可得积分 + change, critical := l.getCriticalPoint() + if resp.Integral, err = l.svcCtx.UserIntegralModel.ChangeIntegral(l.ctx, tx, in.UserId, change); err != nil { + return err + } + + resp.IsCritical = critical + resp.IntegralChange = change + resp.Msg = MsgCheckInSuccess + resp.Success = true + + return nil + }); err != nil { + if errors.Is(err, ErrAlreadyCheckIn) { + resp.Msg = MsgAlreadyCheckIn + return resp, nil + } + return nil, err + } + return resp, nil +} + +func (l *UserCheckInLogic) getCriticalPoint() (int64, bool) { + checkInCfg := l.svcCtx.Config.Integral.CheckIn + nt := time.Now() + weekDay := int(nt.Weekday()) + point := checkInCfg.Points[weekDay] + + rand.Seed(nt.UnixNano()) + isCritical := rand.Float32() <= checkInCfg.Critical + var radio float32 + if len(checkInCfg.CriticalRadio) == 0 { + radio = 1 + } else { + radio = checkInCfg.CriticalRadio[rand.Intn(len(checkInCfg.CriticalRadio))] + } + if isCritical { + return int64(float32(point) * radio), isCritical + } else { + return point, isCritical + } +} 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 40f57f9..f1ca712 100644 --- a/app/user_center/rpc/internal/server/user_center_server.go +++ b/app/user_center/rpc/internal/server/user_center_server.go @@ -7,9 +7,9 @@ import ( "context" "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/platform_user" "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/svc" "live-service/app/user_center/rpc/pb" @@ -28,13 +28,13 @@ func NewUserCenterServer(svcCtx *svc.ServiceContext) *UserCenterServer { // retrievePlatformUser 新增或获取用户 func (s *UserCenterServer) RetrievePlatformUser(ctx context.Context, in *pb.PlatformUserReq) (*pb.PlatformUserResp, error) { - l := platform_user.NewRetrievePlatformUserLogic(ctx, s.svcCtx) + l := user.NewRetrievePlatformUserLogic(ctx, s.svcCtx) return l.RetrievePlatformUser(in) } // getUserIdByPUid 通过平台用户id获取系统用户ID func (s *UserCenterServer) GetUserIdByPUid(ctx context.Context, in *pb.PlatformUserReq) (*pb.UserIdResp, error) { - l := platform_user.NewGetUserIdByPUidLogic(ctx, s.svcCtx) + l := user.NewGetUserIdByPUidLogic(ctx, s.svcCtx) return l.GetUserIdByPUid(in) } @@ -45,11 +45,17 @@ func (s *UserCenterServer) ChangeIntegral(ctx context.Context, in *pb.ChangeInte } // GetUserIntegral 获取用户积分 -func (s *UserCenterServer) GetUserIntegral(ctx context.Context, in *pb.UserIdResp) (*pb.UserIntegralResp, error) { +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) +} + // UserSendGift 用户赠送礼物 func (s *UserCenterServer) UserSendGift(ctx context.Context, in *pb.UserSendGiftReq) (*pb.UserSendGiftResp, error) { l := gift.NewUserSendGiftLogic(ctx, s.svcCtx) @@ -71,7 +77,7 @@ func (s *UserCenterServer) StatPvpFirstBlood(ctx context.Context, in *pb.StatPvP return l.StatPvpFirstBlood(in) } -func (s *UserCenterServer) StatPvpReport(ctx context.Context, in *pb.StatPvPReportReq) (*pb.Empty, error) { +func (s *UserCenterServer) StatPvpReport(ctx context.Context, in *pb.StatPvPReportReq) (*pb.StatPvPReportResp, error) { l := statistics.NewStatPvpReportLogic(ctx, s.svcCtx) return l.StatPvpReport(in) } diff --git a/app/user_center/rpc/internal/svc/service_context.go b/app/user_center/rpc/internal/svc/service_context.go index b49bf43..a3eb5e3 100644 --- a/app/user_center/rpc/internal/svc/service_context.go +++ b/app/user_center/rpc/internal/svc/service_context.go @@ -13,12 +13,14 @@ import ( type ServiceContext struct { Config config.Config + Db *gorm.DB UserModel model.UserModel UserPlatformModel model.UserPlatformModel UserGiftModel model.UserGiftModel UserIntegralModel model.UserIntegralModel UserNobilityModel model.UserNobilityModel + UserCheckInModel model.UserCheckInModel StatisticsPvpModel model.StatisticsPvpModel RankPvpModel model.RankPvpModel @@ -43,11 +45,13 @@ func NewServiceContext(c config.Config) *ServiceContext { } return &ServiceContext{ Config: c, + Db: gormDb, UserModel: model.NewUserModel(gormDb), UserPlatformModel: model.NewUserPlatformModel(gormDb), UserGiftModel: model.NewUserGiftModel(gormDb), UserIntegralModel: model.NewUserIntegralModel(gormDb), UserNobilityModel: model.NewUserNobilityModel(gormDb), + UserCheckInModel: model.NewUserCheckInModel(gormDb), StatisticsPvpModel: model.NewStatisticsPvpModel(gormDb), RankPvpModel: model.NewRankPvpModel(gormDb), GiftModel: model.NewGiftModel(gormDb), diff --git a/app/user_center/rpc/pb/user_center.pb.go b/app/user_center/rpc/pb/user_center.pb.go index 74154a8..ec1bce8 100644 --- a/app/user_center/rpc/pb/user_center.pb.go +++ b/app/user_center/rpc/pb/user_center.pb.go @@ -266,6 +266,55 @@ func (x *PlatformUserResp) GetUser() *User { return nil } +// 用户ID请求 +type UserIdReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` +} + +func (x *UserIdReq) Reset() { + *x = UserIdReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserIdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserIdReq) ProtoMessage() {} + +func (x *UserIdReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_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 UserIdReq.ProtoReflect.Descriptor instead. +func (*UserIdReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{4} +} + +func (x *UserIdReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +// 用户ID回复 type UserIdResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -277,7 +326,7 @@ type UserIdResp struct { func (x *UserIdResp) Reset() { *x = UserIdResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[4] + mi := &file_user_center_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -290,7 +339,7 @@ func (x *UserIdResp) String() string { func (*UserIdResp) ProtoMessage() {} func (x *UserIdResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[4] + mi := &file_user_center_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -303,7 +352,7 @@ func (x *UserIdResp) ProtoReflect() protoreflect.Message { // Deprecated: Use UserIdResp.ProtoReflect.Descriptor instead. func (*UserIdResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{4} + return file_user_center_proto_rawDescGZIP(), []int{5} } func (x *UserIdResp) GetUserId() int64 { @@ -313,6 +362,7 @@ func (x *UserIdResp) GetUserId() int64 { return 0 } +// 变更积分请求 type ChangeIntegralReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -325,7 +375,7 @@ type ChangeIntegralReq struct { func (x *ChangeIntegralReq) Reset() { *x = ChangeIntegralReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[5] + mi := &file_user_center_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -338,7 +388,7 @@ func (x *ChangeIntegralReq) String() string { func (*ChangeIntegralReq) ProtoMessage() {} func (x *ChangeIntegralReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[5] + mi := &file_user_center_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -351,7 +401,7 @@ func (x *ChangeIntegralReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeIntegralReq.ProtoReflect.Descriptor instead. func (*ChangeIntegralReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{5} + return file_user_center_proto_rawDescGZIP(), []int{6} } func (x *ChangeIntegralReq) GetUserId() int64 { @@ -368,6 +418,7 @@ func (x *ChangeIntegralReq) GetChange() int64 { return 0 } +// 变更积分回复 type ChangeIntegralResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -381,7 +432,7 @@ type ChangeIntegralResp struct { func (x *ChangeIntegralResp) Reset() { *x = ChangeIntegralResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[6] + mi := &file_user_center_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -394,7 +445,7 @@ func (x *ChangeIntegralResp) String() string { func (*ChangeIntegralResp) ProtoMessage() {} func (x *ChangeIntegralResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[6] + mi := &file_user_center_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -407,7 +458,7 @@ func (x *ChangeIntegralResp) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeIntegralResp.ProtoReflect.Descriptor instead. func (*ChangeIntegralResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{6} + return file_user_center_proto_rawDescGZIP(), []int{7} } func (x *ChangeIntegralResp) GetUserId() int64 { @@ -431,6 +482,7 @@ func (x *ChangeIntegralResp) GetIntegral() int64 { return 0 } +// 用户积分回复 type UserIntegralResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -443,7 +495,7 @@ type UserIntegralResp struct { func (x *UserIntegralResp) Reset() { *x = UserIntegralResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[7] + mi := &file_user_center_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -456,7 +508,7 @@ func (x *UserIntegralResp) String() string { func (*UserIntegralResp) ProtoMessage() {} func (x *UserIntegralResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[7] + mi := &file_user_center_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -469,7 +521,7 @@ func (x *UserIntegralResp) ProtoReflect() protoreflect.Message { // Deprecated: Use UserIntegralResp.ProtoReflect.Descriptor instead. func (*UserIntegralResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{7} + return file_user_center_proto_rawDescGZIP(), []int{8} } func (x *UserIntegralResp) GetUserId() int64 { @@ -486,25 +538,107 @@ func (x *UserIntegralResp) GetIntegral() int64 { return 0 } +// 用户打卡(签到)回复 +type UserCheckInResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,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"` // 是否发生了暴击奖励 +} + +func (x *UserCheckInResp) Reset() { + *x = UserCheckInResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserCheckInResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserCheckInResp) ProtoMessage() {} + +func (x *UserCheckInResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[9] + 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 UserCheckInResp.ProtoReflect.Descriptor instead. +func (*UserCheckInResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{9} +} + +func (x *UserCheckInResp) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *UserCheckInResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *UserCheckInResp) GetIntegralChange() int64 { + if x != nil { + return x.IntegralChange + } + return 0 +} + +func (x *UserCheckInResp) GetIntegral() int64 { + if x != nil { + return x.Integral + } + return 0 +} + +func (x *UserCheckInResp) GetIsCritical() bool { + if x != nil { + return x.IsCritical + } + return false +} + +// 用户送礼请求 type UserSendGiftReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` // 平台 - PUid string `protobuf:"bytes,2,opt,name=pUid,proto3" json:"pUid,omitempty"` // 平台用户ID - RoomId string `protobuf:"bytes,3,opt,name=roomId,proto3" json:"roomId,omitempty"` // 直播间ID - GiftId int64 `protobuf:"varint,4,opt,name=giftId,proto3" json:"giftId,omitempty"` // 礼物ID - GiftName string `protobuf:"bytes,5,opt,name=giftName,proto3" json:"giftName,omitempty"` // 礼物名 - Num int64 `protobuf:"varint,6,opt,name=num,proto3" json:"num,omitempty"` // 赠送数量 - Price int64 `protobuf:"varint,7,opt,name=price,proto3" json:"price,omitempty"` // 礼物单价(系统不存在对应礼物数据时使用) - IsPaid bool `protobuf:"varint,8,opt,name=isPaid,proto3" json:"isPaid,omitempty"` // 是否收费礼物 + UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` // 系统用户ID + PUid string `protobuf:"bytes,3,opt,name=pUid,proto3" json:"pUid,omitempty"` // 平台用户ID + RoomId string `protobuf:"bytes,4,opt,name=roomId,proto3" json:"roomId,omitempty"` // 直播间ID + GiftId int64 `protobuf:"varint,5,opt,name=giftId,proto3" json:"giftId,omitempty"` // 礼物ID + GiftName string `protobuf:"bytes,6,opt,name=giftName,proto3" json:"giftName,omitempty"` // 礼物名 + Num int64 `protobuf:"varint,7,opt,name=num,proto3" json:"num,omitempty"` // 赠送数量 + Price int64 `protobuf:"varint,8,opt,name=price,proto3" json:"price,omitempty"` // 礼物单价(系统不存在对应礼物数据时使用) + IsPaid bool `protobuf:"varint,9,opt,name=isPaid,proto3" json:"isPaid,omitempty"` // 是否收费礼物 } func (x *UserSendGiftReq) Reset() { *x = UserSendGiftReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[8] + mi := &file_user_center_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -517,7 +651,7 @@ func (x *UserSendGiftReq) String() string { func (*UserSendGiftReq) ProtoMessage() {} func (x *UserSendGiftReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[8] + mi := &file_user_center_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -530,7 +664,7 @@ func (x *UserSendGiftReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UserSendGiftReq.ProtoReflect.Descriptor instead. func (*UserSendGiftReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{8} + return file_user_center_proto_rawDescGZIP(), []int{10} } func (x *UserSendGiftReq) GetPlatform() string { @@ -540,6 +674,13 @@ func (x *UserSendGiftReq) GetPlatform() string { return "" } +func (x *UserSendGiftReq) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + func (x *UserSendGiftReq) GetPUid() string { if x != nil { return x.PUid @@ -589,19 +730,19 @@ func (x *UserSendGiftReq) GetIsPaid() bool { return false } +// 用户送礼回复 type UserSendGiftResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // 系统用户信息 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[9] + mi := &file_user_center_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -614,7 +755,7 @@ func (x *UserSendGiftResp) String() string { func (*UserSendGiftResp) ProtoMessage() {} func (x *UserSendGiftResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[9] + mi := &file_user_center_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -627,14 +768,7 @@ func (x *UserSendGiftResp) ProtoReflect() protoreflect.Message { // Deprecated: Use UserSendGiftResp.ProtoReflect.Descriptor instead. func (*UserSendGiftResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{9} -} - -func (x *UserSendGiftResp) GetUser() *User { - if x != nil { - return x.User - } - return nil + return file_user_center_proto_rawDescGZIP(), []int{11} } func (x *UserSendGiftResp) GetIntegral() *ChangeIntegralResp { @@ -644,6 +778,7 @@ func (x *UserSendGiftResp) GetIntegral() *ChangeIntegralResp { return nil } +// 用户购买舰长请求 type UserBuyNobilityReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -664,7 +799,7 @@ type UserBuyNobilityReq struct { func (x *UserBuyNobilityReq) Reset() { *x = UserBuyNobilityReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[10] + mi := &file_user_center_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -677,7 +812,7 @@ func (x *UserBuyNobilityReq) String() string { func (*UserBuyNobilityReq) ProtoMessage() {} func (x *UserBuyNobilityReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[10] + mi := &file_user_center_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -690,7 +825,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{10} + return file_user_center_proto_rawDescGZIP(), []int{12} } func (x *UserBuyNobilityReq) GetPlatform() string { @@ -763,6 +898,7 @@ func (x *UserBuyNobilityReq) GetEndTime() int64 { return 0 } +// 用户购买舰长回复 type UserBuyNobilityResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -775,7 +911,7 @@ type UserBuyNobilityResp struct { func (x *UserBuyNobilityResp) Reset() { *x = UserBuyNobilityResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[11] + mi := &file_user_center_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -788,7 +924,7 @@ func (x *UserBuyNobilityResp) String() string { func (*UserBuyNobilityResp) ProtoMessage() {} func (x *UserBuyNobilityResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[11] + mi := &file_user_center_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -801,7 +937,7 @@ func (x *UserBuyNobilityResp) ProtoReflect() protoreflect.Message { // Deprecated: Use UserBuyNobilityResp.ProtoReflect.Descriptor instead. func (*UserBuyNobilityResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{11} + return file_user_center_proto_rawDescGZIP(), []int{13} } func (x *UserBuyNobilityResp) GetUser() *User { @@ -832,7 +968,7 @@ type StatPvPKillReq struct { func (x *StatPvPKillReq) Reset() { *x = StatPvPKillReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[12] + mi := &file_user_center_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -845,7 +981,7 @@ func (x *StatPvPKillReq) String() string { func (*StatPvPKillReq) ProtoMessage() {} func (x *StatPvPKillReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[12] + mi := &file_user_center_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -858,7 +994,7 @@ func (x *StatPvPKillReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StatPvPKillReq.ProtoReflect.Descriptor instead. func (*StatPvPKillReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{12} + return file_user_center_proto_rawDescGZIP(), []int{14} } func (x *StatPvPKillReq) GetUid() int64 { @@ -895,7 +1031,7 @@ type StatPvPFirstBloodReq struct { func (x *StatPvPFirstBloodReq) Reset() { *x = StatPvPFirstBloodReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[13] + mi := &file_user_center_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -908,7 +1044,7 @@ func (x *StatPvPFirstBloodReq) String() string { func (*StatPvPFirstBloodReq) ProtoMessage() {} func (x *StatPvPFirstBloodReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[13] + mi := &file_user_center_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -921,7 +1057,7 @@ func (x *StatPvPFirstBloodReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StatPvPFirstBloodReq.ProtoReflect.Descriptor instead. func (*StatPvPFirstBloodReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{13} + return file_user_center_proto_rawDescGZIP(), []int{15} } func (x *StatPvPFirstBloodReq) GetUid() int64 { @@ -953,7 +1089,7 @@ type StatPvPReportReq struct { func (x *StatPvPReportReq) Reset() { *x = StatPvPReportReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[14] + mi := &file_user_center_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -966,7 +1102,7 @@ func (x *StatPvPReportReq) String() string { func (*StatPvPReportReq) ProtoMessage() {} func (x *StatPvPReportReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[14] + mi := &file_user_center_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -979,7 +1115,7 @@ func (x *StatPvPReportReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StatPvPReportReq.ProtoReflect.Descriptor instead. func (*StatPvPReportReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{14} + return file_user_center_proto_rawDescGZIP(), []int{16} } func (x *StatPvPReportReq) GetWinCamp() int32 { @@ -1010,6 +1146,62 @@ func (x *StatPvPReportReq) GetLostItems() []*StatPvPReportReq_Item { return nil } +// 通知-PvP战报 回复 +type StatPvPReportResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WinItems []*StatPvPReportResp_Item `protobuf:"bytes,3,rep,name=winItems,proto3" json:"winItems,omitempty"` // 获胜方数据 + LostItems []*StatPvPReportResp_Item `protobuf:"bytes,4,rep,name=lostItems,proto3" json:"lostItems,omitempty"` // 战败方数据 +} + +func (x *StatPvPReportResp) Reset() { + *x = StatPvPReportResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[17] + 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[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 StatPvPReportResp.ProtoReflect.Descriptor instead. +func (*StatPvPReportResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{17} +} + +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 +} + // rank type RankPvpReq struct { state protoimpl.MessageState @@ -1023,7 +1215,7 @@ type RankPvpReq struct { func (x *RankPvpReq) Reset() { *x = RankPvpReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[15] + mi := &file_user_center_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1036,7 +1228,7 @@ func (x *RankPvpReq) String() string { func (*RankPvpReq) ProtoMessage() {} func (x *RankPvpReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[15] + mi := &file_user_center_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1049,7 +1241,7 @@ func (x *RankPvpReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpReq.ProtoReflect.Descriptor instead. func (*RankPvpReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{15} + return file_user_center_proto_rawDescGZIP(), []int{18} } func (x *RankPvpReq) GetType() int32 { @@ -1078,7 +1270,7 @@ type RankPvpResp struct { func (x *RankPvpResp) Reset() { *x = RankPvpResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[16] + mi := &file_user_center_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1091,7 +1283,7 @@ func (x *RankPvpResp) String() string { func (*RankPvpResp) ProtoMessage() {} func (x *RankPvpResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[16] + mi := &file_user_center_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1104,7 +1296,7 @@ func (x *RankPvpResp) ProtoReflect() protoreflect.Message { // Deprecated: Use RankPvpResp.ProtoReflect.Descriptor instead. func (*RankPvpResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{16} + return file_user_center_proto_rawDescGZIP(), []int{19} } func (x *RankPvpResp) GetType() int32 { @@ -1136,7 +1328,7 @@ type StatPvPReportReq_Item struct { func (x *StatPvPReportReq_Item) Reset() { *x = StatPvPReportReq_Item{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[17] + mi := &file_user_center_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1149,7 +1341,7 @@ func (x *StatPvPReportReq_Item) String() string { func (*StatPvPReportReq_Item) ProtoMessage() {} func (x *StatPvPReportReq_Item) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[17] + mi := &file_user_center_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1162,7 +1354,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{14, 0} + return file_user_center_proto_rawDescGZIP(), []int{16, 0} } func (x *StatPvPReportReq_Item) GetUid() int64 { @@ -1200,6 +1392,61 @@ func (x *StatPvPReportReq_Item) GetDeKillUnit() int64 { return 0 } +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 + AddonIntegral int64 `protobuf:"varint,2,opt,name=addonIntegral,proto3" json:"addonIntegral,omitempty"` // 本次获取的积分 +} + +func (x *StatPvPReportResp_Item) Reset() { + *x = StatPvPReportResp_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPReportResp_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPReportResp_Item) ProtoMessage() {} + +func (x *StatPvPReportResp_Item) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[21] + 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_Item.ProtoReflect.Descriptor instead. +func (*StatPvPReportResp_Item) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{17, 0} +} + +func (x *StatPvPReportResp_Item) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPReportResp_Item) GetAddonIntegral() int64 { + if x != nil { + return x.AddonIntegral + } + return 0 +} + type RankPvpResp_Item struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1214,7 +1461,7 @@ type RankPvpResp_Item struct { func (x *RankPvpResp_Item) Reset() { *x = RankPvpResp_Item{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[18] + mi := &file_user_center_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1227,7 +1474,7 @@ func (x *RankPvpResp_Item) String() string { func (*RankPvpResp_Item) ProtoMessage() {} func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[18] + mi := &file_user_center_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1240,7 +1487,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{16, 0} + return file_user_center_proto_rawDescGZIP(), []int{19, 0} } func (x *RankPvpResp_Item) GetUid() int64 { @@ -1296,149 +1543,178 @@ var file_user_center_proto_rawDesc = []byte{ 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, 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, 0x11, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 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, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 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, 0xcd, 0x01, 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, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, - 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, 0x69, - 0x73, 0x50, 0x61, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, - 0x61, 0x69, 0x64, 0x22, 0x64, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x6e, 0x64, 0x47, - 0x69, 0x66, 0x74, 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, 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, 0x86, 0x02, 0x0a, 0x12, 0x55, 0x73, - 0x65, 0x72, 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, + 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, + 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, 0x11, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 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, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 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, 0xa1, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, + 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 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, 0xe5, 0x01, 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, 0x12, 0x0a, 0x04, - 0x70, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, - 0x49, 0x64, 0x18, 0x04, 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, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 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, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 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, 0x09, 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, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x22, 0x67, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x42, 0x75, 0x79, 0x4e, 0x6f, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 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, 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, 0xc7, 0x02, 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, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 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, 0x08, 0x77, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, - 0x37, 0x0a, 0x09, 0x6c, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 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, 0x88, 0x01, 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, 0x16, 0x0a, 0x06, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 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, 0x03, 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, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, - 0x6e, 0x69, 0x74, 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, 0x32, 0xc6, 0x04, 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, 0x43, 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, + 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, 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, 0x12, 0x37, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 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, 0x30, 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, 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, - 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, 0x86, 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, + 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, + 0x55, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, + 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x04, 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, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 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, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x18, 0x08, 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, 0x09, 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, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x67, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x42, 0x75, 0x79, + 0x4e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 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, 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, 0xc7, 0x02, 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, 0x1e, 0x0a, 0x0a, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x77, + 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 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, 0x08, 0x77, 0x69, 0x6e, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x6c, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, + 0x04, 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, 0x88, 0x01, 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, 0x16, 0x0a, 0x06, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, + 0x18, 0x02, 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, 0x03, 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, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x4b, 0x69, + 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x22, 0xc5, 0x01, 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, 0x03, 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, 0x04, 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, 0x3e, + 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, 0x24, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x6f, + 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0d, 0x61, 0x64, 0x64, 0x6f, 0x6e, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 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, 0x32, 0x84, 0x05, 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, + 0x43, 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, 0x47, 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, 0x55, 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, 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, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1453,62 +1729,69 @@ func file_user_center_proto_rawDescGZIP() []byte { return file_user_center_proto_rawDescData } -var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_user_center_proto_goTypes = []interface{}{ - (*User)(nil), // 0: pb.User - (*Empty)(nil), // 1: pb.Empty - (*PlatformUserReq)(nil), // 2: pb.PlatformUserReq - (*PlatformUserResp)(nil), // 3: pb.PlatformUserResp - (*UserIdResp)(nil), // 4: pb.UserIdResp - (*ChangeIntegralReq)(nil), // 5: pb.ChangeIntegralReq - (*ChangeIntegralResp)(nil), // 6: pb.ChangeIntegralResp - (*UserIntegralResp)(nil), // 7: pb.UserIntegralResp - (*UserSendGiftReq)(nil), // 8: pb.UserSendGiftReq - (*UserSendGiftResp)(nil), // 9: pb.UserSendGiftResp - (*UserBuyNobilityReq)(nil), // 10: pb.UserBuyNobilityReq - (*UserBuyNobilityResp)(nil), // 11: pb.UserBuyNobilityResp - (*StatPvPKillReq)(nil), // 12: pb.StatPvPKillReq - (*StatPvPFirstBloodReq)(nil), // 13: pb.StatPvPFirstBloodReq - (*StatPvPReportReq)(nil), // 14: pb.StatPvPReportReq - (*RankPvpReq)(nil), // 15: pb.RankPvpReq - (*RankPvpResp)(nil), // 16: pb.RankPvpResp - (*StatPvPReportReq_Item)(nil), // 17: pb.StatPvPReportReq.Item - (*RankPvpResp_Item)(nil), // 18: pb.RankPvpResp.Item + (*User)(nil), // 0: pb.User + (*Empty)(nil), // 1: pb.Empty + (*PlatformUserReq)(nil), // 2: pb.PlatformUserReq + (*PlatformUserResp)(nil), // 3: pb.PlatformUserResp + (*UserIdReq)(nil), // 4: pb.UserIdReq + (*UserIdResp)(nil), // 5: pb.UserIdResp + (*ChangeIntegralReq)(nil), // 6: pb.ChangeIntegralReq + (*ChangeIntegralResp)(nil), // 7: pb.ChangeIntegralResp + (*UserIntegralResp)(nil), // 8: pb.UserIntegralResp + (*UserCheckInResp)(nil), // 9: pb.UserCheckInResp + (*UserSendGiftReq)(nil), // 10: pb.UserSendGiftReq + (*UserSendGiftResp)(nil), // 11: pb.UserSendGiftResp + (*UserBuyNobilityReq)(nil), // 12: pb.UserBuyNobilityReq + (*UserBuyNobilityResp)(nil), // 13: pb.UserBuyNobilityResp + (*StatPvPKillReq)(nil), // 14: pb.StatPvPKillReq + (*StatPvPFirstBloodReq)(nil), // 15: pb.StatPvPFirstBloodReq + (*StatPvPReportReq)(nil), // 16: pb.StatPvPReportReq + (*StatPvPReportResp)(nil), // 17: pb.StatPvPReportResp + (*RankPvpReq)(nil), // 18: pb.RankPvpReq + (*RankPvpResp)(nil), // 19: pb.RankPvpResp + (*StatPvPReportReq_Item)(nil), // 20: pb.StatPvPReportReq.Item + (*StatPvPReportResp_Item)(nil), // 21: pb.StatPvPReportResp.Item + (*RankPvpResp_Item)(nil), // 22: pb.RankPvpResp.Item } var file_user_center_proto_depIdxs = []int32{ 0, // 0: pb.PlatformUserResp.user:type_name -> pb.User - 0, // 1: pb.UserSendGiftResp.user:type_name -> pb.User - 6, // 2: pb.UserSendGiftResp.integral:type_name -> pb.ChangeIntegralResp - 0, // 3: pb.UserBuyNobilityResp.user:type_name -> pb.User - 6, // 4: pb.UserBuyNobilityResp.integral:type_name -> pb.ChangeIntegralResp - 17, // 5: pb.StatPvPReportReq.winItems:type_name -> pb.StatPvPReportReq.Item - 17, // 6: pb.StatPvPReportReq.lostItems:type_name -> pb.StatPvPReportReq.Item - 18, // 7: pb.RankPvpResp.items:type_name -> pb.RankPvpResp.Item - 2, // 8: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq - 2, // 9: pb.userCenter.getUserIdByPUid:input_type -> pb.PlatformUserReq - 5, // 10: pb.userCenter.ChangeIntegral:input_type -> pb.ChangeIntegralReq - 4, // 11: pb.userCenter.GetUserIntegral:input_type -> pb.UserIdResp - 8, // 12: pb.userCenter.userSendGift:input_type -> pb.UserSendGiftReq - 10, // 13: pb.userCenter.userBuyNobility:input_type -> pb.UserBuyNobilityReq - 12, // 14: pb.userCenter.statPvpKill:input_type -> pb.StatPvPKillReq - 13, // 15: pb.userCenter.statPvpFirstBlood:input_type -> pb.StatPvPFirstBloodReq - 14, // 16: pb.userCenter.statPvpReport:input_type -> pb.StatPvPReportReq - 15, // 17: pb.userCenter.rankPvp:input_type -> pb.RankPvpReq - 3, // 18: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp - 4, // 19: pb.userCenter.getUserIdByPUid:output_type -> pb.UserIdResp - 6, // 20: pb.userCenter.ChangeIntegral:output_type -> pb.ChangeIntegralResp - 7, // 21: pb.userCenter.GetUserIntegral:output_type -> pb.UserIntegralResp - 9, // 22: pb.userCenter.userSendGift:output_type -> pb.UserSendGiftResp - 11, // 23: pb.userCenter.userBuyNobility:output_type -> pb.UserBuyNobilityResp - 1, // 24: pb.userCenter.statPvpKill:output_type -> pb.Empty - 1, // 25: pb.userCenter.statPvpFirstBlood:output_type -> pb.Empty - 1, // 26: pb.userCenter.statPvpReport:output_type -> pb.Empty - 16, // 27: pb.userCenter.rankPvp:output_type -> pb.RankPvpResp - 18, // [18:28] is the sub-list for method output_type - 8, // [8:18] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 7, // 1: pb.UserSendGiftResp.integral:type_name -> pb.ChangeIntegralResp + 0, // 2: pb.UserBuyNobilityResp.user:type_name -> pb.User + 7, // 3: pb.UserBuyNobilityResp.integral:type_name -> pb.ChangeIntegralResp + 20, // 4: pb.StatPvPReportReq.winItems:type_name -> pb.StatPvPReportReq.Item + 20, // 5: pb.StatPvPReportReq.lostItems:type_name -> pb.StatPvPReportReq.Item + 21, // 6: pb.StatPvPReportResp.winItems:type_name -> pb.StatPvPReportResp.Item + 21, // 7: pb.StatPvPReportResp.lostItems:type_name -> pb.StatPvPReportResp.Item + 22, // 8: pb.RankPvpResp.items:type_name -> pb.RankPvpResp.Item + 2, // 9: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq + 2, // 10: pb.userCenter.getUserIdByPUid:input_type -> pb.PlatformUserReq + 6, // 11: pb.userCenter.ChangeIntegral:input_type -> pb.ChangeIntegralReq + 4, // 12: pb.userCenter.GetUserIntegral:input_type -> pb.UserIdReq + 4, // 13: pb.userCenter.UserCheckIn:input_type -> pb.UserIdReq + 10, // 14: pb.userCenter.userSendGift:input_type -> pb.UserSendGiftReq + 12, // 15: pb.userCenter.userBuyNobility:input_type -> pb.UserBuyNobilityReq + 14, // 16: pb.userCenter.statPvpKill:input_type -> pb.StatPvPKillReq + 15, // 17: pb.userCenter.statPvpFirstBlood:input_type -> pb.StatPvPFirstBloodReq + 16, // 18: pb.userCenter.statPvpReport:input_type -> pb.StatPvPReportReq + 18, // 19: pb.userCenter.rankPvp:input_type -> pb.RankPvpReq + 3, // 20: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp + 5, // 21: pb.userCenter.getUserIdByPUid:output_type -> pb.UserIdResp + 7, // 22: pb.userCenter.ChangeIntegral:output_type -> pb.ChangeIntegralResp + 8, // 23: pb.userCenter.GetUserIntegral:output_type -> pb.UserIntegralResp + 9, // 24: pb.userCenter.UserCheckIn:output_type -> pb.UserCheckInResp + 11, // 25: pb.userCenter.userSendGift:output_type -> pb.UserSendGiftResp + 13, // 26: pb.userCenter.userBuyNobility:output_type -> pb.UserBuyNobilityResp + 1, // 27: pb.userCenter.statPvpKill:output_type -> pb.Empty + 1, // 28: pb.userCenter.statPvpFirstBlood:output_type -> pb.Empty + 17, // 29: pb.userCenter.statPvpReport:output_type -> pb.StatPvPReportResp + 19, // 30: pb.userCenter.rankPvp:output_type -> pb.RankPvpResp + 20, // [20:31] is the sub-list for method output_type + 9, // [9:20] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_user_center_proto_init() } @@ -1566,7 +1849,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserIdResp); i { + switch v := v.(*UserIdReq); i { case 0: return &v.state case 1: @@ -1578,7 +1861,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeIntegralReq); i { + switch v := v.(*UserIdResp); i { case 0: return &v.state case 1: @@ -1590,7 +1873,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeIntegralResp); i { + switch v := v.(*ChangeIntegralReq); i { case 0: return &v.state case 1: @@ -1602,7 +1885,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserIntegralResp); i { + switch v := v.(*ChangeIntegralResp); i { case 0: return &v.state case 1: @@ -1614,7 +1897,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserSendGiftReq); i { + switch v := v.(*UserIntegralResp); i { case 0: return &v.state case 1: @@ -1626,7 +1909,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserSendGiftResp); i { + switch v := v.(*UserCheckInResp); i { case 0: return &v.state case 1: @@ -1638,7 +1921,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserBuyNobilityReq); i { + switch v := v.(*UserSendGiftReq); i { case 0: return &v.state case 1: @@ -1650,7 +1933,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserBuyNobilityResp); i { + switch v := v.(*UserSendGiftResp); i { case 0: return &v.state case 1: @@ -1662,7 +1945,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPKillReq); i { + switch v := v.(*UserBuyNobilityReq); i { case 0: return &v.state case 1: @@ -1674,7 +1957,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPFirstBloodReq); i { + switch v := v.(*UserBuyNobilityResp); i { case 0: return &v.state case 1: @@ -1686,7 +1969,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPReportReq); i { + switch v := v.(*StatPvPKillReq); i { case 0: return &v.state case 1: @@ -1698,7 +1981,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpReq); i { + switch v := v.(*StatPvPFirstBloodReq); i { case 0: return &v.state case 1: @@ -1710,7 +1993,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RankPvpResp); i { + switch v := v.(*StatPvPReportReq); i { case 0: return &v.state case 1: @@ -1722,7 +2005,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatPvPReportReq_Item); i { + switch v := v.(*StatPvPReportResp); i { case 0: return &v.state case 1: @@ -1734,6 +2017,54 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[20].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[21].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[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RankPvpResp_Item); i { case 0: return &v.state @@ -1752,7 +2083,7 @@ func file_user_center_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_center_proto_rawDesc, NumEnums: 0, - NumMessages: 19, + NumMessages: 23, 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 5879091..07827f0 100644 --- a/app/user_center/rpc/pb/user_center.proto +++ b/app/user_center/rpc/pb/user_center.proto @@ -29,42 +29,63 @@ message PlatformUserResp { User user = 1; } +// 用户ID请求 +message UserIdReq { + int64 userId = 1; +} + +// 用户ID回复 message UserIdResp { int64 userId = 1; } +// 变更积分请求 message ChangeIntegralReq { int64 userId = 1; // 系统用户ID int64 change = 2; // 变更数量 } +// 变更积分回复 message ChangeIntegralResp { int64 userId = 1; // 系统用户ID int64 change = 2; // 本次变更积分数量,负数为扣减 int64 integral = 3; // 用户当前总积分 } +// 用户积分回复 message UserIntegralResp { int64 userId = 1; // 用户ID int64 integral = 2; // 用户当前总积分 } +// 用户打卡(签到)回复 +message UserCheckInResp { + bool success = 1; // 成功与否 + string msg = 2; // 消息 + int64 integralChange = 3; // 积分变动量 + int64 integral = 4; // 变动后的积分量 + bool isCritical = 5; // 是否发生了暴击奖励 +} + +// 用户送礼请求 message UserSendGiftReq { string platform = 1; // 平台 - string pUid = 2; // 平台用户ID - string roomId = 3; // 直播间ID - int64 giftId = 4; // 礼物ID - string giftName = 5; // 礼物名 - int64 num = 6; // 赠送数量 - int64 price = 7; // 礼物单价(系统不存在对应礼物数据时使用) - bool isPaid = 8; // 是否收费礼物 + int64 userId = 2; // 系统用户ID + string pUid = 3; // 平台用户ID + string roomId = 4; // 直播间ID + int64 giftId = 5; // 礼物ID + string giftName = 6; // 礼物名 + int64 num = 7; // 赠送数量 + int64 price = 8; // 礼物单价(系统不存在对应礼物数据时使用) + bool isPaid = 9; // 是否收费礼物 } +// 用户送礼回复 message UserSendGiftResp { - User user = 1; // 系统用户信息 ChangeIntegralResp integral = 10; // 积分变动 } +// 用户购买舰长请求 message UserBuyNobilityReq { string platform = 1; // 平台 string pUid = 2; // 平台用户ID @@ -78,6 +99,7 @@ message UserBuyNobilityReq { int64 endTime = 10; // 结束时间 } +// 用户购买舰长回复 message UserBuyNobilityResp { User user = 1; // 系统用户信息 ChangeIntegralResp integral = 10; // 积分变动 @@ -111,6 +133,16 @@ message StatPvPReportReq { repeated Item lostItems = 4; // 战败方数据 } +// 通知-PvP战报 回复 +message StatPvPReportResp { + message Item { + int64 uid = 1; // 用户ID + int64 addonIntegral = 2; // 本次获取的积分 + } + repeated Item winItems = 3; // 获胜方数据 + repeated Item lostItems = 4; // 战败方数据 +} + // rank message RankPvpReq { int32 type = 1; // rank类型 @@ -141,7 +173,9 @@ service userCenter { //ChangeIntegral 新增用户积分 rpc ChangeIntegral(ChangeIntegralReq) returns (ChangeIntegralResp); //GetUserIntegral 获取用户积分 - rpc GetUserIntegral(UserIdResp) returns (UserIntegralResp); + rpc GetUserIntegral(UserIdReq) returns (UserIntegralResp); + //UserCheckIn 用户签到|打卡 + rpc UserCheckIn(UserIdReq) returns (UserCheckInResp); /// @ZeroGroup: gift @@ -153,7 +187,7 @@ service userCenter { rpc statPvpKill(StatPvPKillReq) returns (Empty); rpc statPvpFirstBlood(StatPvPFirstBloodReq) returns (Empty); - rpc statPvpReport(StatPvPReportReq) returns (Empty); + rpc statPvpReport(StatPvPReportReq) returns (StatPvPReportResp); /// @ZeroGroup: rank 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 d86ebed..e95fea4 100644 --- a/app/user_center/rpc/pb/user_center_grpc.pb.go +++ b/app/user_center/rpc/pb/user_center_grpc.pb.go @@ -29,13 +29,15 @@ type UserCenterClient interface { //ChangeIntegral 新增用户积分 ChangeIntegral(ctx context.Context, in *ChangeIntegralReq, opts ...grpc.CallOption) (*ChangeIntegralResp, error) //GetUserIntegral 获取用户积分 - GetUserIntegral(ctx context.Context, in *UserIdResp, opts ...grpc.CallOption) (*UserIntegralResp, error) + GetUserIntegral(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserIntegralResp, error) + //UserCheckIn 用户签到|打卡 + UserCheckIn(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserCheckInResp, 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) - StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*StatPvPReportResp, error) // rankPvp pvp排行 RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) } @@ -75,7 +77,7 @@ func (c *userCenterClient) ChangeIntegral(ctx context.Context, in *ChangeIntegra return out, nil } -func (c *userCenterClient) GetUserIntegral(ctx context.Context, in *UserIdResp, opts ...grpc.CallOption) (*UserIntegralResp, error) { +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...) if err != nil { @@ -84,6 +86,15 @@ func (c *userCenterClient) GetUserIntegral(ctx context.Context, in *UserIdResp, return out, nil } +func (c *userCenterClient) UserCheckIn(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserCheckInResp, error) { + out := new(UserCheckInResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/UserCheckIn", 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...) @@ -120,8 +131,8 @@ func (c *userCenterClient) StatPvpFirstBlood(ctx context.Context, in *StatPvPFir return out, nil } -func (c *userCenterClient) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) +func (c *userCenterClient) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*StatPvPReportResp, error) { + out := new(StatPvPReportResp) err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpReport", in, out, opts...) if err != nil { return nil, err @@ -149,13 +160,15 @@ type UserCenterServer interface { //ChangeIntegral 新增用户积分 ChangeIntegral(context.Context, *ChangeIntegralReq) (*ChangeIntegralResp, error) //GetUserIntegral 获取用户积分 - GetUserIntegral(context.Context, *UserIdResp) (*UserIntegralResp, error) + GetUserIntegral(context.Context, *UserIdReq) (*UserIntegralResp, error) + //UserCheckIn 用户签到|打卡 + UserCheckIn(context.Context, *UserIdReq) (*UserCheckInResp, 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) - StatPvpReport(context.Context, *StatPvPReportReq) (*Empty, error) + StatPvpReport(context.Context, *StatPvPReportReq) (*StatPvPReportResp, error) // rankPvp pvp排行 RankPvp(context.Context, *RankPvpReq) (*RankPvpResp, error) mustEmbedUnimplementedUserCenterServer() @@ -174,9 +187,12 @@ func (UnimplementedUserCenterServer) GetUserIdByPUid(context.Context, *PlatformU func (UnimplementedUserCenterServer) ChangeIntegral(context.Context, *ChangeIntegralReq) (*ChangeIntegralResp, error) { return nil, status.Errorf(codes.Unimplemented, "method ChangeIntegral not implemented") } -func (UnimplementedUserCenterServer) GetUserIntegral(context.Context, *UserIdResp) (*UserIntegralResp, error) { +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) UserSendGift(context.Context, *UserSendGiftReq) (*UserSendGiftResp, error) { return nil, status.Errorf(codes.Unimplemented, "method UserSendGift not implemented") } @@ -189,7 +205,7 @@ func (UnimplementedUserCenterServer) StatPvpKill(context.Context, *StatPvPKillRe func (UnimplementedUserCenterServer) StatPvpFirstBlood(context.Context, *StatPvPFirstBloodReq) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method StatPvpFirstBlood not implemented") } -func (UnimplementedUserCenterServer) StatPvpReport(context.Context, *StatPvPReportReq) (*Empty, error) { +func (UnimplementedUserCenterServer) StatPvpReport(context.Context, *StatPvPReportReq) (*StatPvPReportResp, error) { return nil, status.Errorf(codes.Unimplemented, "method StatPvpReport not implemented") } func (UnimplementedUserCenterServer) RankPvp(context.Context, *RankPvpReq) (*RankPvpResp, error) { @@ -263,7 +279,7 @@ func _UserCenter_ChangeIntegral_Handler(srv interface{}, ctx context.Context, de } func _UserCenter_GetUserIntegral_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserIdResp) + in := new(UserIdReq) if err := dec(in); err != nil { return nil, err } @@ -275,7 +291,25 @@ func _UserCenter_GetUserIntegral_Handler(srv interface{}, ctx context.Context, d FullMethod: "/pb.userCenter/GetUserIntegral", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).GetUserIntegral(ctx, req.(*UserIdResp)) + return srv.(UserCenterServer).GetUserIntegral(ctx, req.(*UserIdReq)) + } + return interceptor(ctx, in, info, handler) +} + +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).UserCheckIn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/UserCheckIn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).UserCheckIn(ctx, req.(*UserIdReq)) } return interceptor(ctx, in, info, handler) } @@ -411,6 +445,10 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetUserIntegral", Handler: _UserCenter_GetUserIntegral_Handler, }, + { + MethodName: "UserCheckIn", + Handler: _UserCenter_UserCheckIn_Handler, + }, { MethodName: "userSendGift", Handler: _UserCenter_UserSendGift_Handler, diff --git a/app/user_center/rpc/usercenter/user_center.go b/app/user_center/rpc/usercenter/user_center.go index d542d91..e35c6c1 100644 --- a/app/user_center/rpc/usercenter/user_center.go +++ b/app/user_center/rpc/usercenter/user_center.go @@ -13,25 +13,29 @@ import ( ) type ( - ChangeIntegralReq = pb.ChangeIntegralReq - ChangeIntegralResp = pb.ChangeIntegralResp - Empty = pb.Empty - PlatformUserReq = pb.PlatformUserReq - PlatformUserResp = pb.PlatformUserResp - RankPvpReq = pb.RankPvpReq - RankPvpResp = pb.RankPvpResp - RankPvpResp_Item = pb.RankPvpResp_Item - StatPvPFirstBloodReq = pb.StatPvPFirstBloodReq - StatPvPKillReq = pb.StatPvPKillReq - StatPvPReportReq = pb.StatPvPReportReq - StatPvPReportReq_Item = pb.StatPvPReportReq_Item - User = pb.User - UserBuyNobilityReq = pb.UserBuyNobilityReq - UserBuyNobilityResp = pb.UserBuyNobilityResp - UserIdResp = pb.UserIdResp - UserIntegralResp = pb.UserIntegralResp - UserSendGiftReq = pb.UserSendGiftReq - UserSendGiftResp = pb.UserSendGiftResp + ChangeIntegralReq = pb.ChangeIntegralReq + ChangeIntegralResp = pb.ChangeIntegralResp + Empty = pb.Empty + PlatformUserReq = pb.PlatformUserReq + PlatformUserResp = pb.PlatformUserResp + RankPvpReq = pb.RankPvpReq + RankPvpResp = pb.RankPvpResp + RankPvpResp_Item = pb.RankPvpResp_Item + StatPvPFirstBloodReq = pb.StatPvPFirstBloodReq + StatPvPKillReq = pb.StatPvPKillReq + StatPvPReportReq = pb.StatPvPReportReq + StatPvPReportReq_Item = pb.StatPvPReportReq_Item + StatPvPReportResp = pb.StatPvPReportResp + StatPvPReportResp_Item = pb.StatPvPReportResp_Item + User = pb.User + UserBuyNobilityReq = pb.UserBuyNobilityReq + UserBuyNobilityResp = pb.UserBuyNobilityResp + UserCheckInResp = pb.UserCheckInResp + UserIdReq = pb.UserIdReq + UserIdResp = pb.UserIdResp + UserIntegralResp = pb.UserIntegralResp + UserSendGiftReq = pb.UserSendGiftReq + UserSendGiftResp = pb.UserSendGiftResp UserCenter interface { // retrievePlatformUser 新增或获取用户 @@ -41,13 +45,15 @@ type ( // ChangeIntegral 新增用户积分 ChangeIntegral(ctx context.Context, in *ChangeIntegralReq, opts ...grpc.CallOption) (*ChangeIntegralResp, error) // GetUserIntegral 获取用户积分 - GetUserIntegral(ctx context.Context, in *UserIdResp, opts ...grpc.CallOption) (*UserIntegralResp, error) + GetUserIntegral(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserIntegralResp, error) + // UserCheckIn 用户签到|打卡 + UserCheckIn(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserCheckInResp, 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) - StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*StatPvPReportResp, error) // rankPvp pvp排行 RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) } @@ -82,11 +88,17 @@ func (m *defaultUserCenter) ChangeIntegral(ctx context.Context, in *ChangeIntegr } // GetUserIntegral 获取用户积分 -func (m *defaultUserCenter) GetUserIntegral(ctx context.Context, in *UserIdResp, opts ...grpc.CallOption) (*UserIntegralResp, error) { +func (m *defaultUserCenter) GetUserIntegral(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserIntegralResp, error) { client := pb.NewUserCenterClient(m.cli.Conn()) return client.GetUserIntegral(ctx, in, opts...) } +// UserCheckIn 用户签到|打卡 +func (m *defaultUserCenter) UserCheckIn(ctx context.Context, in *UserIdReq, opts ...grpc.CallOption) (*UserCheckInResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.UserCheckIn(ctx, in, opts...) +} + // UserSendGift 用户赠送礼物 func (m *defaultUserCenter) UserSendGift(ctx context.Context, in *UserSendGiftReq, opts ...grpc.CallOption) (*UserSendGiftResp, error) { client := pb.NewUserCenterClient(m.cli.Conn()) @@ -108,7 +120,7 @@ func (m *defaultUserCenter) StatPvpFirstBlood(ctx context.Context, in *StatPvPFi return client.StatPvpFirstBlood(ctx, in, opts...) } -func (m *defaultUserCenter) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*Empty, error) { +func (m *defaultUserCenter) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*StatPvPReportResp, error) { client := pb.NewUserCenterClient(m.cli.Conn()) return client.StatPvpReport(ctx, in, opts...) } diff --git a/common/kafka/vars.go b/common/kafka/vars.go new file mode 100644 index 0000000..3b43a5e --- /dev/null +++ b/common/kafka/vars.go @@ -0,0 +1,13 @@ +package kafka + +import ( + nkfk "git.noahlan.cn/northlan/ntools-go/kafka" + "github.com/Shopify/sarama" +) + +var DefaultProducerConfig = &nkfk.ProducerConfig{ + RequiredAcks: sarama.WaitForAll, + Partitioner: sarama.NewHashPartitioner, + IsReturnSuccess: true, + Marshaler: ProtobufMarshaler, +} diff --git a/common/nerr/err_code.go b/common/nerr/err_code.go index 33f8e94..282b2e2 100644 --- a/common/nerr/err_code.go +++ b/common/nerr/err_code.go @@ -16,3 +16,9 @@ const ( DBUpdateAffectedZeroError uint32 = 100006 CopyError uint32 = 100007 ) + +// 用户积分相关 UserIntegral + +const ( + UserIntegralNotEnoughError uint32 = 200100 // 用户积分不足 +) diff --git a/common/nerr/err_msg.go b/common/nerr/err_msg.go index 7f3c3cb..a0bc0cd 100644 --- a/common/nerr/err_msg.go +++ b/common/nerr/err_msg.go @@ -14,6 +14,8 @@ func init() { message[DBError] = "数据库繁忙,请稍后再试。" message[DBUpdateAffectedZeroError] = "更新数据影响行数为0" // 不一定是错误 message[CopyError] = "数据转换失败,请稍后再试。" + // 业务 + message[UserIntegralNotEnoughError] = "用户积分不足" } func MapErrMsg(code uint32) string { diff --git a/go.mod b/go.mod index 1ba1f9d..46953f3 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( ) require ( - github.com/Shopify/sarama v1.32.0 // indirect + github.com/Shopify/sarama v1.33.0 // indirect github.com/VividCortex/mysqlerr v1.0.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -38,6 +38,8 @@ require ( github.com/google/go-cmp v0.5.7 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/googleapis/gnostic v0.4.1 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/golang-lru v0.5.1 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect @@ -48,7 +50,7 @@ require ( github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.1 // indirect + github.com/klauspost/compress v1.15.4 // indirect github.com/longzhiri/gozset v0.0.0-20210113140059-91f2d281daf1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -74,8 +76,8 @@ require ( go.uber.org/automaxprocs v1.5.1 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect - golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect - golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 // indirect + golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 // indirect + golang.org/x/net v0.0.0-20220516155154-20f960328961 // indirect golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect diff --git a/go.sum b/go.sum index e1b591d..13e5f18 100644 --- a/go.sum +++ b/go.sum @@ -56,6 +56,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdko github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs= github.com/Shopify/sarama v1.32.0 h1:P+RUjEaRU0GMMbYexGMDyrMkLhbbBVUVISDywi+IlFU= github.com/Shopify/sarama v1.32.0/go.mod h1:+EmJJKZWVT/faR9RcOxJerP+LId4iWdQPBGLy1Y1Njs= +github.com/Shopify/sarama v1.33.0 h1:2K4mB9M4fo46sAM7t6QTsmSO8dLX1OqznLM7vn3OjZ8= +github.com/Shopify/sarama v1.33.0/go.mod h1:lYO7LwEBkE0iAeTl94UfPSrDaavFzSFlmn+5isARATQ= github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= github.com/Shopify/toxiproxy/v2 v2.3.0 h1:62YkpiP4bzdhKMH+6uC5E95y608k3zDwdzuBMsnn3uQ= github.com/Shopify/toxiproxy/v2 v2.3.0/go.mod h1:KvQTtB6RjCJY4zqNJn7C7JDFgsG5uoHYDirfUfpIm0c= @@ -255,6 +257,11 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +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-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-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= @@ -297,8 +304,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= github.com/klauspost/compress v1.15.1/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/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= @@ -433,7 +443,9 @@ github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/X github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/scram v1.1.0/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -495,6 +507,8 @@ golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0= +golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -570,6 +584,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 h1:yssD99+7tqHWO5Gwh81phT+67hg+KttniBr6UnEXOY8= golang.org/x/net v0.0.0-20220421235706-1d1ef9303861/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220516155154-20f960328961 h1:+W/iTMPG0EL7aW+/atntZwZrvSRIj3m3yX414dSULUU= +golang.org/x/net v0.0.0-20220516155154-20f960328961/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=