feat: 修复排行榜,添加新的排行榜

main
NorthLan 3 years ago
parent c341b8a09d
commit 66ee7ea63a

@ -11,9 +11,17 @@ var _ RankPvpModel = (*customRankPvpModel)(nil)
const ( const (
RankTypeDamage = iota + 1 RankTypeDamage = iota + 1
RankTypeDeDamage
RankTypeGeneral RankTypeGeneral
RankTypeDeGeneral
RankTypeKillUnit RankTypeKillUnit
RankTypeDeKillUnit
RankTypeKillPlayer RankTypeKillPlayer
RankTypeDeKillPlayer
RankTypeWin
RankTypeLost
RankTypeFirstBlood
RankTypeDeFirstBlood
) )
const MaxRankN = 50 const MaxRankN = 50
@ -56,9 +64,8 @@ func (m *customRankPvpModel) RankListByType(ctx context.Context, rankType, topN
err := db.Model(&RankPvpWithPlatformUser{}). err := db.Model(&RankPvpWithPlatformUser{}).
Select(fmt.Sprintf("%s.*, UP.platform, UP.p_uname, UP.p_avatar", m.table)). Select(fmt.Sprintf("%s.*, UP.platform, UP.p_uname, UP.p_avatar", m.table)).
Joins(fmt.Sprintf("LEFT JOIN user_platform UP ON UP.user_id = %s.user_id", m.table)). Joins(fmt.Sprintf("LEFT JOIN user_platform UP ON UP.user_id = %s.user_id", m.table)).
Where("rank_type = ?", rankType). Where(fmt.Sprintf("%s.user_id > 0 AND rank_type = ?", m.table), rankType).
Limit(int(limit)). Limit(int(limit)).
Order("score desc"). // score 排名
Find(&result).Error Find(&result).Error
switch err { switch err {
case nil: case nil:

@ -4,7 +4,6 @@ import (
"context" "context"
"fmt" "fmt"
"git.noahlan.cn/northlan/ntools-go/gorm-zero/gormc" "git.noahlan.cn/northlan/ntools-go/gorm-zero/gormc"
"github.com/zeromicro/go-zero/core/logx"
"gorm.io/gorm" "gorm.io/gorm"
) )
@ -13,10 +12,18 @@ var _ StatisticsPvpModel = (*customStatisticsPvpModel)(nil)
type ScoreType string type ScoreType string
const ( const (
ScoreTypeDamage ScoreType = "damage" ScoreTypeDamage ScoreType = "damage"
ScoreTypeGeneral = "general_count" ScoreTypeDeDamage = "de_damage"
ScoreTypeKillUnit = "kill_unit_count" ScoreTypeGeneral = "general_count"
ScoreTypeKillPlayer = "kill_player_count" ScoreTypeDeGeneral = "de_general_count"
ScoreTypeKillUnit = "kill_unit_count"
ScoreTypeDeKillUnit = "de_kill_unit_count"
ScoreTypeKillPlayer = "kill_player_count"
ScoreTypeDeKillPlayer = "de_kill_player_count"
ScoreTypeWin = "win_count"
ScoreTypeLost = "lost_count"
ScoreTypeFirstBlood = "first_blood_count"
ScoreTypeDeFirstBlood = "de_first_blood_count"
) )
type ( type (
@ -24,11 +31,14 @@ type (
// and implement the added methods in customStatisticsPvpModel. // and implement the added methods in customStatisticsPvpModel.
StatisticsPvpModel interface { StatisticsPvpModel interface {
statisticsPvpModel statisticsPvpModel
Exists(ctx context.Context, userId int64) (bool, error) // Transaction 开启事务,传入方法即可
UpdateRecord(ctx context.Context, userId int64, props *UpdateRecordProps) error Transaction(ctx context.Context, tx *gorm.DB, fn func(tx *gorm.DB) error) error
RecordPvp(ctx context.Context, winUids, lostUids []int64) error // InsertTx 插入事务
InsertTx(ctx context.Context, tx *gorm.DB, data *StatisticsPvp) error
// UpdateRecord 更新记录
UpdateRecord(ctx context.Context, tx *gorm.DB, userId int64, props *UpdateRecordProps) error
// FindGreaterByScore 找到比给定分数大的用户id以及具体分数 // FindGreaterByScore 找到比给定分数大的用户id以及具体分数
FindGreaterByScore(ctx context.Context, score int64, scoreType ScoreType) ([]UserAndScore, error) FindGreaterByScore(ctx context.Context, score int64, scoreType ScoreType, limit int) ([]UserAndScore, error)
} }
UserAndScore struct { UserAndScore struct {
@ -37,16 +47,18 @@ type (
} }
UpdateRecordProps struct { UpdateRecordProps struct {
KillUnit bool // 是否击杀单位 Damage *int64 // 伤害
DeKillUnit bool // 是否单位被击杀 DeDamage *int64 // 被伤害
KillPlayer bool // 是否击杀玩家 KillUnitCount *int64 // 击杀单位数量
DeKillPlayer bool // 是否玩家被击杀 DeKillUnitCount *int64 // 被击杀单位被击杀
General bool // 是否拿到名将 Win bool // 是否获胜
DeGeneral bool // 是否名将罗马 Lost bool // 是否战败
FirstBlood bool // 是否拿到一血 KillPlayer bool // 是否击杀玩家
DeFirstBlood bool // 是否被拿一血 DeKillPlayer bool // 是否玩家被击杀
Damage *int64 // 伤害 General bool // 是否拿到名将
DeDamage *int64 // 被伤害 DeGeneral bool // 是否名将罗马
FirstBlood bool // 是否拿到一血
DeFirstBlood bool // 是否被拿一血
} }
customStatisticsPvpModel struct { customStatisticsPvpModel struct {
@ -61,22 +73,21 @@ func NewStatisticsPvpModel(conn *gorm.DB) StatisticsPvpModel {
} }
} }
func (m *customStatisticsPvpModel) Exists(ctx context.Context, userId int64) (bool, error) { func (m *customStatisticsPvpModel) InsertTx(ctx context.Context, tx *gorm.DB, data *StatisticsPvp) error {
var count int64 return withTx(ctx, m.conn, tx).Create(data).Error
err := m.conn.WithContext(ctx).Model(&StatisticsPvp{}).Where("user_id = ?", userId).Count(&count).Error
switch err {
case nil:
return count > 0, nil
case gormc.ErrNotFound:
return false, ErrNotFound
default:
return false, err
}
} }
func (m *customStatisticsPvpModel) UpdateRecord(ctx context.Context, userId int64, props *UpdateRecordProps) error { func (m *customStatisticsPvpModel) Transaction(ctx context.Context, tx *gorm.DB, fn func(tx *gorm.DB) error) error {
return withTx(ctx, m.conn, tx).Transaction(func(tx *gorm.DB) error {
return fn(tx)
})
}
func (m *customStatisticsPvpModel) UpdateRecord(ctx context.Context, tx *gorm.DB, userId int64, props *UpdateRecordProps) error {
// 条件构建 // 条件构建
db := m.conn.WithContext(ctx).Model(&StatisticsPvp{}).Where("user_id = ?", userId) db := withTx(ctx, m.conn, tx)
db = db.Model(&StatisticsPvp{}).Where("user_id = ?", userId)
data := make(map[string]interface{}) data := make(map[string]interface{})
if props.Damage != nil { if props.Damage != nil {
data["damage"] = gorm.Expr("damage + ?", *props.Damage) data["damage"] = gorm.Expr("damage + ?", *props.Damage)
@ -84,11 +95,17 @@ func (m *customStatisticsPvpModel) UpdateRecord(ctx context.Context, userId int6
if props.DeDamage != nil { if props.DeDamage != nil {
data["de_damage"] = gorm.Expr("de_damage + ?", *props.DeDamage) data["de_damage"] = gorm.Expr("de_damage + ?", *props.DeDamage)
} }
if props.KillUnit { if props.KillUnitCount != nil {
data["kill_unit_count"] = gorm.Expr("kill_unit_count + 1") data["kill_unit_count"] = gorm.Expr("kill_unit_count + ?", *props.KillUnitCount)
}
if props.DeKillUnitCount != nil {
data["de_kill_unit_count"] = gorm.Expr("de_kill_unit_count + ?", *props.DeKillUnitCount)
} }
if props.DeKillUnit { if props.Win {
data["de_kill_unit_count"] = gorm.Expr("de_kill_unit_count + 1") data["win_count"] = gorm.Expr("win_count + 1")
}
if props.Lost {
data["lost_count"] = gorm.Expr("lost_count + 1")
} }
if props.KillPlayer { if props.KillPlayer {
data["kill_player_count"] = gorm.Expr("kill_player_count + 1") data["kill_player_count"] = gorm.Expr("kill_player_count + 1")
@ -108,32 +125,26 @@ func (m *customStatisticsPvpModel) UpdateRecord(ctx context.Context, userId int6
if props.DeFirstBlood { if props.DeFirstBlood {
data["de_first_blood_count"] = gorm.Expr("de_first_blood_count + 1") data["de_first_blood_count"] = gorm.Expr("de_first_blood_count + 1")
} }
return db.Updates(data).Error result := db.Updates(data)
} if result.Error != nil {
return result.Error
func (m *customStatisticsPvpModel) RecordPvp(ctx context.Context, winUids, lostUids []int64) error { }
return m.conn.Transaction(func(tx *gorm.DB) error { if result.RowsAffected == 0 {
err := tx.WithContext(ctx).Model(&StatisticsPvp{}). return ErrRowsAffectedZero
Where("user_id in (?)", winUids). }
Update("win_count", gorm.Expr("win_count + 1")). return nil
Error
if err != nil {
logx.Error("更新PvP胜场失败 %+v", err)
}
err = tx.WithContext(ctx).Model(&StatisticsPvp{}).
Where("user_id in (?)", lostUids).
Update("lost_count", gorm.Expr("lost_count + 1")).
Error
if err != nil {
logx.Error("更新PvP败失败 %+v", err)
}
return err
})
} }
func (m *customStatisticsPvpModel) FindGreaterByScore(ctx context.Context, score int64, scoreType ScoreType) ([]UserAndScore, error) { func (m *customStatisticsPvpModel) FindGreaterByScore(ctx context.Context, score int64, scoreType ScoreType, limit int) ([]UserAndScore, error) {
db := m.conn.WithContext(ctx) db := m.conn.WithContext(ctx)
if limit > MaxRankN {
limit = MaxRankN
}
if limit <= 0 {
limit = MaxRankN
}
whereSql := fmt.Sprintf("%s.%s >= %d", m.table, scoreType, score) whereSql := fmt.Sprintf("%s.%s >= %d", m.table, scoreType, score)
// 0 不入榜 // 0 不入榜
if score == 0 { if score == 0 {
@ -142,8 +153,9 @@ func (m *customStatisticsPvpModel) FindGreaterByScore(ctx context.Context, score
var result []UserAndScore var result []UserAndScore
err := db.Table(m.table). err := db.Table(m.table).
Select(fmt.Sprintf("%s.user_id, %s.%s AS score", m.table, m.table, scoreType)). Select(fmt.Sprintf("%s.user_id, %s.%s AS score", m.table, m.table, scoreType)).
Where(whereSql). Where(fmt.Sprintf("%s AND user_id > 0", whereSql)).
Limit(MaxRankN).Find(&result).Error Order("score desc").
Limit(limit).Find(&result).Error
switch err { switch err {
case nil: case nil:
return result, nil return result, nil

@ -1,6 +1,8 @@
package model package model
import ( import (
"context"
"git.noahlan.cn/northlan/ntools-go/gorm-zero/gormc"
"gorm.io/gorm" "gorm.io/gorm"
) )
@ -11,6 +13,9 @@ type (
// and implement the added methods in customUserModel. // and implement the added methods in customUserModel.
UserModel interface { UserModel interface {
userModel userModel
// InsertTx 插入事务
InsertTx(ctx context.Context, tx *gorm.DB, data *User) error
FindOneTx(ctx context.Context, tx *gorm.DB, id int64) (*User, error)
} }
customUserModel struct { customUserModel struct {
@ -24,3 +29,21 @@ func NewUserModel(conn *gorm.DB) UserModel {
defaultUserModel: newUserModel(conn), defaultUserModel: newUserModel(conn),
} }
} }
func (m *customUserModel) InsertTx(ctx context.Context, tx *gorm.DB, data *User) error {
return withTx(ctx, m.conn, tx).Create(data).Error
}
func (m *customUserModel) FindOneTx(ctx context.Context, tx *gorm.DB, id int64) (*User, error) {
db := withTx(ctx, m.conn, tx)
var resp User
err := db.Model(&User{}).Where("`id` = ?", id).Take(&resp).Error
switch err {
case nil:
return &resp, nil
case gormc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}

@ -14,8 +14,12 @@ type (
// and implement the added methods in customUserPlatformModel. // and implement the added methods in customUserPlatformModel.
UserPlatformModel interface { UserPlatformModel interface {
userPlatformModel userPlatformModel
// Transaction 开启事务,传入方法即可
Transaction(ctx context.Context, tx *gorm.DB, fn func(tx *gorm.DB) error) error
// InsertTx 事务插入
InsertTx(ctx context.Context, tx *gorm.DB, data *UserPlatform) error
// FindOneByPlatformAndPUid 查询平台用户 // FindOneByPlatformAndPUid 查询平台用户
FindOneByPlatformAndPUid(ctx context.Context, platform, pUid string) (*UserPlatform, error) FindOneByPlatformAndPUid(ctx context.Context, tx *gorm.DB, platform, pUid string) (*UserPlatform, error)
// FindEmptyList 查询从未更新过平台信息的用户 // FindEmptyList 查询从未更新过平台信息的用户
FindEmptyList(ctx context.Context, num int64) ([]UserPlatform, error) FindEmptyList(ctx context.Context, num int64) ([]UserPlatform, error)
// FindUpdatableList 查询过期需要更新信息的用户 // FindUpdatableList 查询过期需要更新信息的用户
@ -35,6 +39,10 @@ type (
} }
) )
func (m *customUserPlatformModel) InsertTx(ctx context.Context, tx *gorm.DB, data *UserPlatform) error {
return withTx(ctx, m.conn, tx).Create(data).Error
}
// NewUserPlatformModel returns a model for the database table. // NewUserPlatformModel returns a model for the database table.
func NewUserPlatformModel(conn *gorm.DB) UserPlatformModel { func NewUserPlatformModel(conn *gorm.DB) UserPlatformModel {
return &customUserPlatformModel{ return &customUserPlatformModel{
@ -42,9 +50,17 @@ func NewUserPlatformModel(conn *gorm.DB) UserPlatformModel {
} }
} }
func (m *customUserPlatformModel) FindOneByPlatformAndPUid(ctx context.Context, platform, pUid string) (*UserPlatform, error) { func (m *customUserPlatformModel) Transaction(ctx context.Context, tx *gorm.DB, fn func(tx *gorm.DB) error) error {
return withTx(ctx, m.conn, tx).Transaction(func(tx *gorm.DB) error {
return fn(tx)
})
}
func (m *customUserPlatformModel) FindOneByPlatformAndPUid(ctx context.Context, tx *gorm.DB, platform, pUid string) (*UserPlatform, error) {
db := withTx(ctx, m.conn, tx)
var resp UserPlatform var resp UserPlatform
err := m.conn.WithContext(ctx).Model(&UserPlatform{}).Where("`platform` = ? AND `p_uid` = ?", platform, pUid).Take(&resp).Error err := db.Model(&UserPlatform{}).Where("`platform` = ? AND `p_uid` = ?", platform, pUid).Take(&resp).Error
switch err { switch err {
case nil: case nil:
return &resp, nil return &resp, nil

@ -0,0 +1,14 @@
package model
import (
"context"
"gorm.io/gorm"
)
func withTx(ctx context.Context, conn, tx *gorm.DB) *gorm.DB {
if tx != nil {
return tx
} else {
return conn.WithContext(ctx)
}
}

@ -1,5 +1,9 @@
package model package model
import "gorm.io/gorm" import (
"errors"
"gorm.io/gorm"
)
var ErrNotFound = gorm.ErrRecordNotFound var ErrNotFound = gorm.ErrRecordNotFound
var ErrRowsAffectedZero = errors.New("RowsAffected zero")

@ -4,12 +4,16 @@ Etcd:
Hosts: Hosts:
- 127.0.0.1:2379 - 127.0.0.1:2379
Key: usercenter.rpc.dev Key: usercenter.rpc.dev
Timeout: 5000 # default is 2000
NonBlock: true NonBlock: true
DB: DB:
#DataSource: root:root@tcp(192.168.1.100:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true #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 DataSource: root:root@tcp(127.0.0.1:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true
User: UserRetriever:
Enabled: false
UpdateDuration: 720 # 720 hours = 30 Day = 1 Month UpdateDuration: 720 # 720 hours = 30 Day = 1 Month
Rank:
Enabled: true
Log: Log:
Mode: console Mode: console
KeepDays: 7 KeepDays: 7

@ -4,12 +4,16 @@ Etcd:
Hosts: Hosts:
- 127.0.0.1:2379 - 127.0.0.1:2379
Key: usercenter.rpc Key: usercenter.rpc
Timeout: 5000 # default is 2000
NonBlock: true NonBlock: true
DB: DB:
#DataSource: root:root@tcp(192.168.1.100:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true #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 DataSource: root:root@tcp(127.0.0.1:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true
User: UserRetriever:
Enabled: true
UpdateDuration: 720 # 720 hours = 30 Day = 1 Month UpdateDuration: 720 # 720 hours = 30 Day = 1 Month
Rank:
Enabled: true
Log: Log:
Mode: file Mode: file
KeepDays: 7 KeepDays: 7

@ -22,8 +22,13 @@ type (
DataSource string DataSource string
} }
User struct { UserRetriever struct {
Enabled bool // 是否开启
UpdateDuration int64 // 用户信息更新最短间隔 单位 h UpdateDuration int64 // 用户信息更新最短间隔 单位 h
} }
Rank struct {
Enabled bool // 是否开启
}
} }
) )

@ -72,7 +72,7 @@ func (r *UserRetriever) Scheduler() {
r.retrieveList(list) r.retrieveList(list)
// 优先加载空信息用户 // 优先加载空信息用户
if len(list) <= 0 { if len(list) <= 0 {
if list, err = r.svcCtx.UserPlatformModel.FindUpdatableList(r.ctx, r.svcCtx.Config.User.UpdateDuration, 5); err != nil { if list, err = r.svcCtx.UserPlatformModel.FindUpdatableList(r.ctx, r.svcCtx.Config.UserRetriever.UpdateDuration, 5); err != nil {
return return
} }
r.retrieveList(list) r.retrieveList(list)

@ -26,10 +26,18 @@ type (
svcCtx *svc.ServiceContext svcCtx *svc.ServiceContext
// 实时排行榜(定期读取,半实时) // 实时排行榜(定期读取,半实时)
damageRank *zset.ZSetInt damageRank *zset.ZSetInt
generalRank *zset.ZSetInt deDamageRank *zset.ZSetInt
killUnitRank *zset.ZSetInt generalRank *zset.ZSetInt
killPlayerRank *zset.ZSetInt deGeneralRank *zset.ZSetInt
killUnitRank *zset.ZSetInt
deKillUnitRank *zset.ZSetInt
killPlayerRank *zset.ZSetInt
deKillPlayerRank *zset.ZSetInt
winRank *zset.ZSetInt
lostRank *zset.ZSetInt
firstBloodRank *zset.ZSetInt
deFirstBloodRank *zset.ZSetInt
// 用户数据表内存缓存 // 用户数据表内存缓存
userCache *lru.Cache userCache *lru.Cache
@ -42,13 +50,21 @@ func InitRankJob(svcCtx *svc.ServiceContext) {
} }
uc, _ := lru.New(4*model.MaxRankN + 1000) uc, _ := lru.New(4*model.MaxRankN + 1000)
Service = &Job{ Service = &Job{
ctx: context.Background(), ctx: context.Background(),
svcCtx: svcCtx, svcCtx: svcCtx,
damageRank: zset.NewZSetInt(lessFunc, model.MaxRankN), damageRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
generalRank: zset.NewZSetInt(lessFunc, model.MaxRankN), deDamageRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
killUnitRank: zset.NewZSetInt(lessFunc, model.MaxRankN), generalRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
killPlayerRank: zset.NewZSetInt(lessFunc, model.MaxRankN), deGeneralRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
userCache: uc, killUnitRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
deKillUnitRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
killPlayerRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
deKillPlayerRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
winRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
lostRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
firstBloodRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
deFirstBloodRank: zset.NewZSetInt(lessFunc, model.MaxRankN),
userCache: uc,
} }
Service.initJob() Service.initJob()
} }
@ -65,22 +81,82 @@ func (j *Job) initJob() {
j.initByType(model.RankTypeKillPlayer) j.initByType(model.RankTypeKillPlayer)
// job read and update // job read and update
c1 := cron.New() c := cron.New()
_, _ = c1.AddFunc("@every 1s", func() { _, _ = c.AddFunc("@every 10s", func() {
go j.readAndUpdate(model.RankTypeDamage) j.readAndUpdate(model.RankTypeDamage)
go j.readAndUpdate(model.RankTypeGeneral) })
go j.readAndUpdate(model.RankTypeKillUnit) _, _ = c.AddFunc("@every 10s", func() {
go j.readAndUpdate(model.RankTypeKillPlayer) j.readAndUpdate(model.RankTypeDeDamage)
}) })
c2 := cron.New() _, _ = c.AddFunc("@every 10s", func() {
_, _ = c2.AddFunc("@every 10min", func() { j.readAndUpdate(model.RankTypeGeneral)
go j.persistence(model.RankTypeDamage) })
go j.persistence(model.RankTypeGeneral) _, _ = c.AddFunc("@every 10s", func() {
go j.persistence(model.RankTypeKillUnit) j.readAndUpdate(model.RankTypeDeGeneral)
go j.persistence(model.RankTypeKillPlayer) })
}) _, _ = c.AddFunc("@every 10s", func() {
c1.Start() j.readAndUpdate(model.RankTypeKillUnit)
c2.Start() })
_, _ = c.AddFunc("@every 10s", func() {
j.readAndUpdate(model.RankTypeDeKillUnit)
})
_, _ = c.AddFunc("@every 10s", func() {
j.readAndUpdate(model.RankTypeKillPlayer)
})
_, _ = c.AddFunc("@every 10s", func() {
j.readAndUpdate(model.RankTypeDeKillPlayer)
})
_, _ = c.AddFunc("@every 10s", func() {
j.readAndUpdate(model.RankTypeWin)
})
_, _ = c.AddFunc("@every 10s", func() {
j.readAndUpdate(model.RankTypeLost)
})
_, _ = c.AddFunc("@every 10s", func() {
j.readAndUpdate(model.RankTypeFirstBlood)
})
_, _ = c.AddFunc("@every 10s", func() {
j.readAndUpdate(model.RankTypeDeFirstBlood)
})
// persistence
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeDamage)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeDeDamage)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeGeneral)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeDeGeneral)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeKillUnit)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeDeKillUnit)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeKillPlayer)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeDeKillPlayer)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeWin)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeLost)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeFirstBlood)
})
_, _ = c.AddFunc("@every 10m", func() {
j.persistence(model.RankTypeDeFirstBlood)
})
c.Start()
} }
func (j *Job) RangeRankByType(rankType, topN int32) *pb.RankPvpResp { func (j *Job) RangeRankByType(rankType, topN int32) *pb.RankPvpResp {
@ -171,9 +247,15 @@ func (j *Job) readAndUpdate(rankType int32) {
last := rank[len(rank)-1] last := rank[len(rank)-1]
score = last[1] score = last[1]
} }
// 若榜内数量不够,则直接取 max - current 数量的人 score排序一下
limit := model.MaxRankN
if len(rank) < model.MaxRankN {
limit = model.MaxRankN - len(rank)
score = 0
}
// 末位 score // 末位 score
byScore, err := j.svcCtx.StatisticsPvpModel.FindGreaterByScore(j.ctx, score, scoreType) byScore, err := j.svcCtx.StatisticsPvpModel.FindGreaterByScore(j.ctx, score, scoreType, limit)
if err != nil { if err != nil {
return return
} }
@ -229,15 +311,39 @@ func (j *Job) getRankInstanceAndScoreType(rankType int32) (*zset.ZSetInt, model.
case model.RankTypeDamage: case model.RankTypeDamage:
rankZSet = j.damageRank rankZSet = j.damageRank
scoreType = model.ScoreTypeDamage scoreType = model.ScoreTypeDamage
case model.RankTypeDeDamage:
rankZSet = j.deDamageRank
scoreType = model.ScoreTypeDeDamage
case model.RankTypeGeneral: case model.RankTypeGeneral:
rankZSet = j.generalRank rankZSet = j.generalRank
scoreType = model.ScoreTypeGeneral scoreType = model.ScoreTypeGeneral
case model.RankTypeDeGeneral:
rankZSet = j.deGeneralRank
scoreType = model.ScoreTypeDeGeneral
case model.RankTypeKillUnit: case model.RankTypeKillUnit:
rankZSet = j.killUnitRank rankZSet = j.killUnitRank
scoreType = model.ScoreTypeKillUnit scoreType = model.ScoreTypeKillUnit
case model.RankTypeDeKillUnit:
rankZSet = j.deKillUnitRank
scoreType = model.ScoreTypeDeKillUnit
case model.RankTypeKillPlayer: case model.RankTypeKillPlayer:
rankZSet = j.killPlayerRank rankZSet = j.killPlayerRank
scoreType = model.ScoreTypeKillPlayer scoreType = model.ScoreTypeKillPlayer
case model.RankTypeDeKillPlayer:
rankZSet = j.deKillPlayerRank
scoreType = model.ScoreTypeDeKillPlayer
case model.RankTypeWin:
rankZSet = j.winRank
scoreType = model.ScoreTypeWin
case model.RankTypeLost:
rankZSet = j.lostRank
scoreType = model.ScoreTypeLost
case model.RankTypeFirstBlood:
rankZSet = j.firstBloodRank
scoreType = model.ScoreTypeFirstBlood
case model.RankTypeDeFirstBlood:
rankZSet = j.deFirstBloodRank
scoreType = model.ScoreTypeDeFirstBlood
} }
if rankZSet == nil { if rankZSet == nil {
return nil, scoreType, errors.Errorf("没有此类型 [%d] 的排行榜", rankType) return nil, scoreType, errors.Errorf("没有此类型 [%d] 的排行榜", rankType)

@ -4,6 +4,7 @@ import (
"context" "context"
"git.noahlan.cn/northlan/ntools-go/uuid" "git.noahlan.cn/northlan/ntools-go/uuid"
"github.com/pkg/errors" "github.com/pkg/errors"
"gorm.io/gorm"
"live-service/app/user_center/model" "live-service/app/user_center/model"
"live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/internal/svc"
"live-service/app/user_center/rpc/pb" "live-service/app/user_center/rpc/pb"
@ -28,44 +29,44 @@ func NewRetrievePlatformUserLogic(ctx context.Context, svcCtx *svc.ServiceContex
// RetrievePlatformUser 查询或创建用户(此时不查询平台用户信息) // RetrievePlatformUser 查询或创建用户(此时不查询平台用户信息)
func (l *RetrievePlatformUserLogic) RetrievePlatformUser(in *pb.PlatformUserReq) (*pb.PlatformUserResp, error) { func (l *RetrievePlatformUserLogic) RetrievePlatformUser(in *pb.PlatformUserReq) (*pb.PlatformUserResp, error) {
var err error var username string
dbPlatformUser, err := l.svcCtx.UserPlatformModel.FindOneByPlatformAndPUid(l.ctx, in.Platform, in.PUid) var dbPlatformUser *model.UserPlatform
if err != nil {
if !errors.Is(err, model.ErrNotFound) { err := l.svcCtx.UserPlatformModel.Transaction(l.ctx, nil, func(tx *gorm.DB) error {
return nil, err // sql错误 var err error
if dbPlatformUser, err = l.svcCtx.UserPlatformModel.FindOneByPlatformAndPUid(l.ctx, tx, in.Platform, in.PUid); err != nil {
if !errors.Is(err, model.ErrNotFound) {
return err
}
} }
} if dbPlatformUser != nil {
if dbPlatformUser != nil { if one, err := l.svcCtx.UserModel.FindOneTx(l.ctx, tx, dbPlatformUser.UserId); err != nil {
var username string username = one.Username
if one, err := l.svcCtx.UserModel.FindOne(l.ctx, dbPlatformUser.UserId); err != nil { }
username = one.Username return nil
} }
return &pb.PlatformUserResp{ // insert
User: l.buildPBUser(username, dbPlatformUser), newId := uuid.NextId()
}, nil if err := l.svcCtx.UserModel.InsertTx(l.ctx, tx, &model.User{Id: newId}); err != nil {
} return errors.Wrap(err, "插入用户数据失败")
}
// create dbPlatformUser = &model.UserPlatform{
dbUser := &model.User{ Id: uuid.NextId(),
Id: uuid.NextId(), UserId: newId,
Username: "", Platform: in.Platform,
} PUid: in.PUid,
if err = l.svcCtx.UserModel.Insert(l.ctx, dbUser); err != nil { PInfo: "{}",
return nil, errors.Wrap(err, "插入用户数据失败") }
} if err := l.svcCtx.UserPlatformModel.InsertTx(l.ctx, tx, dbPlatformUser); err != nil {
dbPlatformUser = &model.UserPlatform{ return errors.Wrap(err, "插入平台用户数据失败")
Id: uuid.NextId(), }
UserId: dbUser.Id, return nil
Platform: in.Platform, })
PUid: in.PUid, if err != nil {
PInfo: "{}", return nil, errors.Wrapf(err, "查询或创建用户-事务执行失败, err:%+v", err)
}
if err = l.svcCtx.UserPlatformModel.Insert(l.ctx, dbPlatformUser); err != nil {
return nil, errors.Wrap(err, "插入平台用户数据失败")
} }
return &pb.PlatformUserResp{ return &pb.PlatformUserResp{
User: l.buildPBUser(dbUser.Username, dbPlatformUser), User: l.buildPBUser(username, dbPlatformUser),
}, nil }, nil
} }

@ -1,66 +0,0 @@
package statistics
import (
"context"
"github.com/pkg/errors"
"live-service/app/user_center/model"
"live-service/app/user_center/rpc/internal/svc"
"live-service/app/user_center/rpc/pb"
"github.com/zeromicro/go-zero/core/logx"
)
type StatPvpDamageLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewStatPvpDamageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StatPvpDamageLogic {
return &StatPvpDamageLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// statistics
func (l *StatPvpDamageLogic) StatPvpDamage(in *pb.StatPvPDamageReq) (*pb.Empty, error) {
damage64 := int64(in.Damage)
exists, _ := l.svcCtx.StatisticsPvpModel.Exists(l.ctx, in.Uid)
if !exists {
dbModel := &model.StatisticsPvp{
UserId: in.Uid,
Damage: damage64,
}
if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, dbModel); err != nil {
return nil, errors.Wrapf(err, ErrInsertErr, err)
}
return &pb.Empty{}, nil
}
// 原始记录存在,直接更新,提高效率
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, in.Uid, &model.UpdateRecordProps{Damage: &damage64}); err != nil {
return nil, errors.Wrapf(err, ErrUpdateErr, err)
}
// 承伤
if in.TargetUid != nil {
tUid := *in.TargetUid
exists, _ = l.svcCtx.StatisticsPvpModel.Exists(l.ctx, tUid)
if !exists {
dbModel := &model.StatisticsPvp{
UserId: tUid,
DeDamage: int64(in.Damage),
}
if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, dbModel); err != nil {
return nil, errors.Wrapf(err, ErrInsertErr, err)
}
return &pb.Empty{}, nil
}
// 原始记录存在,直接更新,提高效率
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tUid, &model.UpdateRecordProps{DeDamage: &damage64}); err != nil {
return nil, errors.Wrapf(err, ErrUpdateErr, err)
}
}
return &pb.Empty{}, nil
}

@ -3,6 +3,7 @@ package statistics
import ( import (
"context" "context"
"github.com/pkg/errors" "github.com/pkg/errors"
"gorm.io/gorm"
"live-service/app/user_center/model" "live-service/app/user_center/model"
"live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/internal/svc"
"live-service/app/user_center/rpc/pb" "live-service/app/user_center/rpc/pb"
@ -30,33 +31,42 @@ const (
) )
func (l *StatPvpFirstBloodLogic) StatPvpFirstBlood(in *pb.StatPvPFirstBloodReq) (*pb.Empty, error) { func (l *StatPvpFirstBloodLogic) StatPvpFirstBlood(in *pb.StatPvPFirstBloodReq) (*pb.Empty, error) {
exists, _ := l.svcCtx.StatisticsPvpModel.Exists(l.ctx, in.Uid) // 虚拟UID
if !exists { if in.Uid <= 0 {
dbModel := &model.StatisticsPvp{ return &pb.Empty{}, nil
UserId: in.Uid, }
} err := l.svcCtx.StatisticsPvpModel.Transaction(l.ctx, nil, func(tx *gorm.DB) error {
// 直接更新,提高效率
props := model.UpdateRecordProps{}
if in.Type == TypeFirstBlood { if in.Type == TypeFirstBlood {
dbModel.FirstBloodCount = 1 props.FirstBlood = true
} else if in.Type == TypeDeFirstBlood { } else if in.Type == TypeDeFirstBlood {
dbModel.DeFirstBloodCount = 1 props.DeFirstBlood = true
} }
if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, dbModel); err != nil {
return nil, errors.Wrapf(err, ErrInsertErr, err) if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, in.Uid,
&props); err != nil {
if errors.Is(err, model.ErrRowsAffectedZero) {
// insert
dbModel := model.StatisticsPvp{
UserId: in.Uid,
}
if in.Type == TypeFirstBlood {
dbModel.FirstBloodCount = 1
} else if in.Type == TypeDeFirstBlood {
dbModel.DeFirstBloodCount = 1
}
if err = l.svcCtx.StatisticsPvpModel.InsertTx(l.ctx, tx, &dbModel); err != nil {
return errors.Wrapf(err, ErrInsertErr, err)
}
} else {
return errors.Wrapf(err, ErrUpdateErr, err)
}
} }
return &pb.Empty{}, nil return nil
} })
// 原始记录存在,直接更新,提高效率 if err != nil {
props := &model.UpdateRecordProps{} return nil, errors.Wrapf(err, "一血报送-事务执行失败, err:%+v", err)
if in.Type == TypeFirstBlood {
props.FirstBlood = true
} else if in.Type == TypeDeFirstBlood {
props.DeFirstBlood = true
} else {
l.Logger.Error("是否拿到一血 Type 有问题不是1或2?")
return &pb.Empty{}, nil
}
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, in.Uid, props); err != nil {
return nil, errors.Wrapf(err, ErrUpdateErr, err)
} }
return &pb.Empty{}, nil return &pb.Empty{}, nil
} }

@ -3,6 +3,7 @@ package statistics
import ( import (
"context" "context"
"github.com/pkg/errors" "github.com/pkg/errors"
"gorm.io/gorm"
"live-service/app/user_center/model" "live-service/app/user_center/model"
"live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/internal/svc"
@ -26,44 +27,58 @@ func NewStatPvpKillLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StatP
} }
func (l *StatPvpKillLogic) StatPvpKill(in *pb.StatPvPKillReq) (*pb.Empty, error) { func (l *StatPvpKillLogic) StatPvpKill(in *pb.StatPvPKillReq) (*pb.Empty, error) {
exists, _ := l.svcCtx.StatisticsPvpModel.Exists(l.ctx, in.Uid) // 虚拟UID
if !exists { if in.Uid <= 0 {
dbModel := &model.StatisticsPvp{
UserId: in.Uid,
KillPlayerCount: 1,
}
if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, dbModel); err != nil {
return nil, errors.Wrapf(err, ErrInsertErr, err)
}
return &pb.Empty{}, nil return &pb.Empty{}, nil
} }
props := model.UpdateRecordProps{}
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, in.Uid, &props); err != nil { err := l.svcCtx.StatisticsPvpModel.Transaction(l.ctx, nil, func(tx *gorm.DB) error {
return nil, errors.Wrapf(err, ErrUpdateErr, err) // 击杀
} props := model.UpdateRecordProps{
// 被杀 KillPlayer: true,
exists, _ = l.svcCtx.StatisticsPvpModel.Exists(l.ctx, in.TargetUid)
if !exists {
dbModel := &model.StatisticsPvp{
UserId: in.TargetUid,
DeKillUnitCount: 1,
} }
if in.IsGeneral { if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, in.Uid, &props); err != nil {
dbModel.DeGeneralCount = 1 if errors.Is(err, model.ErrRowsAffectedZero) {
dbModel := &model.StatisticsPvp{
UserId: in.Uid,
KillPlayerCount: 1,
}
if err := l.svcCtx.StatisticsPvpModel.InsertTx(l.ctx, tx, dbModel); err != nil {
return errors.Wrapf(err, ErrInsertErr, err)
}
} else {
return errors.Wrapf(err, ErrUpdateErr, err)
}
} }
if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, dbModel); err != nil { // 被杀 + 落马否
return nil, errors.Wrapf(err, ErrInsertErr, err) // 虚拟UID
if in.TargetUid <= 0 {
return nil
} }
return &pb.Empty{}, nil props = model.UpdateRecordProps{
} DeKillPlayer: true,
props = model.UpdateRecordProps{ DeGeneral: in.IsGeneral,
DeKillPlayer: true, }
} if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, in.TargetUid, &props); err != nil {
if in.IsGeneral { if errors.Is(err, model.ErrRowsAffectedZero) {
props.DeGeneral = true dbModel := &model.StatisticsPvp{
} UserId: in.TargetUid,
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, in.TargetUid, &props); err != nil { DeKillUnitCount: 1,
return nil, errors.Wrapf(err, ErrUpdateErr, err) }
if in.IsGeneral {
dbModel.DeGeneralCount = 1
}
if err := l.svcCtx.StatisticsPvpModel.InsertTx(l.ctx, tx, dbModel); err != nil {
return errors.Wrapf(err, ErrInsertErr, err)
}
} else {
return errors.Wrapf(err, ErrUpdateErr, err)
}
}
return nil
})
if err != nil {
return nil, errors.Wrapf(err, "击杀玩家-事务执行失败, err:%+v", err)
} }
return &pb.Empty{}, nil return &pb.Empty{}, nil
} }

@ -1,65 +0,0 @@
package statistics
import (
"context"
"github.com/pkg/errors"
"live-service/app/user_center/model"
"live-service/app/user_center/rpc/internal/svc"
"live-service/app/user_center/rpc/pb"
"github.com/zeromicro/go-zero/core/logx"
)
type StatPvpKillUnitLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewStatPvpKillUnitLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StatPvpKillUnitLogic {
return &StatPvpKillUnitLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *StatPvpKillUnitLogic) StatPvpKillUnit(in *pb.StatPvPKillUnitReq) (*pb.Empty, error) {
exists, _ := l.svcCtx.StatisticsPvpModel.Exists(l.ctx, in.Uid)
if !exists {
dbModel := &model.StatisticsPvp{
UserId: in.Uid,
KillUnitCount: 1,
}
if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, dbModel); err != nil {
return nil, errors.Wrapf(err, ErrInsertErr, err)
}
return &pb.Empty{}, nil
}
// 原始记录存在,直接更新,提高效率
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, in.Uid, &model.UpdateRecordProps{KillUnit: true}); err != nil {
return nil, errors.Wrapf(err, ErrUpdateErr, err)
}
// 被击杀
if in.TargetUid != nil {
tUid := *in.TargetUid
exists, _ = l.svcCtx.StatisticsPvpModel.Exists(l.ctx, tUid)
if !exists {
dbModel := &model.StatisticsPvp{
UserId: tUid,
DeKillUnitCount: 1,
}
if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, dbModel); err != nil {
return nil, errors.Wrapf(err, ErrInsertErr, err)
}
return &pb.Empty{}, nil
}
// 原始记录存在,直接更新,提高效率
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tUid, &model.UpdateRecordProps{DeKillUnit: true}); err != nil {
return nil, errors.Wrapf(err, ErrUpdateErr, err)
}
}
return &pb.Empty{}, nil
}

@ -3,12 +3,11 @@ package statistics
import ( import (
"context" "context"
"github.com/pkg/errors" "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/model"
"live-service/app/user_center/rpc/internal/svc" "live-service/app/user_center/rpc/internal/svc"
"live-service/app/user_center/rpc/pb" "live-service/app/user_center/rpc/pb"
"github.com/zeromicro/go-zero/core/logx"
) )
type StatPvpReportLogic struct { type StatPvpReportLogic struct {
@ -26,25 +25,81 @@ func NewStatPvpReportLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Sta
} }
func (l *StatPvpReportLogic) StatPvpReport(in *pb.StatPvPReportReq) (*pb.Empty, error) { func (l *StatPvpReportLogic) StatPvpReport(in *pb.StatPvPReportReq) (*pb.Empty, error) {
// 名将 // 虚拟UID
exists, _ := l.svcCtx.StatisticsPvpModel.Exists(l.ctx, in.GeneralUid) if in.GeneralUid <= 0 {
if !exists {
dbModel := &model.StatisticsPvp{
UserId: in.GeneralUid,
GeneralCount: 1,
}
if err := l.svcCtx.StatisticsPvpModel.Insert(l.ctx, dbModel); err != nil {
return nil, errors.Wrapf(err, ErrInsertErr, err)
}
return &pb.Empty{}, nil return &pb.Empty{}, nil
} }
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, in.GeneralUid, &model.UpdateRecordProps{General: true}); err != nil {
return nil, errors.Wrapf(err, ErrUpdateErr, err) 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 err := l.svcCtx.StatisticsPvpModel.RecordPvp(l.ctx, in.WinUids, in.LostUids); err != nil { if errors.Is(err, model.ErrRowsAffectedZero) {
return nil, errors.Wrapf(err, ErrUpdateErr, err) // 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)
}
}
// 获胜记录
if err := l.reports(tx, true, in.WinItems); err != nil {
return errors.Wrapf(err, "获胜PvP记录失败: %+v", err)
}
// 战败记录
if err := l.reports(tx, false, in.LostItems); err != nil {
return errors.Wrapf(err, "获胜PvP记录失败: %+v", err)
}
return nil
})
if err != nil {
return nil, errors.Wrapf(err, "PvP战报-事务执行失败 err: %+v", err)
} }
return &pb.Empty{}, nil return &pb.Empty{}, 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 {
for _, item := range items {
if err := l.svcCtx.StatisticsPvpModel.UpdateRecord(l.ctx, tx, item.Uid,
&model.UpdateRecordProps{
Win: win,
Lost: !win,
Damage: &item.Damage,
DeDamage: &item.DeDamage,
KillUnitCount: &item.KillUnit,
DeKillUnitCount: &item.DeKillUnit,
}); err != nil {
if errors.Is(err, model.ErrRowsAffectedZero) {
// insert
var winCount int64
var lostCount int64
if win {
winCount = 1
} else {
lostCount = 1
}
if err = l.svcCtx.StatisticsPvpModel.InsertTx(l.ctx, tx, &model.StatisticsPvp{
UserId: item.Uid,
WinCount: winCount,
LostCount: lostCount,
Damage: item.Damage,
DeDamage: item.DeDamage,
KillUnitCount: item.KillUnit,
DeKillUnitCount: item.DeKillUnit,
}); err != nil {
return errors.Wrapf(err, ErrInsertErr, err)
}
} else {
return errors.Wrapf(err, ErrUpdateErr, err)
}
}
}
return nil
})
}

@ -31,16 +31,6 @@ func (s *UserCenterServer) RetrievePlatformUser(ctx context.Context, in *pb.Plat
} }
// statistics // statistics
func (s *UserCenterServer) StatPvpDamage(ctx context.Context, in *pb.StatPvPDamageReq) (*pb.Empty, error) {
l := statistics.NewStatPvpDamageLogic(ctx, s.svcCtx)
return l.StatPvpDamage(in)
}
func (s *UserCenterServer) StatPvpKillUnit(ctx context.Context, in *pb.StatPvPKillUnitReq) (*pb.Empty, error) {
l := statistics.NewStatPvpKillUnitLogic(ctx, s.svcCtx)
return l.StatPvpKillUnit(in)
}
func (s *UserCenterServer) StatPvpKill(ctx context.Context, in *pb.StatPvPKillReq) (*pb.Empty, error) { func (s *UserCenterServer) StatPvpKill(ctx context.Context, in *pb.StatPvPKillReq) (*pb.Empty, error) {
l := statistics.NewStatPvpKillLogic(ctx, s.svcCtx) l := statistics.NewStatPvpKillLogic(ctx, s.svcCtx)
return l.StatPvpKill(in) return l.StatPvpKill(in)

@ -26,7 +26,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
log.New(os.Stdout, "\r\n", log.LstdFlags), log.New(os.Stdout, "\r\n", log.LstdFlags),
logger.Config{ logger.Config{
SlowThreshold: 1 * time.Second, SlowThreshold: 1 * time.Second,
LogLevel: logger.Warn, LogLevel: logger.Info,
IgnoreRecordNotFoundError: true, IgnoreRecordNotFoundError: true,
Colorful: true, Colorful: true,
}, },

@ -258,142 +258,6 @@ func (x *PlatformUserResp) GetUser() *User {
return nil return nil
} }
// 通知-PvP伤害 statistics.pvp.damage
type StatPvPDamageReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 造成伤害的用户ID
TargetUid *int64 `protobuf:"varint,2,opt,name=targetUid,proto3,oneof" json:"targetUid,omitempty"` // 目标用户ID可能是基地不一定有
Damage float32 `protobuf:"fixed32,3,opt,name=damage,proto3" json:"damage,omitempty"` // 伤害量
}
func (x *StatPvPDamageReq) Reset() {
*x = StatPvPDamageReq{}
if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StatPvPDamageReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatPvPDamageReq) ProtoMessage() {}
func (x *StatPvPDamageReq) 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 StatPvPDamageReq.ProtoReflect.Descriptor instead.
func (*StatPvPDamageReq) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{4}
}
func (x *StatPvPDamageReq) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *StatPvPDamageReq) GetTargetUid() int64 {
if x != nil && x.TargetUid != nil {
return *x.TargetUid
}
return 0
}
func (x *StatPvPDamageReq) GetDamage() float32 {
if x != nil {
return x.Damage
}
return 0
}
// 通知-PvP击杀单位 statistics.pvp.killunit
type StatPvPKillUnitReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID
TargetUid *int64 `protobuf:"varint,2,opt,name=targetUid,proto3,oneof" json:"targetUid,omitempty"` // 目标用户
Attacker string `protobuf:"bytes,3,opt,name=attacker,proto3" json:"attacker,omitempty"` // 造成击杀东西building:兵营 U0001:xxx兵 S0001: 技能)
Victim string `protobuf:"bytes,4,opt,name=victim,proto3" json:"victim,omitempty"` // 被击杀的东西U0001:xxx兵
}
func (x *StatPvPKillUnitReq) Reset() {
*x = StatPvPKillUnitReq{}
if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StatPvPKillUnitReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatPvPKillUnitReq) ProtoMessage() {}
func (x *StatPvPKillUnitReq) ProtoReflect() protoreflect.Message {
mi := &file_user_center_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatPvPKillUnitReq.ProtoReflect.Descriptor instead.
func (*StatPvPKillUnitReq) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{5}
}
func (x *StatPvPKillUnitReq) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *StatPvPKillUnitReq) GetTargetUid() int64 {
if x != nil && x.TargetUid != nil {
return *x.TargetUid
}
return 0
}
func (x *StatPvPKillUnitReq) GetAttacker() string {
if x != nil {
return x.Attacker
}
return ""
}
func (x *StatPvPKillUnitReq) GetVictim() string {
if x != nil {
return x.Victim
}
return ""
}
// 通知-PvP杀兵营(人) statistics.pvp.kill // 通知-PvP杀兵营(人) statistics.pvp.kill
type StatPvPKillReq struct { type StatPvPKillReq struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -408,7 +272,7 @@ type StatPvPKillReq struct {
func (x *StatPvPKillReq) Reset() { func (x *StatPvPKillReq) Reset() {
*x = StatPvPKillReq{} *x = StatPvPKillReq{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[6] mi := &file_user_center_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -421,7 +285,7 @@ func (x *StatPvPKillReq) String() string {
func (*StatPvPKillReq) ProtoMessage() {} func (*StatPvPKillReq) ProtoMessage() {}
func (x *StatPvPKillReq) ProtoReflect() protoreflect.Message { func (x *StatPvPKillReq) ProtoReflect() protoreflect.Message {
mi := &file_user_center_proto_msgTypes[6] mi := &file_user_center_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -434,7 +298,7 @@ func (x *StatPvPKillReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatPvPKillReq.ProtoReflect.Descriptor instead. // Deprecated: Use StatPvPKillReq.ProtoReflect.Descriptor instead.
func (*StatPvPKillReq) Descriptor() ([]byte, []int) { func (*StatPvPKillReq) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{6} return file_user_center_proto_rawDescGZIP(), []int{4}
} }
func (x *StatPvPKillReq) GetUid() int64 { func (x *StatPvPKillReq) GetUid() int64 {
@ -471,7 +335,7 @@ type StatPvPFirstBloodReq struct {
func (x *StatPvPFirstBloodReq) Reset() { func (x *StatPvPFirstBloodReq) Reset() {
*x = StatPvPFirstBloodReq{} *x = StatPvPFirstBloodReq{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[7] mi := &file_user_center_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -484,7 +348,7 @@ func (x *StatPvPFirstBloodReq) String() string {
func (*StatPvPFirstBloodReq) ProtoMessage() {} func (*StatPvPFirstBloodReq) ProtoMessage() {}
func (x *StatPvPFirstBloodReq) ProtoReflect() protoreflect.Message { func (x *StatPvPFirstBloodReq) ProtoReflect() protoreflect.Message {
mi := &file_user_center_proto_msgTypes[7] mi := &file_user_center_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -497,7 +361,7 @@ func (x *StatPvPFirstBloodReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatPvPFirstBloodReq.ProtoReflect.Descriptor instead. // Deprecated: Use StatPvPFirstBloodReq.ProtoReflect.Descriptor instead.
func (*StatPvPFirstBloodReq) Descriptor() ([]byte, []int) { func (*StatPvPFirstBloodReq) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{7} return file_user_center_proto_rawDescGZIP(), []int{5}
} }
func (x *StatPvPFirstBloodReq) GetUid() int64 { func (x *StatPvPFirstBloodReq) GetUid() int64 {
@ -520,16 +384,16 @@ type StatPvPReportReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
WinCamp int32 `protobuf:"varint,1,opt,name=winCamp,proto3" json:"winCamp,omitempty"` // 获胜阵营 1-蓝 2-红 WinCamp int32 `protobuf:"varint,1,opt,name=winCamp,proto3" json:"winCamp,omitempty"` // 获胜阵营 1-蓝 2-红
GeneralUid int64 `protobuf:"varint,2,opt,name=generalUid,proto3" json:"generalUid,omitempty"` // 名将UID GeneralUid int64 `protobuf:"varint,2,opt,name=generalUid,proto3" json:"generalUid,omitempty"` // 名将UID
WinUids []int64 `protobuf:"varint,3,rep,packed,name=winUids,proto3" json:"winUids,omitempty"` // 战胜方玩家列表 WinItems []*StatPvPReportReq_Item `protobuf:"bytes,3,rep,name=winItems,proto3" json:"winItems,omitempty"` // 获胜方数据
LostUids []int64 `protobuf:"varint,4,rep,packed,name=lostUids,proto3" json:"lostUids,omitempty"` // 战败方玩家列表 LostItems []*StatPvPReportReq_Item `protobuf:"bytes,4,rep,name=lostItems,proto3" json:"lostItems,omitempty"` // 战败方数据
} }
func (x *StatPvPReportReq) Reset() { func (x *StatPvPReportReq) Reset() {
*x = StatPvPReportReq{} *x = StatPvPReportReq{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[8] mi := &file_user_center_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -542,7 +406,7 @@ func (x *StatPvPReportReq) String() string {
func (*StatPvPReportReq) ProtoMessage() {} func (*StatPvPReportReq) ProtoMessage() {}
func (x *StatPvPReportReq) ProtoReflect() protoreflect.Message { func (x *StatPvPReportReq) ProtoReflect() protoreflect.Message {
mi := &file_user_center_proto_msgTypes[8] mi := &file_user_center_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -555,7 +419,7 @@ func (x *StatPvPReportReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatPvPReportReq.ProtoReflect.Descriptor instead. // Deprecated: Use StatPvPReportReq.ProtoReflect.Descriptor instead.
func (*StatPvPReportReq) Descriptor() ([]byte, []int) { func (*StatPvPReportReq) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{8} return file_user_center_proto_rawDescGZIP(), []int{6}
} }
func (x *StatPvPReportReq) GetWinCamp() int32 { func (x *StatPvPReportReq) GetWinCamp() int32 {
@ -572,16 +436,16 @@ func (x *StatPvPReportReq) GetGeneralUid() int64 {
return 0 return 0
} }
func (x *StatPvPReportReq) GetWinUids() []int64 { func (x *StatPvPReportReq) GetWinItems() []*StatPvPReportReq_Item {
if x != nil { if x != nil {
return x.WinUids return x.WinItems
} }
return nil return nil
} }
func (x *StatPvPReportReq) GetLostUids() []int64 { func (x *StatPvPReportReq) GetLostItems() []*StatPvPReportReq_Item {
if x != nil { if x != nil {
return x.LostUids return x.LostItems
} }
return nil return nil
} }
@ -599,7 +463,7 @@ type RankPvpReq struct {
func (x *RankPvpReq) Reset() { func (x *RankPvpReq) Reset() {
*x = RankPvpReq{} *x = RankPvpReq{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[9] mi := &file_user_center_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -612,7 +476,7 @@ func (x *RankPvpReq) String() string {
func (*RankPvpReq) ProtoMessage() {} func (*RankPvpReq) ProtoMessage() {}
func (x *RankPvpReq) ProtoReflect() protoreflect.Message { func (x *RankPvpReq) ProtoReflect() protoreflect.Message {
mi := &file_user_center_proto_msgTypes[9] mi := &file_user_center_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -625,7 +489,7 @@ func (x *RankPvpReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use RankPvpReq.ProtoReflect.Descriptor instead. // Deprecated: Use RankPvpReq.ProtoReflect.Descriptor instead.
func (*RankPvpReq) Descriptor() ([]byte, []int) { func (*RankPvpReq) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{9} return file_user_center_proto_rawDescGZIP(), []int{7}
} }
func (x *RankPvpReq) GetType() int32 { func (x *RankPvpReq) GetType() int32 {
@ -654,7 +518,7 @@ type RankPvpResp struct {
func (x *RankPvpResp) Reset() { func (x *RankPvpResp) Reset() {
*x = RankPvpResp{} *x = RankPvpResp{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[10] mi := &file_user_center_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -667,7 +531,7 @@ func (x *RankPvpResp) String() string {
func (*RankPvpResp) ProtoMessage() {} func (*RankPvpResp) ProtoMessage() {}
func (x *RankPvpResp) ProtoReflect() protoreflect.Message { func (x *RankPvpResp) ProtoReflect() protoreflect.Message {
mi := &file_user_center_proto_msgTypes[10] mi := &file_user_center_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -680,7 +544,7 @@ func (x *RankPvpResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use RankPvpResp.ProtoReflect.Descriptor instead. // Deprecated: Use RankPvpResp.ProtoReflect.Descriptor instead.
func (*RankPvpResp) Descriptor() ([]byte, []int) { func (*RankPvpResp) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{10} return file_user_center_proto_rawDescGZIP(), []int{8}
} }
func (x *RankPvpResp) GetType() int32 { func (x *RankPvpResp) GetType() int32 {
@ -697,6 +561,85 @@ func (x *RankPvpResp) GetItems() []*RankPvpResp_Item {
return nil return nil
} }
type StatPvPReportReq_Item struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID
Damage int64 `protobuf:"varint,2,opt,name=damage,proto3" json:"damage,omitempty"` // 伤害量
DeDamage int64 `protobuf:"varint,3,opt,name=deDamage,proto3" json:"deDamage,omitempty"` // 承受伤害
KillUnit int64 `protobuf:"varint,4,opt,name=killUnit,proto3" json:"killUnit,omitempty"` // 击杀单位数量
DeKillUnit int64 `protobuf:"varint,5,opt,name=deKillUnit,proto3" json:"deKillUnit,omitempty"` // 被杀单位数量
}
func (x *StatPvPReportReq_Item) Reset() {
*x = StatPvPReportReq_Item{}
if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StatPvPReportReq_Item) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatPvPReportReq_Item) ProtoMessage() {}
func (x *StatPvPReportReq_Item) 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 StatPvPReportReq_Item.ProtoReflect.Descriptor instead.
func (*StatPvPReportReq_Item) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{6, 0}
}
func (x *StatPvPReportReq_Item) GetUid() int64 {
if x != nil {
return x.Uid
}
return 0
}
func (x *StatPvPReportReq_Item) GetDamage() int64 {
if x != nil {
return x.Damage
}
return 0
}
func (x *StatPvPReportReq_Item) GetDeDamage() int64 {
if x != nil {
return x.DeDamage
}
return 0
}
func (x *StatPvPReportReq_Item) GetKillUnit() int64 {
if x != nil {
return x.KillUnit
}
return 0
}
func (x *StatPvPReportReq_Item) GetDeKillUnit() int64 {
if x != nil {
return x.DeKillUnit
}
return 0
}
type RankPvpResp_Item struct { type RankPvpResp_Item struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -711,7 +654,7 @@ type RankPvpResp_Item struct {
func (x *RankPvpResp_Item) Reset() { func (x *RankPvpResp_Item) Reset() {
*x = RankPvpResp_Item{} *x = RankPvpResp_Item{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_user_center_proto_msgTypes[11] mi := &file_user_center_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -724,7 +667,7 @@ func (x *RankPvpResp_Item) String() string {
func (*RankPvpResp_Item) ProtoMessage() {} func (*RankPvpResp_Item) ProtoMessage() {}
func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message { func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message {
mi := &file_user_center_proto_msgTypes[11] mi := &file_user_center_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -737,7 +680,7 @@ func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message {
// Deprecated: Use RankPvpResp_Item.ProtoReflect.Descriptor instead. // Deprecated: Use RankPvpResp_Item.ProtoReflect.Descriptor instead.
func (*RankPvpResp_Item) Descriptor() ([]byte, []int) { func (*RankPvpResp_Item) Descriptor() ([]byte, []int) {
return file_user_center_proto_rawDescGZIP(), []int{10, 0} return file_user_center_proto_rawDescGZIP(), []int{8, 0}
} }
func (x *RankPvpResp_Item) GetUid() int64 { func (x *RankPvpResp_Item) GetUid() int64 {
@ -791,66 +734,56 @@ var file_user_center_proto_rawDesc = []byte{
0x22, 0x30, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 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, 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, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73,
0x65, 0x72, 0x22, 0x6d, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x44, 0x61, 0x6d, 0x65, 0x72, 0x22, 0x5e, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c,
0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
0x65, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65,
0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x74, 0x55, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,
0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x64, 0x61, 0x6d, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72,
0x61, 0x67, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x61, 0x6c, 0x22, 0x3c, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x46, 0x69, 0x72,
0x64, 0x22, 0x8b, 0x01, 0x0a, 0x12, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
0x6c, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x22, 0xc7, 0x02, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f,
0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70,
0x08, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x12,
0x08, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x69, 0x63, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20,
0x74, 0x69, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x69, 0x63, 0x74, 0x69, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x12,
0x6d, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x22, 0x35, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
0x5e, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65,
0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x77, 0x69,
0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x37, 0x0a, 0x09, 0x6c, 0x6f, 0x73, 0x74, 0x49, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x53,
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x2e,
0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x22, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x09, 0x6c, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x1a,
0x3c, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x88, 0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18,
0x6c, 0x6f, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x61,
0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x64, 0x61, 0x6d, 0x61,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x82, 0x01, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03,
0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x65, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1a,
0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x0a, 0x08, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x52, 0x08, 0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65,
0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a,
0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x22, 0x34, 0x0a, 0x0a, 0x52, 0x61,
0x77, 0x69, 0x6e, 0x55, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x77, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
0x69, 0x6e, 0x55, 0x69, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x73, 0x74, 0x55, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x6f, 0x73, 0x74, 0x55, 0x69, 0x74, 0x6f, 0x70, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e,
0x64, 0x73, 0x22, 0x34, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x71, 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, 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, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20,
0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x22, 0xab, 0x01, 0x0a, 0x0b, 0x52, 0x61, 0x6e, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70,
0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x1a, 0x5c, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18,
0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e,
0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65,
0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x5c, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72,
0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x32, 0x95,
0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x02, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x16, 0x14, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72,
0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66,
0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x32, 0xfd, 0x02, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x14, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
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, 0x30, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74,
0x50, 0x76, 0x70, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x53,
0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a,
0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x0f, 0x73, 0x74,
0x61, 0x74, 0x50, 0x76, 0x70, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x16, 0x2e,
0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e,
0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x12, 0x2c, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x50, 0x76, 0x70, 0x4b, 0x69, 0x6c, 0x6c, 0x12, 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, 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, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x38,
@ -879,43 +812,40 @@ func file_user_center_proto_rawDescGZIP() []byte {
return file_user_center_proto_rawDescData return file_user_center_proto_rawDescData
} }
var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_user_center_proto_goTypes = []interface{}{ var file_user_center_proto_goTypes = []interface{}{
(*User)(nil), // 0: pb.User (*User)(nil), // 0: pb.User
(*Empty)(nil), // 1: pb.Empty (*Empty)(nil), // 1: pb.Empty
(*PlatformUserReq)(nil), // 2: pb.PlatformUserReq (*PlatformUserReq)(nil), // 2: pb.PlatformUserReq
(*PlatformUserResp)(nil), // 3: pb.PlatformUserResp (*PlatformUserResp)(nil), // 3: pb.PlatformUserResp
(*StatPvPDamageReq)(nil), // 4: pb.StatPvPDamageReq (*StatPvPKillReq)(nil), // 4: pb.StatPvPKillReq
(*StatPvPKillUnitReq)(nil), // 5: pb.StatPvPKillUnitReq (*StatPvPFirstBloodReq)(nil), // 5: pb.StatPvPFirstBloodReq
(*StatPvPKillReq)(nil), // 6: pb.StatPvPKillReq (*StatPvPReportReq)(nil), // 6: pb.StatPvPReportReq
(*StatPvPFirstBloodReq)(nil), // 7: pb.StatPvPFirstBloodReq (*RankPvpReq)(nil), // 7: pb.RankPvpReq
(*StatPvPReportReq)(nil), // 8: pb.StatPvPReportReq (*RankPvpResp)(nil), // 8: pb.RankPvpResp
(*RankPvpReq)(nil), // 9: pb.RankPvpReq (*StatPvPReportReq_Item)(nil), // 9: pb.StatPvPReportReq.Item
(*RankPvpResp)(nil), // 10: pb.RankPvpResp (*RankPvpResp_Item)(nil), // 10: pb.RankPvpResp.Item
(*RankPvpResp_Item)(nil), // 11: pb.RankPvpResp.Item
} }
var file_user_center_proto_depIdxs = []int32{ var file_user_center_proto_depIdxs = []int32{
0, // 0: pb.PlatformUserResp.user:type_name -> pb.User 0, // 0: pb.PlatformUserResp.user:type_name -> pb.User
11, // 1: pb.RankPvpResp.items:type_name -> pb.RankPvpResp.Item 9, // 1: pb.StatPvPReportReq.winItems:type_name -> pb.StatPvPReportReq.Item
2, // 2: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq 9, // 2: pb.StatPvPReportReq.lostItems:type_name -> pb.StatPvPReportReq.Item
4, // 3: pb.userCenter.statPvpDamage:input_type -> pb.StatPvPDamageReq 10, // 3: pb.RankPvpResp.items:type_name -> pb.RankPvpResp.Item
5, // 4: pb.userCenter.statPvpKillUnit:input_type -> pb.StatPvPKillUnitReq 2, // 4: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq
6, // 5: pb.userCenter.statPvpKill:input_type -> pb.StatPvPKillReq 4, // 5: pb.userCenter.statPvpKill:input_type -> pb.StatPvPKillReq
7, // 6: pb.userCenter.statPvpFirstBlood:input_type -> pb.StatPvPFirstBloodReq 5, // 6: pb.userCenter.statPvpFirstBlood:input_type -> pb.StatPvPFirstBloodReq
8, // 7: pb.userCenter.statPvpReport:input_type -> pb.StatPvPReportReq 6, // 7: pb.userCenter.statPvpReport:input_type -> pb.StatPvPReportReq
9, // 8: pb.userCenter.rankPvp:input_type -> pb.RankPvpReq 7, // 8: pb.userCenter.rankPvp:input_type -> pb.RankPvpReq
3, // 9: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp 3, // 9: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp
1, // 10: pb.userCenter.statPvpDamage:output_type -> pb.Empty 1, // 10: pb.userCenter.statPvpKill:output_type -> pb.Empty
1, // 11: pb.userCenter.statPvpKillUnit:output_type -> pb.Empty 1, // 11: pb.userCenter.statPvpFirstBlood:output_type -> pb.Empty
1, // 12: pb.userCenter.statPvpKill:output_type -> pb.Empty 1, // 12: pb.userCenter.statPvpReport:output_type -> pb.Empty
1, // 13: pb.userCenter.statPvpFirstBlood:output_type -> pb.Empty 8, // 13: pb.userCenter.rankPvp:output_type -> pb.RankPvpResp
1, // 14: pb.userCenter.statPvpReport:output_type -> pb.Empty 9, // [9:14] is the sub-list for method output_type
10, // 15: pb.userCenter.rankPvp:output_type -> pb.RankPvpResp 4, // [4:9] is the sub-list for method input_type
9, // [9:16] is the sub-list for method output_type 4, // [4:4] is the sub-list for extension type_name
2, // [2:9] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension extendee
2, // [2:2] is the sub-list for extension type_name 0, // [0:4] is the sub-list for field type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
} }
func init() { file_user_center_proto_init() } func init() { file_user_center_proto_init() }
@ -973,7 +903,7 @@ func file_user_center_proto_init() {
} }
} }
file_user_center_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_user_center_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatPvPDamageReq); i { switch v := v.(*StatPvPKillReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -985,7 +915,7 @@ func file_user_center_proto_init() {
} }
} }
file_user_center_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_user_center_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatPvPKillUnitReq); i { switch v := v.(*StatPvPFirstBloodReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -997,7 +927,7 @@ func file_user_center_proto_init() {
} }
} }
file_user_center_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_user_center_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatPvPKillReq); i { switch v := v.(*StatPvPReportReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1009,7 +939,7 @@ func file_user_center_proto_init() {
} }
} }
file_user_center_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_user_center_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatPvPFirstBloodReq); i { switch v := v.(*RankPvpReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1021,7 +951,7 @@ func file_user_center_proto_init() {
} }
} }
file_user_center_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_user_center_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatPvPReportReq); i { switch v := v.(*RankPvpResp); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1033,7 +963,7 @@ func file_user_center_proto_init() {
} }
} }
file_user_center_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_user_center_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RankPvpReq); i { switch v := v.(*StatPvPReportReq_Item); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -1045,18 +975,6 @@ func file_user_center_proto_init() {
} }
} }
file_user_center_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { file_user_center_proto_msgTypes[10].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[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RankPvpResp_Item); i { switch v := v.(*RankPvpResp_Item); i {
case 0: case 0:
return &v.state return &v.state
@ -1069,15 +987,13 @@ func file_user_center_proto_init() {
} }
} }
} }
file_user_center_proto_msgTypes[4].OneofWrappers = []interface{}{}
file_user_center_proto_msgTypes[5].OneofWrappers = []interface{}{}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_user_center_proto_rawDesc, RawDescriptor: file_user_center_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 12, NumMessages: 11,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

@ -28,21 +28,6 @@ message PlatformUserResp {
User user = 1; User user = 1;
} }
// -PvP statistics.pvp.damage
message StatPvPDamageReq {
int64 uid = 1; // ID
optional int64 targetUid = 2; // ID
float damage = 3; //
}
// -PvP statistics.pvp.killunit
message StatPvPKillUnitReq {
int64 uid = 1; // ID
optional int64 targetUid = 2; //
string attacker = 3; // 西building: U0001:xxx S0001:
string victim = 4; // 西U0001:xxx
}
// -PvP( statistics.pvp.kill // -PvP( statistics.pvp.kill
message StatPvPKillReq { message StatPvPKillReq {
int64 uid = 1; // ID int64 uid = 1; // ID
@ -58,10 +43,17 @@ message StatPvPFirstBloodReq {
// -PvP statistics.pvp.report // -PvP statistics.pvp.report
message StatPvPReportReq { message StatPvPReportReq {
message Item {
int64 uid = 1; // ID
int64 damage = 2; //
int64 deDamage = 3; //
int64 killUnit = 4; //
int64 deKillUnit = 5; //
}
int32 winCamp = 1; // 1- 2- int32 winCamp = 1; // 1- 2-
int64 generalUid = 2; // UID int64 generalUid = 2; // UID
repeated int64 winUids = 3; // repeated Item winItems = 3; //
repeated int64 lostUids = 4; // repeated Item lostItems = 4; //
} }
// rank // rank
@ -86,8 +78,6 @@ service userCenter {
rpc retrievePlatformUser(PlatformUserReq) returns (PlatformUserResp); rpc retrievePlatformUser(PlatformUserReq) returns (PlatformUserResp);
// statistics // statistics
rpc statPvpDamage(StatPvPDamageReq) returns (Empty);
rpc statPvpKillUnit(StatPvPKillUnitReq) returns (Empty);
rpc statPvpKill(StatPvPKillReq) returns (Empty); rpc statPvpKill(StatPvPKillReq) returns (Empty);
rpc statPvpFirstBlood(StatPvPFirstBloodReq) returns (Empty); rpc statPvpFirstBlood(StatPvPFirstBloodReq) returns (Empty);
rpc statPvpReport(StatPvPReportReq) returns (Empty); rpc statPvpReport(StatPvPReportReq) returns (Empty);

@ -25,8 +25,6 @@ type UserCenterClient interface {
// user // user
RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error)
// statistics // statistics
StatPvpDamage(ctx context.Context, in *StatPvPDamageReq, opts ...grpc.CallOption) (*Empty, error)
StatPvpKillUnit(ctx context.Context, in *StatPvPKillUnitReq, opts ...grpc.CallOption) (*Empty, error)
StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error)
StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, 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) (*Empty, error)
@ -51,24 +49,6 @@ func (c *userCenterClient) RetrievePlatformUser(ctx context.Context, in *Platfor
return out, nil return out, nil
} }
func (c *userCenterClient) StatPvpDamage(ctx context.Context, in *StatPvPDamageReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpDamage", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userCenterClient) StatPvpKillUnit(ctx context.Context, in *StatPvPKillUnitReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpKillUnit", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userCenterClient) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) { func (c *userCenterClient) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty) out := new(Empty)
err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpKill", in, out, opts...) err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpKill", in, out, opts...)
@ -112,8 +92,6 @@ type UserCenterServer interface {
// user // user
RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error)
// statistics // statistics
StatPvpDamage(context.Context, *StatPvPDamageReq) (*Empty, error)
StatPvpKillUnit(context.Context, *StatPvPKillUnitReq) (*Empty, error)
StatPvpKill(context.Context, *StatPvPKillReq) (*Empty, error) StatPvpKill(context.Context, *StatPvPKillReq) (*Empty, error)
StatPvpFirstBlood(context.Context, *StatPvPFirstBloodReq) (*Empty, error) StatPvpFirstBlood(context.Context, *StatPvPFirstBloodReq) (*Empty, error)
StatPvpReport(context.Context, *StatPvPReportReq) (*Empty, error) StatPvpReport(context.Context, *StatPvPReportReq) (*Empty, error)
@ -129,12 +107,6 @@ type UnimplementedUserCenterServer struct {
func (UnimplementedUserCenterServer) RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) { func (UnimplementedUserCenterServer) RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method RetrievePlatformUser not implemented") return nil, status.Errorf(codes.Unimplemented, "method RetrievePlatformUser not implemented")
} }
func (UnimplementedUserCenterServer) StatPvpDamage(context.Context, *StatPvPDamageReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatPvpDamage not implemented")
}
func (UnimplementedUserCenterServer) StatPvpKillUnit(context.Context, *StatPvPKillUnitReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatPvpKillUnit not implemented")
}
func (UnimplementedUserCenterServer) StatPvpKill(context.Context, *StatPvPKillReq) (*Empty, error) { func (UnimplementedUserCenterServer) StatPvpKill(context.Context, *StatPvPKillReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatPvpKill not implemented") return nil, status.Errorf(codes.Unimplemented, "method StatPvpKill not implemented")
} }
@ -178,42 +150,6 @@ func _UserCenter_RetrievePlatformUser_Handler(srv interface{}, ctx context.Conte
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _UserCenter_StatPvpDamage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatPvPDamageReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserCenterServer).StatPvpDamage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.userCenter/statPvpDamage",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserCenterServer).StatPvpDamage(ctx, req.(*StatPvPDamageReq))
}
return interceptor(ctx, in, info, handler)
}
func _UserCenter_StatPvpKillUnit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatPvPKillUnitReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserCenterServer).StatPvpKillUnit(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.userCenter/statPvpKillUnit",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserCenterServer).StatPvpKillUnit(ctx, req.(*StatPvPKillUnitReq))
}
return interceptor(ctx, in, info, handler)
}
func _UserCenter_StatPvpKill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _UserCenter_StatPvpKill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatPvPKillReq) in := new(StatPvPKillReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -297,14 +233,6 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{
MethodName: "retrievePlatformUser", MethodName: "retrievePlatformUser",
Handler: _UserCenter_RetrievePlatformUser_Handler, Handler: _UserCenter_RetrievePlatformUser_Handler,
}, },
{
MethodName: "statPvpDamage",
Handler: _UserCenter_StatPvpDamage_Handler,
},
{
MethodName: "statPvpKillUnit",
Handler: _UserCenter_StatPvpKillUnit_Handler,
},
{ {
MethodName: "statPvpKill", MethodName: "statPvpKill",
Handler: _UserCenter_StatPvpKill_Handler, Handler: _UserCenter_StatPvpKill_Handler,

@ -27,10 +27,14 @@ func main() {
ctx := svc.NewServiceContext(c) ctx := svc.NewServiceContext(c)
svr := server.NewUserCenterServer(ctx) svr := server.NewUserCenterServer(ctx)
platformUserRetriever := platform_user.NewUserRetriever(ctx) if c.UserRetriever.Enabled {
platformUserRetriever.Scheduler() platformUserRetriever := platform_user.NewUserRetriever(ctx)
platformUserRetriever.Scheduler()
rank.InitRankJob(ctx) }
if c.Rank.Enabled {
rank.InitRankJob(ctx)
}
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
pb.RegisterUserCenterServer(grpcServer, svr) pb.RegisterUserCenterServer(grpcServer, svr)

@ -13,25 +13,22 @@ import (
) )
type ( type (
Empty = pb.Empty Empty = pb.Empty
PlatformUserReq = pb.PlatformUserReq PlatformUserReq = pb.PlatformUserReq
PlatformUserResp = pb.PlatformUserResp PlatformUserResp = pb.PlatformUserResp
RankPvpReq = pb.RankPvpReq RankPvpReq = pb.RankPvpReq
RankPvpResp = pb.RankPvpResp RankPvpResp = pb.RankPvpResp
RankPvpResp_Item = pb.RankPvpResp_Item RankPvpResp_Item = pb.RankPvpResp_Item
StatPvPDamageReq = pb.StatPvPDamageReq StatPvPFirstBloodReq = pb.StatPvPFirstBloodReq
StatPvPFirstBloodReq = pb.StatPvPFirstBloodReq StatPvPKillReq = pb.StatPvPKillReq
StatPvPKillReq = pb.StatPvPKillReq StatPvPReportReq = pb.StatPvPReportReq
StatPvPKillUnitReq = pb.StatPvPKillUnitReq StatPvPReportReq_Item = pb.StatPvPReportReq_Item
StatPvPReportReq = pb.StatPvPReportReq User = pb.User
User = pb.User
UserCenter interface { UserCenter interface {
// user // user
RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error)
// statistics // statistics
StatPvpDamage(ctx context.Context, in *StatPvPDamageReq, opts ...grpc.CallOption) (*Empty, error)
StatPvpKillUnit(ctx context.Context, in *StatPvPKillUnitReq, opts ...grpc.CallOption) (*Empty, error)
StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error)
StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, 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) (*Empty, error)
@ -57,16 +54,6 @@ func (m *defaultUserCenter) RetrievePlatformUser(ctx context.Context, in *Platfo
} }
// statistics // statistics
func (m *defaultUserCenter) StatPvpDamage(ctx context.Context, in *StatPvPDamageReq, opts ...grpc.CallOption) (*Empty, error) {
client := pb.NewUserCenterClient(m.cli.Conn())
return client.StatPvpDamage(ctx, in, opts...)
}
func (m *defaultUserCenter) StatPvpKillUnit(ctx context.Context, in *StatPvPKillUnitReq, opts ...grpc.CallOption) (*Empty, error) {
client := pb.NewUserCenterClient(m.cli.Conn())
return client.StatPvpKillUnit(ctx, in, opts...)
}
func (m *defaultUserCenter) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) { func (m *defaultUserCenter) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) {
client := pb.NewUserCenterClient(m.cli.Conn()) client := pb.NewUserCenterClient(m.cli.Conn())
return client.StatPvpKill(ctx, in, opts...) return client.StatPvpKill(ctx, in, opts...)

@ -17,6 +17,7 @@ require (
require ( require (
github.com/Shopify/sarama v1.32.0 // indirect github.com/Shopify/sarama v1.32.0 // indirect
github.com/VividCortex/mysqlerr v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-semver v0.3.0 // indirect

@ -59,6 +59,8 @@ github.com/Shopify/sarama v1.32.0/go.mod h1:+EmJJKZWVT/faR9RcOxJerP+LId4iWdQPBGL
github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= 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 h1:62YkpiP4bzdhKMH+6uC5E95y608k3zDwdzuBMsnn3uQ=
github.com/Shopify/toxiproxy/v2 v2.3.0/go.mod h1:KvQTtB6RjCJY4zqNJn7C7JDFgsG5uoHYDirfUfpIm0c= github.com/Shopify/toxiproxy/v2 v2.3.0/go.mod h1:KvQTtB6RjCJY4zqNJn7C7JDFgsG5uoHYDirfUfpIm0c=
github.com/VividCortex/mysqlerr v1.0.0 h1:5pZ2TZA+YnzPgzBfiUWGqWmKDVNBdrkf9g+DNe1Tiq8=
github.com/VividCortex/mysqlerr v1.0.0/go.mod h1:xERx8E4tBhLvpjzdUyQiSfUxeMcATEQrflDAfXsqcAE=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=

Loading…
Cancel
Save