更改任务key

This commit is contained in:
zhaocy 2022-07-21 16:25:16 +08:00
parent 49ae24219c
commit 2b59b99946
17 changed files with 184 additions and 136 deletions

View File

@ -11,9 +11,11 @@ import (
)
var LusScriptgetList = `
local key = tostring(KEYS[1])
local keyss = redis.call("HGETALL", key)
local data = {}
local n = 1
for i, v in ipairs(KEYS) do
for i, v in ipairs(keyss) do
if i%2 == 0 then
data[n] = redis.call("HGETALL", v)
n = n+1
@ -25,13 +27,13 @@ var res string
func TestMain(m *testing.M) {
if err := cache.OnInit(nil, cache.Set_Redis_Addr([]string{
"10.0.0.9:6986",
// "10.0.0.9:9001", "10.0.0.9:9002", "10.0.0.9:9003", "10.0.1.45:9004", "10.0.1.45:9005", "10.0.1.45:9006",
// "10.0.0.9:6986",
"10.0.0.9:9001", "10.0.0.9:9002",
}),
// cache.Set_Redis_Password(""),
cache.Set_Redis_Password("li13451234"),
cache.Set_Redis_DB(9),
cache.Set_Redis_IsCluster(false)); err != nil {
cache.Set_Redis_Password(""),
// cache.Set_Redis_Password("li13451234"),
// cache.Set_Redis_DB(0),
cache.Set_Redis_IsCluster(true)); err != nil {
fmt.Printf("err:%v\n", err)
return
}
@ -43,27 +45,25 @@ func TestMain(m *testing.M) {
}
defer os.Exit(m.Run())
}
func BenchmarkRedis(b *testing.B) {
uid := "0_62b18fce6d57b34781846f64"
heroRedisKey := fmt.Sprintf("hero_%s%s", uid, "{herotest}")
var (
// ncpu = runtime.NumCPU()
parallelisms = []int{4, 16, 64}
dataSizes = []int{100, 1000, 10000}
numKeys = 1024
keys = []string{
"hero:0_62d6131a3a719b898a90b5fb-62d6131a3a719b898a90b5fe",
"hero:0_62d6131a3a719b898a90b5fb-62d6131a3a719b898a90b600",
"hero:0_62d6131a3a719b898a90b5fb-62d661d6bca6eab554879fc6",
"hero:0_62d6131a3a719b898a90b5fb-62d6694dbca6eab554879fef",
// "hero:0_62bbf14cf88fbd265e61a121-62bbf1849d64e5ee7ff12529",
// "hero:0_62bbf364f88fbd265e61a122-62bbf5189b1970ed6b28b638",
// "hero:0_62bbf364f88fbd265e61a122-62bbf5189b1970ed6b28b63e",
// "hero:0_62bbf57346a32c12466c2e64-62bbf58d9b1970ed6b28b643",
}
// keys2 = []string{
// "hero:0_62bbf14cf88fbd265e61a121-62bbf1849d64e5ee7ff12529{yes}",
// "hero:0_62bbf364f88fbd265e61a122-62bbf5189b1970ed6b28b638{yes}",
// "hero:0_62bbf364f88fbd265e61a122-62bbf5189b1970ed6b28b63e{yes}",
// "hero:0_62bbf57346a32c12466c2e64-62bbf58d9b1970ed6b28b643{yes}",
key = heroRedisKey
// keys = []string{
// "hero:0_62d6131a3a719b898a90b5fb-62d6131a3a719b898a90b5fe",
// "hero:0_62d6131a3a719b898a90b5fb-62d6131a3a719b898a90b600",
// "hero:0_62d6131a3a719b898a90b5fb-62d661d6bca6eab554879fc6",
// "hero:0_62d6131a3a719b898a90b5fb-62d6694dbca6eab554879fef",
// // "hero:0_62bbf14cf88fbd265e61a121-62bbf1849d64e5ee7ff12529",
// // "hero:0_62bbf364f88fbd265e61a122-62bbf5189b1970ed6b28b638",
// // "hero:0_62bbf364f88fbd265e61a122-62bbf5189b1970ed6b28b63e",
// // "hero:0_62bbf57346a32c12466c2e64-62bbf58d9b1970ed6b28b643",
// }
builders = []TargetBuilder{
{
@ -72,10 +72,12 @@ func BenchmarkRedis(b *testing.B) {
return Target{
Get: func() {
ctx := context.Background()
keys, _ := cache.Redis().HGetAllToMapString(key)
// fmt.Println(keys)
for _, v := range keys {
ctx := context.Background()
cache.Redis().Pipeline(ctx, func(pipe redis.Pipeliner) error {
pipe.HGetAll(ctx, v)
pipe.HGetAll(ctx, v).Result()
_, err := pipe.Exec(ctx)
// fmt.Println(v)
return err
@ -91,7 +93,7 @@ func BenchmarkRedis(b *testing.B) {
return Target{
Get: func() {
if _, err := cache.Redis().EvalSha(context.Background(), res, keys).Result(); err != nil {
if _, err := cache.Redis().EvalSha(context.Background(), res, []string{key}).Result(); err != nil {
fmt.Println(err)
} else {
// fmt.Println(v)

View File

@ -92,7 +92,7 @@ var (
},
},
rsp: &pb.HeroStrengthenUpStarResp{},
enabled: true,
// enabled: true,
}
tcs = append(tcs, tc)
@ -103,7 +103,7 @@ var (
req: &pb.HeroStrengthenUplvReq{
HeroObjID: heroId,
ExpCards: map[string]int32{
"62d124700625e43054ba307d": 1,
heroId: 1,
},
},
rsp: &pb.HeroStrengthenUplvResp{},
@ -118,7 +118,7 @@ var (
req: &pb.HeroAwakenReq{
HeroObjID: heroId,
},
rsp: &pb.HeroAwakenResp{},
rsp: &pb.HeroAwakenResp{},
// enabled: true,
}
tcs = append(tcs, tc3)

View File

@ -17,10 +17,10 @@ var (
subType: task.TaskSubTypeList,
req: &pb.TaskListReq{
//设置任务类型
// TaskTag: int32(comm.TASK_DAILY), //每天任务
TaskTag: int32(comm.TASK_DAILY), //每天任务
// TaskTag: int32(comm.TASK_WEEKLY), //周任务
// TaskTag: int32(comm.TASK_ACHIEVE),
TaskTag: int32(comm.TASK_STRATEGY),
// TaskTag: int32(comm.TASK_STRATEGY),
},
rsp: &pb.TaskListResp{},
print: func(rsp proto.Message) {
@ -29,7 +29,7 @@ var (
fmt.Printf("%v \n", v)
}
},
// enabled: true,
enabled: true,
next: func(robot *Robot, rsp proto.Message) {
tcs := []*TestCase{}
if v, ok := rsp.(*pb.TaskListResp); ok {

View File

@ -73,7 +73,7 @@ var user_builders = []*TestCase{
subType: user.UserSubTypeVeriCode,
req: &pb.UserVeriCodeReq{},
rsp: &pb.UserVeriCodeResp{},
enabled: true,
// enabled: true,
next: func(robot *Robot, rsp proto.Message) {
if r, ok := rsp.(*pb.UserVeriCodeResp); ok {
tcs := []*TestCase{}

View File

@ -78,8 +78,6 @@ type (
}
//任务
ITask interface {
//初始化用户任务
InitTask(uid string, taskTag TaskTag)
//初始化 日常/周常/成就
InitTaskAll(uid string)
//清空任务

View File

@ -162,6 +162,10 @@ func (this *MCompModel) Start() (err error) {
return
}
func (this *MCompModel) setTableName(suffix string) {
this.TableName = fmt.Sprintf("%s_%s", this.TableName, suffix)
}
func (this *MCompModel) ukey(uid string) string {
return fmt.Sprintf("%s:%s", this.TableName, uid)
}

View File

@ -30,7 +30,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
}
utils.TraceFunc(session.GetUserId(), string(this.moduleTask.GetType()), TaskSubTypeReceive, req, resp)
}()
userTask := this.moduleTask.modelTask.getUserTask(session.GetUserId(), comm.TaskTag(req.TaskTag), req.Id)
userTask := this.moduleTask.modelTask.getUserTask(session.GetUserId(), req.Id)
if userTask != nil {
//判断是否完成
if userTask.Status == 0 {
@ -58,7 +58,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
update := map[string]interface{}{
"received": 1,
}
if err := this.moduleTask.modelTask.modifyUserTask(session.GetUserId(), comm.TaskTag(conf.IdTag), userTask.Id, update); err != nil {
if err := this.moduleTask.modelTask.modifyUserTask(session.GetUserId(), userTask.Id, update); err != nil {
code = pb.ErrorCode_DBError
return
}

View File

@ -130,6 +130,18 @@ func (this *configureComp) getTaskByTag(taskTag int32) (data []*cfg.Game_taskRou
return
}
func (this *configureComp) getTaskActiveList() (data []*cfg.Game_activeRewardData) {
conf, err := this.getActiveRewardCfg()
if err != nil {
log.Errorf("get conf err:%v", err)
return
}
if conf != nil {
data = conf.GetDataList()
}
return
}
//获取活跃度奖励list
func (this *configureComp) getTaskActiveByTag(taskTag int32) (data []*cfg.Game_activeRewardData, err error) {
conf, err := this.getActiveRewardCfg()

View File

@ -28,22 +28,19 @@ func (this *ModelTaskActive) Init(service core.IService, module core.IModule, co
}
//初始化活跃度
func (this *ModelTaskActive) initActiveRewardByTag(uid string, taskTag comm.TaskTag) {
data, err := this.moduleTask.configure.getTaskActiveByTag(int32(taskTag))
if err != nil {
log.Errorf("uid:%v tag:%v initActiveRewardByTag err %v", uid, taskTag, err)
return
}
func (this *ModelTaskActive) initActiveReward(uid string) {
data := this.moduleTask.configure.getTaskActiveList()
for _, conf := range data {
objId := primitive.NewObjectID().Hex()
ta := &pb.DBTaskActive{
Id: objId,
Uid: uid,
Tag: conf.IdTag,
RId: conf.Key,
}
if err := this.moduleTask.modelTaskActive.AddList(swapKey(uid, taskTag), ta.Id, ta); err != nil {
log.Errorf("uid:%v tag:%v initActiv add err %v", uid, taskTag, err)
if err := this.moduleTask.modelTaskActive.AddList(uid, ta.Id, ta); err != nil {
log.Errorf("uid:%v tag:%v initActiv add err %v", uid, err)
return
}
}
@ -52,10 +49,11 @@ func (this *ModelTaskActive) initActiveRewardByTag(uid string, taskTag comm.Task
//获取玩家活跃度列表
func (this *ModelTaskActive) getUserActiveList(uid string, taskTag comm.TaskTag) []*pb.DBTaskActive {
al := []*pb.DBTaskActive{}
if err := this.GetList(swapKey(uid, taskTag), &al); err != nil {
if err := this.GetList(uid, &al); err != nil {
log.Errorf("getUserActiveList err:%v", err)
return al
}
return al
}
@ -74,7 +72,7 @@ func (this *ModelTaskActive) updateReceive(uid, id string, taskTag comm.TaskTag,
if len(data) == 0 {
return
}
return this.moduleTask.modelTaskActive.ChangeList(swapKey(uid, taskTag), id, data)
return this.moduleTask.modelTaskActive.ChangeList(uid, id, data)
}
//领取处理
@ -111,7 +109,7 @@ func (this *ModelTaskActive) receiveHandle(uid, id string, conf *cfg.Game_active
func (this *ModelTaskActive) clearTask(uid string, taskTag comm.TaskTag) error {
data := this.getUserActiveList(uid, taskTag)
for _, v := range data {
if err := this.moduleTask.modelTaskActive.DelListlds(swapKey(uid, taskTag), v.Id); err != nil {
if err := this.moduleTask.modelTaskActive.DelListlds(uid, v.Id); err != nil {
log.Errorf("uid: %v taskTag:%v err:%v", uid, taskTag, err)
return err
}

View File

@ -28,33 +28,37 @@ func (this *ModelTask) Init(service core.IService, module core.IModule, comp cor
return
}
func swapKey(uid string, tag comm.TaskTag) string {
return fmt.Sprintf("%s_%v", uid, tag)
}
//获取玩家任务列表
func (this *ModelTask) getTaskList(uid string, taskTag comm.TaskTag) (list []*pb.DBTask) {
if err := this.GetList(swapKey(uid, taskTag), &list); err != nil {
log.Errorf("initTaskByTag err %v", err)
func (this *ModelTask) getTaskList(uid string, taskTag comm.TaskTag) (newlist []*pb.DBTask) {
list := []*pb.DBTask{}
if err := this.GetList(uid, &list); err != nil {
log.Errorf("getTaskList err %v", err)
return
}
for _, v := range list {
if v.Tag == int32(taskTag) {
newlist = append(newlist, v)
}
}
return
}
//初始化任务
func (this *ModelTask) initTaskByTag(uid string, taskTag comm.TaskTag) error {
if data, err := this.moduleTask.configure.getTaskByTag(int32(taskTag)); err == nil {
func (this *ModelTask) initTask(uid string) error {
if data, err := this.moduleTask.configure.getTaskList(); err == nil {
for _, cnf := range data {
objId := primitive.NewObjectID().Hex()
task := &pb.DBTask{
Id: objId,
Tag: cnf.IdTag,
Uid: uid,
TaskId: cnf.Key,
Active: cnf.Active,
Progress: cnf.ConditionSecond,
}
if err := this.AddList(swapKey(uid, taskTag), task.Id, task); err != nil {
log.Errorf("initTaskByTag addlists err %v", err)
if err := this.AddList(uid, task.Id, task); err != nil {
log.Errorf("initTask addlists err %v", err)
return err
}
}
@ -63,9 +67,9 @@ func (this *ModelTask) initTaskByTag(uid string, taskTag comm.TaskTag) error {
}
//查询用户任务
func (this *ModelTask) getUserTask(uid string, taskTag comm.TaskTag, taskId string) *pb.DBTask {
func (this *ModelTask) getUserTask(uid string, taskId string) *pb.DBTask {
userTask := &pb.DBTask{}
if err := this.moduleTask.modelTask.GetListObj(swapKey(uid, taskTag), taskId, userTask); err != nil {
if err := this.moduleTask.modelTask.GetListObj(uid, taskId, userTask); err != nil {
log.Errorf("getUserTask err:%v", err)
return nil
}
@ -107,8 +111,8 @@ func (this *ModelTask) checkTaskProgress(uid string, config *cfg.Game_taskRoundD
}
//更改用户任务
func (this *ModelTask) modifyUserTask(uid string, taskTag comm.TaskTag, taskId string, data map[string]interface{}) error {
if err := this.ChangeList(swapKey(uid, taskTag), taskId, data); err != nil {
func (this *ModelTask) modifyUserTask(uid string, taskId string, data map[string]interface{}) error {
if err := this.ChangeList(uid, taskId, data); err != nil {
log.Errorf("err %v", err)
return err
}
@ -131,7 +135,7 @@ func (this *ModelTask) taskHandle(uid string, taskType comm.TaskType, taskParam
}
//检查进度,执行处理器
if v, ok := this.checkTaskProgress(uid, conf); ok {
if tt, err := this.finishHandle(v, comm.TaskTag(conf.IdTag), conf); err != nil {
if tt, err := this.finishHandle(v, conf); err != nil {
return nil, err
} else {
return tt, nil
@ -143,7 +147,7 @@ func (this *ModelTask) taskHandle(uid string, taskType comm.TaskType, taskParam
}
//任务完成处理
func (this *ModelTask) finishHandle(userTask *pb.DBTask, taskTag comm.TaskTag, config *cfg.Game_taskRoundData) (*pb.DBTask, error) {
func (this *ModelTask) finishHandle(userTask *pb.DBTask, config *cfg.Game_taskRoundData) (*pb.DBTask, error) {
progress := userTask.Progress - 1
if progress < 0 {
return nil, fmt.Errorf("uid %s task[%s] was finished", userTask.Uid, userTask.Id)
@ -157,7 +161,7 @@ func (this *ModelTask) finishHandle(userTask *pb.DBTask, taskTag comm.TaskTag, c
update["status"] = 1
}
if err := this.modifyUserTask(userTask.Uid, taskTag, userTask.Id, update); err != nil {
if err := this.modifyUserTask(userTask.Uid, userTask.Id, update); err != nil {
log.Errorf("err %v", err)
return nil, err
}
@ -171,7 +175,7 @@ func (this *ModelTask) finishHandle(userTask *pb.DBTask, taskTag comm.TaskTag, c
func (this *ModelTask) clearTask(uid string, taskTag comm.TaskTag) error {
taskList := this.getTaskList(uid, taskTag)
for _, v := range taskList {
if err := this.moduleTask.modelTask.DelListlds(swapKey(uid, taskTag), v.Id); err != nil {
if err := this.moduleTask.modelTask.DelListlds(uid, v.Id); err != nil {
log.Errorf("uid: %v taskTag:%v err:%v", uid, taskTag, err)
return err
}
@ -205,7 +209,7 @@ func (this *ModelTask) inStrategy(uid string, heroCfgId int32) (taskIds []int32,
update := map[string]interface{}{
"status": 0,
}
if err = this.modifyUserTask(uid, comm.TASK_STRATEGY, v.Id, update); err != nil {
if err = this.modifyUserTask(uid, v.Id, update); err != nil {
this.moduleTask.Errorf("doStrategy err %v", err)
break
}

View File

@ -44,22 +44,10 @@ func (this *ModuleTask) Start() (err error) {
return
}
//初始化任务
func (this *ModuleTask) InitTask(uid string, taskTag comm.TaskTag) {
if err := this.modelTask.initTaskByTag(uid, taskTag); err != nil {
log.Errorf("uid:%v tag:%v initTask err: %v", uid, taskTag, err)
}
}
//初始化日常、周常、成就
func (this *ModuleTask) InitTaskAll(uid string) {
this.InitTask(uid, comm.TASK_DAILY)
this.InitTask(uid, comm.TASK_WEEKLY)
this.InitTask(uid, comm.TASK_ACHIEVE)
this.InitTask(uid, comm.TASK_STRATEGY)
this.modelTaskActive.initActiveRewardByTag(uid, comm.TASK_DAILY)
this.modelTaskActive.initActiveRewardByTag(uid, comm.TASK_WEEKLY)
this.modelTask.initTask(uid)
this.modelTaskActive.initActiveReward(uid)
}
//重置任务
@ -68,13 +56,13 @@ func (this *ModuleTask) ResetTask(uid string, taskTag comm.TaskTag) {
log.Errorf("uid:%v tag:%v ResetTask err:%v", uid, taskTag, err)
return
}
this.InitTask(uid, taskTag)
this.InitTaskAll(uid)
if err := this.modelTaskActive.clearTask(uid, taskTag); err != nil {
log.Errorf("uid:%v tag:%v ResetTaskActive err:%v", uid, taskTag, err)
return
}
this.modelTaskActive.initActiveRewardByTag(uid, taskTag)
// this.modelTaskActive.initActiveRewardByTag(uid, taskTag)
}
//任务处理

View File

@ -5,15 +5,17 @@ message DBTask {
string id = 1; //@go_tags(`bson:"_id"`) ID
string uid = 2; //@go_tags(`bson:"uid"`) ID
int32 taskId = 3; //@go_tags(`bson:"taskId"`) Id
int32 progress = 4; //@go_tags(`bson:"progress"`) /
int32 active = 5; //@go_tags(`bson:"active"`)
int32 status = 6; //@go_tags(`bson:"status"`) 0 1
int32 received = 7; //@go_tags(`bson:"received"`) 0 1
int32 tag = 4; //@go_tags(`bson:"tag"`)
int32 progress = 5; //@go_tags(`bson:"progress"`) /
int32 active = 6; //@go_tags(`bson:"active"`)
int32 status = 7; //@go_tags(`bson:"status"`) 0 1
int32 received = 8; //@go_tags(`bson:"received"`) 0 1
}
message DBTaskActive {
string id = 1; //@go_tags(`bson:"_id"`) ID
string uid = 2; //@go_tags(`bson:"uid"`) ID
int32 rId = 3; //@go_tags(`bson:"taskId"`) rewardId
int32 received = 4; //@go_tags(`bson:"received"`) 0 1
int32 tag = 4; //@go_tags(`bson:"tag"`)
int32 received = 5; //@go_tags(`bson:"received"`) 0 1
}

View File

@ -28,6 +28,7 @@ message DBUser {
int32 lv = 16; //@go_tags(`bson:"lv"`)
int32 vip = 17; //@go_tags(`bson:"vip"`) vip
int32 diamond = 18; //@go_tags(`bson:"diamond"`)
int32 title = 19; //@go_tags(`bson:"title"`)
}
message DBUserSetting {

View File

@ -9,4 +9,5 @@ message DBUserExpand {
int64 lastInitdataTime = 4; //
uint32 initdataCount = 5; //
int32 chatchannel = 6; //
int32 modifynameCount = 7; //
}

View File

@ -28,10 +28,11 @@ type DBTask struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
TaskId int32 `protobuf:"varint,3,opt,name=taskId,proto3" json:"taskId" bson:"taskId"` //任务Id
Progress int32 `protobuf:"varint,4,opt,name=progress,proto3" json:"progress" bson:"progress"` //任务进度/完成次数
Active int32 `protobuf:"varint,5,opt,name=active,proto3" json:"active" bson:"active"` //活跃度
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status" bson:"status"` // 任务状态 默认0未完成 1已完成
Received int32 `protobuf:"varint,7,opt,name=received,proto3" json:"received" bson:"received"` //领取状态 默认0未领取 1已领取
Tag int32 `protobuf:"varint,4,opt,name=tag,proto3" json:"tag" bson:"tag"` //标签
Progress int32 `protobuf:"varint,5,opt,name=progress,proto3" json:"progress" bson:"progress"` //任务进度/完成次数
Active int32 `protobuf:"varint,6,opt,name=active,proto3" json:"active" bson:"active"` //活跃度
Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status" bson:"status"` // 任务状态 默认0未完成 1已完成
Received int32 `protobuf:"varint,8,opt,name=received,proto3" json:"received" bson:"received"` //领取状态 默认0未领取 1已领取
}
func (x *DBTask) Reset() {
@ -87,6 +88,13 @@ func (x *DBTask) GetTaskId() int32 {
return 0
}
func (x *DBTask) GetTag() int32 {
if x != nil {
return x.Tag
}
return 0
}
func (x *DBTask) GetProgress() int32 {
if x != nil {
return x.Progress
@ -123,7 +131,8 @@ type DBTaskActive struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
RId int32 `protobuf:"varint,3,opt,name=rId,proto3" json:"rId" bson:"taskId"` //rewardId
Received int32 `protobuf:"varint,4,opt,name=received,proto3" json:"received" bson:"received"` //领取状态 默认0未领取 1已领取
Tag int32 `protobuf:"varint,4,opt,name=tag,proto3" json:"tag" bson:"tag"` //标签
Received int32 `protobuf:"varint,5,opt,name=received,proto3" json:"received" bson:"received"` //领取状态 默认0未领取 1已领取
}
func (x *DBTaskActive) Reset() {
@ -179,6 +188,13 @@ func (x *DBTaskActive) GetRId() int32 {
return 0
}
func (x *DBTaskActive) GetTag() int32 {
if x != nil {
return x.Tag
}
return 0
}
func (x *DBTaskActive) GetReceived() int32 {
if x != nil {
return x.Received
@ -190,25 +206,27 @@ var File_task_task_db_proto protoreflect.FileDescriptor
var file_task_task_db_proto_rawDesc = []byte{
0x0a, 0x12, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b, 0x12,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b, 0x12,
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f,
0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f,
0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18,
0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
0x64, 0x22, 0x5e, 0x0a, 0x0c, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76,
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x03, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67,
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x70,
0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70,
0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12,
0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
0x76, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
0x76, 0x65, 0x64, 0x22, 0x70, 0x0a, 0x0c, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74,
0x69, 0x76, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x03, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x04,
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63,
0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63,
0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -122,6 +122,7 @@ type DBUser struct {
Lv int32 `protobuf:"varint,16,opt,name=lv,proto3" json:"lv" bson:"lv"` //等级
Vip int32 `protobuf:"varint,17,opt,name=vip,proto3" json:"vip" bson:"vip"` // vip
Diamond int32 `protobuf:"varint,18,opt,name=diamond,proto3" json:"diamond" bson:"diamond"` // 钻石
Title int32 `protobuf:"varint,19,opt,name=title,proto3" json:"title"` //@go_tags(`bson:"title"`)头衔
}
func (x *DBUser) Reset() {
@ -282,6 +283,13 @@ func (x *DBUser) GetDiamond() int32 {
return 0
}
func (x *DBUser) GetTitle() int32 {
if x != nil {
return x.Title
}
return 0
}
type DBUserSetting struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -438,7 +446,7 @@ var file_user_user_db_proto_rawDesc = []byte{
0x61, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61,
0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0xa6,
0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0xbc,
0x03, 0x0a, 0x06, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75,
@ -465,29 +473,30 @@ var file_user_user_db_proto_rawDesc = []byte{
0x76, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x76,
0x69, 0x70, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x69, 0x70, 0x12, 0x18, 0x0a,
0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x22, 0xc7, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73,
0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68,
0x75, 0x61, 0x7a, 0x68, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x75, 0x61,
0x7a, 0x68, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61, 0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68,
0x69, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x18, 0x05, 0x20,
0x01, 0x28, 0x08, 0x52, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a,
0x04, 0x77, 0x75, 0x6c, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x77, 0x75, 0x6c,
0x69, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08,
0x52, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63,
0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x12,
0x14, 0x0a, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x67, 0x75, 0x61, 0x6a, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x75, 0x62, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74,
0x61, 0x6e, 0x73, 0x75, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x74, 0x61, 0x6e,
0x73, 0x75, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x18, 0x0c,
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x75, 0x6f, 0x64, 0x6f, 0x6e, 0x67, 0x12, 0x1c, 0x0a,
0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08,
0x52, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73,
0x61, 0x69, 0x6a, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x61, 0x69, 0x6a,
0x69, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0xc7, 0x02,
0x0a, 0x0d, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x06, 0x68, 0x75, 0x61, 0x7a, 0x68, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x61, 0x6e,
0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x61,
0x6e, 0x67, 0x6a, 0x75, 0x63, 0x68, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75,
0x61, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x67, 0x61, 0x6f, 0x67, 0x75,
0x61, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x18, 0x06, 0x20, 0x01, 0x28,
0x08, 0x52, 0x04, 0x77, 0x75, 0x6c, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63,
0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x12, 0x16, 0x0a,
0x06, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65,
0x66, 0x66, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x18, 0x09,
0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x67, 0x75, 0x61, 0x6a, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x66,
0x75, 0x62, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x75, 0x62, 0x65,
0x6e, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x08, 0x52, 0x06, 0x74, 0x61, 0x6e, 0x73, 0x75, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x75, 0x6f,
0x64, 0x6f, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x75, 0x6f, 0x64,
0x6f, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67,
0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e,
0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08,
0x52, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -32,6 +32,7 @@ type DBUserExpand struct {
LastInitdataTime int64 `protobuf:"varint,4,opt,name=lastInitdataTime,proto3" json:"lastInitdataTime"` //上次初始数据时间
InitdataCount uint32 `protobuf:"varint,5,opt,name=initdataCount,proto3" json:"initdataCount"` //今日初始累计次数
Chatchannel int32 `protobuf:"varint,6,opt,name=chatchannel,proto3" json:"chatchannel"` //跨服聊天频道
ModifynameCount int32 `protobuf:"varint,7,opt,name=modifynameCount,proto3" json:"modifynameCount"` //修改昵称次数
}
func (x *DBUserExpand) Reset() {
@ -108,11 +109,18 @@ func (x *DBUserExpand) GetChatchannel() int32 {
return 0
}
func (x *DBUserExpand) GetModifynameCount() int32 {
if x != nil {
return x.ModifynameCount
}
return 0
}
var File_userexpand_proto protoreflect.FileDescriptor
var file_userexpand_proto_rawDesc = []byte{
0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0xd2, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70,
0x74, 0x6f, 0x22, 0xfc, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70,
0x61, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61,
@ -125,8 +133,11 @@ var file_userexpand_proto_rawDesc = []byte{
0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61,
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x74, 0x63, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x74,
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x64, 0x69, 0x66,
0x79, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (