diff --git a/comm/const.go b/comm/const.go index 77edced3a..b830a04ce 100644 --- a/comm/const.go +++ b/comm/const.go @@ -293,7 +293,8 @@ const ( ///工会战 TableUniongve = "uniongve" - + ///工会轮盘 + TableUnionroulette = "unionroulette" //全局表 TableGlobal = "global" ) diff --git a/comm/imodule.go b/comm/imodule.go index 9d9cb7c1a..ededbe826 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -149,6 +149,8 @@ type ( GetUser(uid string) *pb.DBUser //获取用户回话 GetUserSession(uid string) *pb.CacheUser + //批量查询用户会话数据 + GetUserSessions(uids []string) []*pb.CacheUser //查询用户属性值 例如 金币 经验 QueryAttributeValue(uid string, attr string) (value int64) //添加/减少属性值 第四个参数控制是否推送给前端 diff --git a/modules/comp_model.go b/modules/comp_model.go index bfeae2ded..f3d0e54e8 100644 --- a/modules/comp_model.go +++ b/modules/comp_model.go @@ -25,7 +25,7 @@ type MCompModel struct { DBModel *db.DBModel } -//组件初始化接口 +// 组件初始化接口 func (this *MCompModel) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { this.ModuleCompBase.Init(service, module, comp, options) var conn *db.DBConn @@ -63,107 +63,112 @@ func (this *MCompModel) UpdateModelLogs(table string, uID string, where bson.M, return this.DBModel.UpdateModelLogs(table, uID, where, target) } -//创建分布式锁 +// 创建分布式锁 func (this *MCompModel) NewRedisMutex(key string, outtime int) (result *redis.RedisMutex, err error) { return this.DBModel.NewRedisMutex(key, outtime) } -//添加新的数据 +// 添加新的数据 func (this *MCompModel) Add(uid string, data interface{}, opt ...db.DBOption) (err error) { return this.DBModel.Add(uid, data) } -//添加新的数据 +// 添加新的数据 func (this *MCompModel) Adds(datas map[string]interface{}, opt ...db.DBOption) (err error) { return this.DBModel.Adds(datas) } -//添加新的数据到列表 +// 添加新的数据到列表 func (this *MCompModel) AddList(uid string, id string, data interface{}, opt ...db.DBOption) (err error) { return this.DBModel.AddList(uid, id, data, opt...) } -//添加新的多个数据到列表 data map[string]type +// 添加新的多个数据到列表 data map[string]type func (this *MCompModel) AddLists(uid string, data interface{}, opt ...db.DBOption) (err error) { return this.DBModel.AddLists(uid, data, opt...) } -//添加新的多个数据到队列中 data map[string]type +// 添加新的多个数据到队列中 data map[string]type func (this *MCompModel) AddQueues(key string, uplimit int64, data interface{}) (outkey []string, err error) { return this.DBModel.AddQueues(key, uplimit, data) } -//修改数据多个字段 uid 作为主键 +// 修改数据多个字段 uid 作为主键 func (this *MCompModel) Change(uid string, data map[string]interface{}, opt ...db.DBOption) (err error) { return this.DBModel.Change(uid, data, opt...) } -//修改数据多个字段 uid 作为主键 +// 修改数据多个字段 uid 作为主键 func (this *MCompModel) ChangeList(uid string, _id string, data map[string]interface{}, opt ...db.DBOption) (err error) { return this.DBModel.ChangeList(uid, _id, data, opt...) } -//修改列表中多个数据 datas key是 _id value是 这个数据对象 +// 修改列表中多个数据 datas key是 _id value是 这个数据对象 func (this *MCompModel) ChangeLists(uid string, datas map[string]interface{}, opt ...db.DBOption) (err error) { return this.DBModel.ChangeLists(uid, datas, opt...) } -//读取全部数据 +// 读取全部数据 func (this *MCompModel) Get(id string, data interface{}, opt ...db.DBOption) (err error) { return this.DBModel.Get(id, data, opt...) } -//读取多个数据对象 +// 读取多个数据对象 func (this *MCompModel) Gets(ids []string, data interface{}, opt ...db.DBOption) (onfound []string, err error) { return this.DBModel.Gets(ids, data, opt...) } -//获取列表数据 注意 data 必须是 切片的指针 *[]type +// 获取列表数据 注意 data 必须是 切片的指针 *[]type func (this *MCompModel) GetList(uid string, data interface{}) (err error) { return this.DBModel.GetList(uid, data) } -//查询队列信息 +// 查询队列信息 func (this *MCompModel) GetQueues(key string, count int, data interface{}) (err error) { return this.DBModel.GetQueues(key, count, data) } -//读取单个数据中 多个字段数据 +// 读取单个数据中 多个字段数据 func (this *MCompModel) GetFields(uid string, data interface{}, fields ...string) (err error) { return this.DBModel.GetFields(uid, data, fields...) } -//读取List列表中单个数据中 多个字段数据 +// 读取List列表中单个数据中 多个字段数据 func (this *MCompModel) GetListFields(uid string, id string, data interface{}, fields ...string) (err error) { return this.DBModel.GetListFields(uid, id, data, fields...) } -//读取列表数据中单个数据 +// 读取列表数据中单个数据 func (this *MCompModel) GetListObj(uid string, id string, data interface{}) (err error) { return this.DBModel.GetListObj(uid, id, data) } -//批量读取列表中多个数据 +// 批量读取列表中多个数据 func (this *MCompModel) GetListObjs(uid string, ids []string, data interface{}) (err error) { return this.DBModel.GetListObjs(uid, ids, data) } -//删除目标数据 +// 批量读取列表中多个数据 只在redis中寻找 +func (this *MCompModel) GetRedisListObjs(uid string, ids []string, data interface{}) (foundids []string, err error) { + return this.DBModel.GetRedisListObjs(uid, ids, data) +} + +// 删除目标数据 func (this *MCompModel) Del(id string, opt ...db.DBOption) (err error) { return this.DBModel.Del(id, opt...) } -//删除用户数据 +// 删除用户数据 func (this *MCompModel) DelByUId(uid string, opt ...db.DBOption) (err error) { return this.DBModel.DelByUId(uid, opt...) } -//删除多条数据 +// 删除多条数据 func (this *MCompModel) DelListlds(uid string, ids []string, opt ...db.DBOption) (err error) { return this.DBModel.DelListlds(uid, ids, opt...) } -//批量删除数据 +// 批量删除数据 func (this *MCompModel) BatchDelLists(uid string) (err error) { return this.DBModel.BatchDelLists(uid) } diff --git a/modules/modulebase.go b/modules/modulebase.go index 7d1b67f5a..e8831ca7b 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -193,21 +193,13 @@ func (this *ModuleBase) SendMsgToUser(mainType, subType string, msg proto.Messag // 向多个用户发送消息 func (this *ModuleBase) SendMsgToUsers(mainType, subType string, msg proto.Message, uids ...string) (err error) { var ( - users map[string]*pb.CacheUser = make(map[string]*pb.CacheUser) + users []*pb.CacheUser gateways map[string]map[string][]string = make(map[string]map[string][]string) cluster map[string][]string = make(map[string][]string) gateway []string ok bool ) - for _, v := range uids { - if user := this.ModuleUser.GetUserSession(v); user != nil { - if user == nil { - err = fmt.Errorf("user:%v on found", v) - continue - } - users[v] = user - } - } + users = this.ModuleUser.GetUserSessions(uids) for _, v := range users { if cluster, ok = gateways[v.ServiceTag]; !ok { cluster = make(map[string][]string) diff --git a/modules/pay/modelActivity.go b/modules/pay/modelActivity.go index fcb0085e6..70153f630 100644 --- a/modules/pay/modelActivity.go +++ b/modules/pay/modelActivity.go @@ -7,6 +7,7 @@ import ( "go_dreamfactory/lego/sys/mgo" "go_dreamfactory/modules" "go_dreamfactory/pb" + "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" "sync" @@ -115,7 +116,8 @@ func (this *modelActivityComp) deliverybyid(session comm.IUserSession, id int32) if _, ok = item.Items[conf.Id]; !ok { item.Items[conf.Id] = &pb.PayActivityGiftbagItem{ - Id: conf.Id, + Id: conf.Id, + Lastrefresh: configure.Now().Unix(), } } item.Items[conf.Id].Buyunm++ @@ -178,7 +180,8 @@ func (this *modelActivityComp) delivery(session comm.IUserSession, pid string) ( if _, ok = item.Items[conf.Id]; !ok { item.Items[conf.Id] = &pb.PayActivityGiftbagItem{ - Id: conf.Id, + Id: conf.Id, + Lastrefresh: configure.Now().Unix(), } } item.Items[conf.Id].Buyunm++ diff --git a/modules/uniongve/api_challengefinish.go b/modules/uniongve/api_challengefinish.go index 49594ad66..bcd6e8225 100644 --- a/modules/uniongve/api_challengefinish.go +++ b/modules/uniongve/api_challengefinish.go @@ -82,6 +82,7 @@ func (this *apiComp) ChallengeFinish(session comm.IUserSession, req *pb.Uniongve } } v.Record = append(v.Record) + go this.module.modelUniongve.booshpchangepush(req.Unionid, info) if v.Hp < 0 { v.Hp = 0 go this.module.modelUniongve.booskill(req.Unionid, req.Boosid, info) diff --git a/modules/uniongve/api_roulette.go b/modules/uniongve/api_roulette.go index 8c6126d1f..55d70f422 100644 --- a/modules/uniongve/api_roulette.go +++ b/modules/uniongve/api_roulette.go @@ -58,7 +58,7 @@ func (this *apiComp) Roulette(session comm.IUserSession, req *pb.UniongveRoulett } if confs[index].Push == 1 { //推送通知 - + go this.module.modelUnionroulette.roulettechangePush(session.GetUserId(), req.Unionid, award) } session.SendMsg(string(this.module.GetType()), "roulette", &pb.UniongveRouletteResp{Cid: confs[index].Id, Award: award}) diff --git a/modules/uniongve/api_setfire.go b/modules/uniongve/api_setfire.go index d1257f6d8..315edef04 100644 --- a/modules/uniongve/api_setfire.go +++ b/modules/uniongve/api_setfire.go @@ -2,6 +2,7 @@ package uniongve import ( "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" ) @@ -15,12 +16,40 @@ func (this *apiComp) SetFireCheck(session comm.IUserSession, req *pb.UniongveSet func (this *apiComp) SetFire(session comm.IUserSession, req *pb.UniongveSetFireReq) (errdata *pb.ErrorData) { var ( info *pb.DBUnionGve + err error ) if errdata = this.SetFireCheck(session, req); errdata != nil { return } - this.module.modelUniongve.getUnionGve(req.Unionid) + lock, _ := this.module.modelUniongve.userlock(req.Unionid) + err = lock.Lock() + if err != nil { + this.module.Error("公会战分布式锁 err!", log.Field{Key: "Unionid", Value: req.Unionid}, log.Field{Key: "err", Value: err.Error()}) + return + } + defer lock.Unlock() + + if info, err = this.module.modelUniongve.getUnionGve(req.Unionid); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + info.Notice = req.Notice + info.Fire = req.Boosid + + if err = this.module.modelUniongve.updateUnionGve(info); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + go this.module.modelUniongve.infochangepush(req.Unionid, info) session.SendMsg(string(this.module.GetType()), "info", &pb.UniongveInfoResp{Info: info}) return } diff --git a/modules/uniongve/modelUnionRoulette.go b/modules/uniongve/modelUnionRoulette.go new file mode 100644 index 000000000..c75103749 --- /dev/null +++ b/modules/uniongve/modelUnionRoulette.go @@ -0,0 +1,102 @@ +package uniongve + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/lego/sys/mgo" + "go_dreamfactory/lego/sys/redis" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + "sync" +) + +type ModelUnionroulette struct { + modules.MCompModel + module *UnionGve + conflock sync.RWMutex + bossconf *pb.DBUnionGveBossConf +} + +func (this *ModelUnionroulette) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.MCompModel.Init(service, module, comp, options) + this.TableName = comm.TableUnionroulette + this.module = module.(*UnionGve) + return +} + +func (this *ModelUnionroulette) Start() (err error) { + err = this.MCompModel.Start() + return +} + +// 获取用户全部的埋点数据 +func (this *ModelUnionroulette) getUnionRoulette(unionid string) (results *pb.DBUnionRouletteRecord, err error) { + results = &pb.DBUnionRouletteRecord{} + if err = this.Get(unionid, results); err != nil && err != mgo.MongodbNil { + this.module.Errorln(err) + return + } + if err == mgo.MongodbNil { + results = &pb.DBUnionRouletteRecord{ + Unionid: unionid, + Roulette: make([]*pb.DBGveRouletteRecord, 0), + } + err = this.Add(unionid, results) + } + return +} + +func (this *ModelUnionroulette) updateUnionRoulette(data *pb.DBUnionRouletteRecord) (err error) { + if err = this.Change(data.Unionid, map[string]interface{}{ + "roulette": data.Roulette, + }); err != nil { + this.module.Error("更新用户任务数据 错误!", log.Field{Key: "err", Value: err.Error()}) + return + } + return +} + +// 分布式锁 +func (this *ModelUnionroulette) userlock(id string) (result *redis.RedisMutex, err error) { + return this.DBModel.Redis.NewRedisMutex(fmt.Sprintf("unionroulette:%s", id)) +} + +// boos 信息变化推送 +func (this *ModelUnionroulette) roulettechangePush(unionid string, uid string, award []*pb.UserAssets) { + var ( + info *pb.DBUnionRouletteRecord + members []*pb.SociatyMemberInfo + users []string = make([]string, 0) + err error + ) + members = this.module.sociaty.MembersBySociatyId(unionid) + if members == nil || len(members) == 0 { + this.module.Error("MembersBySociatyId is nil !") + return + } + for _, v := range members { + users = append(users, v.Uid) + } + + lock, _ := this.module.modelUniongve.userlock(unionid) + err = lock.Lock() + if err != nil { + this.module.Error("公会战分布式锁 err!", log.Field{Key: "Unionid", Value: unionid}, log.Field{Key: "err", Value: err.Error()}) + return + } + defer lock.Unlock() + if info, err = this.getUnionRoulette(unionid); err != nil { + this.module.Errorln(err) + return + } + info.Roulette = append(info.Roulette, &pb.DBGveRouletteRecord{ + Uid: uid, + Award: award, + }) + + this.module.SendMsgToUsers(string(this.module.GetType()), "roulettechange", &pb.UniongveRouletteChangePush{ + Record: info, + }) +} diff --git a/modules/uniongve/modelUniongve.go b/modules/uniongve/modelUniongve.go index 1d9148f1d..3aa9a29e0 100644 --- a/modules/uniongve/modelUniongve.go +++ b/modules/uniongve/modelUniongve.go @@ -61,7 +61,6 @@ func (this *ModelUniongve) getUnionGve(unionid string) (results *pb.DBUnionGve, Currstage: 0, Rtime: confs.Rtime, Boos: make([]*pb.DBUnionGveBoss, 0), - Roulette: make([]*pb.DBGveRouletteRecord, 0), } for _, v := range confs.Boos { if conf, err = this.module.configure.getguildbossByid(v); err != nil { @@ -85,7 +84,6 @@ func (this *ModelUniongve) updateUnionGve(data *pb.DBUnionGve) (err error) { "currstage": data.Currstage, "rtime": data.Rtime, "boos": data.Boos, - "roulette": data.Roulette, }); err != nil { this.module.Error("更新用户任务数据 错误!", log.Field{Key: "err", Value: err.Error()}) return @@ -162,11 +160,32 @@ func (this *ModelUniongve) userlock(id string) (result *redis.RedisMutex, err er return this.DBModel.Redis.NewRedisMutex(fmt.Sprintf("uniongve:%s", id)) } +// boos 血量变化推送 +func (this *ModelUniongve) booshpchangepush(unionid string, info *pb.DBUnionGve) { + var ( + members []*pb.SociatyMemberInfo + users []string = make([]string, 0) + ) + members = this.module.sociaty.MembersBySociatyId(unionid) + if members == nil || len(members) == 0 { + this.module.Error("MembersBySociatyId is nil !") + return + } + for _, v := range members { + users = append(users, v.Uid) + + } + this.module.SendMsgToUsers(string(this.module.GetType()), "booschange", &pb.UniongveBoosChangePush{ + Info: info, + }) +} + // 击杀boos func (this *ModelUniongve) booskill(unionid string, boosid int32, info *pb.DBUnionGve) { var ( conf *cfg.GameGuildBossData members []*pb.SociatyMemberInfo + users []string = make([]string, 0) offlist []string = make([]string, 0) onine []string = make([]string, 0) err error @@ -181,6 +200,7 @@ func (this *ModelUniongve) booskill(unionid string, boosid int32, info *pb.DBUni return } for _, v := range members { + users = append(users, v.Uid) if v.OfflineTime != 0 { offlist = append(offlist, v.Uid) } else { @@ -216,4 +236,31 @@ func (this *ModelUniongve) booskill(unionid string, boosid int32, info *pb.DBUni v.Hp = v.Hp v.Record = make([]*pb.DBGveRecord, 0) } + if err = this.updateUnionGve(info); err != nil { + this.module.Errorln(err) + return + } + this.module.SendMsgToUsers(string(this.module.GetType()), "stagechange", &pb.UniongveStageChangePush{ + Info: info, + }) +} + +// boos 信息变化推送 +func (this *ModelUniongve) infochangepush(unionid string, info *pb.DBUnionGve) { + var ( + members []*pb.SociatyMemberInfo + users []string = make([]string, 0) + ) + members = this.module.sociaty.MembersBySociatyId(unionid) + if members == nil || len(members) == 0 { + this.module.Error("MembersBySociatyId is nil !") + return + } + for _, v := range members { + users = append(users, v.Uid) + + } + this.module.SendMsgToUsers(string(this.module.GetType()), "infochange", &pb.UniongveInfoChangePush{ + Info: info, + }) } diff --git a/modules/uniongve/module.go b/modules/uniongve/module.go index 4393ceed3..b89e6caf4 100644 --- a/modules/uniongve/module.go +++ b/modules/uniongve/module.go @@ -13,13 +13,14 @@ func NewModule() core.IModule { type UnionGve struct { modules.ModuleBase - service core.IService - sociaty comm.ISociaty - mail comm.Imail - battle comm.IBattle - api *apiComp - modelUniongve *ModelUniongve - configure *MCompConfigure + service core.IService + sociaty comm.ISociaty + mail comm.Imail + battle comm.IBattle + api *apiComp + modelUniongve *ModelUniongve + modelUnionroulette *ModelUnionroulette + configure *MCompConfigure } // 模块名 @@ -57,4 +58,5 @@ func (this *UnionGve) OnInstallComp() { this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.configure = this.RegisterComp(new(MCompConfigure)).(*MCompConfigure) this.modelUniongve = this.RegisterComp(new(ModelUniongve)).(*ModelUniongve) + this.modelUnionroulette = this.RegisterComp(new(ModelUnionroulette)).(*ModelUnionroulette) } diff --git a/modules/user/model_session.go b/modules/user/model_session.go index 8a83231f7..26a895462 100644 --- a/modules/user/model_session.go +++ b/modules/user/model_session.go @@ -43,6 +43,18 @@ func (this *ModelSession) getUserSession(uid string) (user *pb.CacheUser) { return user } +// 获取用户 +func (this *ModelSession) getUserSessions(uids []string) (users []*pb.CacheUser) { + users = make([]*pb.CacheUser, 0) + if _, err := this.GetRedisListObjs(comm.RDS_EMPTY, uids, &users); err != nil { + if err != mongo.ErrNoDocuments { + this.module.Errorln(err) + } + return + } + return +} + // 设置用户session func (this *ModelSession) addUserSession(uid string, session comm.IUserSession) (err error) { // if err = this.AddList(comm.RDS_EMPTY, uid, map[string]interface{}{ diff --git a/modules/user/module.go b/modules/user/module.go index 3839880dc..171f4baae 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -148,6 +148,11 @@ func (this *User) GetUserSession(uid string) *pb.CacheUser { return this.modelSession.getUserSession(uid) } +// 获取用户会话 +func (this *User) GetUserSessions(uids []string) []*pb.CacheUser { + return this.modelSession.getUserSessions(uids) +} + func (this *User) ResetSession() { us, err := this.UserOnlineList() if err != nil { diff --git a/modules/warorder/api_receive.go b/modules/warorder/api_receive.go index 00a47b098..a537ef175 100644 --- a/modules/warorder/api_receive.go +++ b/modules/warorder/api_receive.go @@ -86,6 +86,16 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.WarorderReceiveR if errdata = this.module.DispenseRes(session, awards, true); errdata != nil { return } + + if err = this.module.modelWarorder.updateUserWarorders(session.GetUserId(), warorders); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: fmt.Sprintf("Activity:%d no open", req.Rtype), + } + return + } + session.SendMsg(string(this.module.GetType()), "receive", &pb.WarorderReceiveResp{Rtype: req.Rtype, Info: info, Award: ads}) return } diff --git a/pb/uniongve_db.pb.go b/pb/uniongve_db.pb.go index 5c12f8b64..c9ba046d0 100644 --- a/pb/uniongve_db.pb.go +++ b/pb/uniongve_db.pb.go @@ -90,13 +90,12 @@ type DBUnionGve struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` //工会id - Notice string `protobuf:"bytes,2,opt,name=notice,proto3" json:"notice"` //公告 - Fire int32 `protobuf:"varint,3,opt,name=fire,proto3" json:"fire"` //火力 - Currstage int32 `protobuf:"varint,4,opt,name=currstage,proto3" json:"currstage"` //当前第几阶段 - Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` //刷新时间 - Boos []*DBUnionGveBoss `protobuf:"bytes,6,rep,name=boos,proto3" json:"boos"` //boos列表 - Roulette []*DBGveRouletteRecord `protobuf:"bytes,7,rep,name=roulette,proto3" json:"roulette"` //轮盘记录 + Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` //工会id + Notice string `protobuf:"bytes,2,opt,name=notice,proto3" json:"notice"` //公告 + Fire int32 `protobuf:"varint,3,opt,name=fire,proto3" json:"fire"` //火力 + Currstage int32 `protobuf:"varint,4,opt,name=currstage,proto3" json:"currstage"` //当前第几阶段 + Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` //刷新时间 + Boos []*DBUnionGveBoss `protobuf:"bytes,6,rep,name=boos,proto3" json:"boos"` //boos列表 } func (x *DBUnionGve) Reset() { @@ -173,7 +172,56 @@ func (x *DBUnionGve) GetBoos() []*DBUnionGveBoss { return nil } -func (x *DBUnionGve) GetRoulette() []*DBGveRouletteRecord { +//工会轮盘记录 +type DBUnionRouletteRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` //工会id + Roulette []*DBGveRouletteRecord `protobuf:"bytes,7,rep,name=roulette,proto3" json:"roulette"` //轮盘记录 +} + +func (x *DBUnionRouletteRecord) Reset() { + *x = DBUnionRouletteRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_uniongve_uniongve_db_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBUnionRouletteRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBUnionRouletteRecord) ProtoMessage() {} + +func (x *DBUnionRouletteRecord) ProtoReflect() protoreflect.Message { + mi := &file_uniongve_uniongve_db_proto_msgTypes[2] + 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 DBUnionRouletteRecord.ProtoReflect.Descriptor instead. +func (*DBUnionRouletteRecord) Descriptor() ([]byte, []int) { + return file_uniongve_uniongve_db_proto_rawDescGZIP(), []int{2} +} + +func (x *DBUnionRouletteRecord) GetUnionid() string { + if x != nil { + return x.Unionid + } + return "" +} + +func (x *DBUnionRouletteRecord) GetRoulette() []*DBGveRouletteRecord { if x != nil { return x.Roulette } @@ -194,7 +242,7 @@ type DBUnionGveBoss struct { func (x *DBUnionGveBoss) Reset() { *x = DBUnionGveBoss{} if protoimpl.UnsafeEnabled { - mi := &file_uniongve_uniongve_db_proto_msgTypes[2] + mi := &file_uniongve_uniongve_db_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -207,7 +255,7 @@ func (x *DBUnionGveBoss) String() string { func (*DBUnionGveBoss) ProtoMessage() {} func (x *DBUnionGveBoss) ProtoReflect() protoreflect.Message { - mi := &file_uniongve_uniongve_db_proto_msgTypes[2] + mi := &file_uniongve_uniongve_db_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -220,7 +268,7 @@ func (x *DBUnionGveBoss) ProtoReflect() protoreflect.Message { // Deprecated: Use DBUnionGveBoss.ProtoReflect.Descriptor instead. func (*DBUnionGveBoss) Descriptor() ([]byte, []int) { - return file_uniongve_uniongve_db_proto_rawDescGZIP(), []int{2} + return file_uniongve_uniongve_db_proto_rawDescGZIP(), []int{3} } func (x *DBUnionGveBoss) GetBoosid() int32 { @@ -257,7 +305,7 @@ type DBGveRecord struct { func (x *DBGveRecord) Reset() { *x = DBGveRecord{} if protoimpl.UnsafeEnabled { - mi := &file_uniongve_uniongve_db_proto_msgTypes[3] + mi := &file_uniongve_uniongve_db_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -270,7 +318,7 @@ func (x *DBGveRecord) String() string { func (*DBGveRecord) ProtoMessage() {} func (x *DBGveRecord) ProtoReflect() protoreflect.Message { - mi := &file_uniongve_uniongve_db_proto_msgTypes[3] + mi := &file_uniongve_uniongve_db_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -283,7 +331,7 @@ func (x *DBGveRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use DBGveRecord.ProtoReflect.Descriptor instead. func (*DBGveRecord) Descriptor() ([]byte, []int) { - return file_uniongve_uniongve_db_proto_rawDescGZIP(), []int{3} + return file_uniongve_uniongve_db_proto_rawDescGZIP(), []int{4} } func (x *DBGveRecord) GetUid() string { @@ -305,14 +353,14 @@ type DBGveRouletteRecord struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` - Cid int32 `protobuf:"varint,2,opt,name=cid,proto3" json:"cid"` + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` + Award []*UserAssets `protobuf:"bytes,2,rep,name=award,proto3" json:"award"` //奖励 } func (x *DBGveRouletteRecord) Reset() { *x = DBGveRouletteRecord{} if protoimpl.UnsafeEnabled { - mi := &file_uniongve_uniongve_db_proto_msgTypes[4] + mi := &file_uniongve_uniongve_db_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -325,7 +373,7 @@ func (x *DBGveRouletteRecord) String() string { func (*DBGveRouletteRecord) ProtoMessage() {} func (x *DBGveRouletteRecord) ProtoReflect() protoreflect.Message { - mi := &file_uniongve_uniongve_db_proto_msgTypes[4] + mi := &file_uniongve_uniongve_db_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -338,7 +386,7 @@ func (x *DBGveRouletteRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use DBGveRouletteRecord.ProtoReflect.Descriptor instead. func (*DBGveRouletteRecord) Descriptor() ([]byte, []int) { - return file_uniongve_uniongve_db_proto_rawDescGZIP(), []int{4} + return file_uniongve_uniongve_db_proto_rawDescGZIP(), []int{5} } func (x *DBGveRouletteRecord) GetUid() string { @@ -348,51 +396,56 @@ func (x *DBGveRouletteRecord) GetUid() string { return "" } -func (x *DBGveRouletteRecord) GetCid() int32 { +func (x *DBGveRouletteRecord) GetAward() []*UserAssets { if x != nil { - return x.Cid + return x.Award } - return 0 + return nil } var File_uniongve_uniongve_db_proto protoreflect.FileDescriptor var file_uniongve_uniongve_db_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x2f, 0x75, 0x6e, 0x69, 0x6f, 0x6e, - 0x67, 0x76, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x12, - 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x43, 0x6f, - 0x6e, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, - 0x6f, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x22, 0xdd, - 0x01, 0x0a, 0x0a, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x66, 0x69, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x66, - 0x69, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x72, 0x73, 0x74, 0x61, 0x67, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, 0x72, 0x73, 0x74, 0x61, 0x67, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, - 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x12, 0x30, 0x0a, 0x08, - 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x52, 0x08, 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x22, 0x5e, - 0x0a, 0x0e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, - 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x3d, - 0x0a, 0x0b, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x0a, - 0x13, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, + 0x67, 0x76, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, + 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x12, 0x44, 0x42, 0x55, 0x6e, + 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x22, 0xab, 0x01, 0x0a, 0x0a, 0x44, + 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, + 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, + 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, + 0x69, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x66, 0x69, 0x72, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x72, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, 0x72, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, + 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, + 0x73, 0x73, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x73, 0x22, 0x63, 0x0a, 0x15, 0x44, 0x42, 0x55, 0x6e, + 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x72, + 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x52, 0x08, 0x72, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x22, 0x5e, 0x0a, + 0x0e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x42, 0x6f, 0x73, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x12, 0x24, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x3d, 0x0a, + 0x0b, 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4a, 0x0a, 0x13, + 0x44, 0x42, 0x47, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } @@ -408,23 +461,26 @@ func file_uniongve_uniongve_db_proto_rawDescGZIP() []byte { return file_uniongve_uniongve_db_proto_rawDescData } -var file_uniongve_uniongve_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_uniongve_uniongve_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_uniongve_uniongve_db_proto_goTypes = []interface{}{ - (*DBUnionGveBossConf)(nil), // 0: DBUnionGveBossConf - (*DBUnionGve)(nil), // 1: DBUnionGve - (*DBUnionGveBoss)(nil), // 2: DBUnionGveBoss - (*DBGveRecord)(nil), // 3: DBGveRecord - (*DBGveRouletteRecord)(nil), // 4: DBGveRouletteRecord + (*DBUnionGveBossConf)(nil), // 0: DBUnionGveBossConf + (*DBUnionGve)(nil), // 1: DBUnionGve + (*DBUnionRouletteRecord)(nil), // 2: DBUnionRouletteRecord + (*DBUnionGveBoss)(nil), // 3: DBUnionGveBoss + (*DBGveRecord)(nil), // 4: DBGveRecord + (*DBGveRouletteRecord)(nil), // 5: DBGveRouletteRecord + (*UserAssets)(nil), // 6: UserAssets } var file_uniongve_uniongve_db_proto_depIdxs = []int32{ - 2, // 0: DBUnionGve.boos:type_name -> DBUnionGveBoss - 4, // 1: DBUnionGve.roulette:type_name -> DBGveRouletteRecord - 3, // 2: DBUnionGveBoss.record:type_name -> DBGveRecord - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 3, // 0: DBUnionGve.boos:type_name -> DBUnionGveBoss + 5, // 1: DBUnionRouletteRecord.roulette:type_name -> DBGveRouletteRecord + 4, // 2: DBUnionGveBoss.record:type_name -> DBGveRecord + 6, // 3: DBGveRouletteRecord.award:type_name -> UserAssets + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_uniongve_uniongve_db_proto_init() } @@ -432,6 +488,7 @@ func file_uniongve_uniongve_db_proto_init() { if File_uniongve_uniongve_db_proto != nil { return } + file_comm_proto_init() if !protoimpl.UnsafeEnabled { file_uniongve_uniongve_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DBUnionGveBossConf); i { @@ -458,7 +515,7 @@ func file_uniongve_uniongve_db_proto_init() { } } file_uniongve_uniongve_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DBUnionGveBoss); i { + switch v := v.(*DBUnionRouletteRecord); i { case 0: return &v.state case 1: @@ -470,7 +527,7 @@ func file_uniongve_uniongve_db_proto_init() { } } file_uniongve_uniongve_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DBGveRecord); i { + switch v := v.(*DBUnionGveBoss); i { case 0: return &v.state case 1: @@ -482,6 +539,18 @@ func file_uniongve_uniongve_db_proto_init() { } } file_uniongve_uniongve_db_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBGveRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_uniongve_uniongve_db_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DBGveRouletteRecord); i { case 0: return &v.state @@ -500,7 +569,7 @@ func file_uniongve_uniongve_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_uniongve_uniongve_db_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/uniongve_msg.pb.go b/pb/uniongve_msg.pb.go index 1446469bf..2b725d5ae 100644 --- a/pb/uniongve_msg.pb.go +++ b/pb/uniongve_msg.pb.go @@ -383,6 +383,8 @@ type UniongveRouletteReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` } func (x *UniongveRouletteReq) Reset() { @@ -417,6 +419,13 @@ func (*UniongveRouletteReq) Descriptor() ([]byte, []int) { return file_uniongve_uniongve_msg_proto_rawDescGZIP(), []int{7} } +func (x *UniongveRouletteReq) GetUnionid() string { + if x != nil { + return x.Unionid + } + return "" +} + //工会轮盘 type UniongveRouletteResp struct { state protoimpl.MessageState @@ -886,6 +895,8 @@ type UniongveRouletteChangePush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Record *DBUnionRouletteRecord `protobuf:"bytes,1,opt,name=record,proto3" json:"record"` } func (x *UniongveRouletteChangePush) Reset() { @@ -920,6 +931,13 @@ func (*UniongveRouletteChangePush) Descriptor() ([]byte, []int) { return file_uniongve_uniongve_msg_proto_rawDescGZIP(), []int{16} } +func (x *UniongveRouletteChangePush) GetRecord() *DBUnionRouletteRecord { + if x != nil { + return x.Record + } + return nil +} + var File_uniongve_uniongve_msg_proto protoreflect.FileDescriptor var file_uniongve_uniongve_msg_proto_rawDesc = []byte{ @@ -954,58 +972,62 @@ var file_uniongve_uniongve_msg_proto_rawDesc = []byte{ 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x52, 0x04, - 0x6c, 0x69, 0x73, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, - 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x71, 0x22, 0x4b, 0x0a, 0x14, 0x55, - 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, - 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x22, 0x72, 0x0a, 0x14, 0x55, 0x6e, 0x69, 0x6f, - 0x6e, 0x67, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, - 0x6f, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, - 0x69, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x22, 0x6a, 0x0a, 0x15, - 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x75, 0x0a, 0x1a, 0x55, 0x6e, 0x69, 0x6f, - 0x6e, 0x67, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x6e, - 0x69, 0x73, 0x68, 0x52, 0x65, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, - 0x90, 0x01, 0x0a, 0x1b, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, - 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x6c, 0x69, 0x73, 0x74, 0x22, 0x2f, 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, + 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, + 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, + 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x14, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, + 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, + 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, + 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, + 0x72, 0x64, 0x22, 0x72, 0x0a, 0x14, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x43, 0x68, + 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, + 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, + 0x6f, 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x06, + 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x42, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, + 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x22, 0x6a, 0x0a, 0x15, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, + 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, - 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61, - 0x77, 0x61, 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, - 0x6e, 0x74, 0x22, 0x39, 0x0a, 0x16, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x04, - 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x55, - 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x3a, 0x0a, - 0x17, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, - 0x47, 0x76, 0x65, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x39, 0x0a, 0x16, 0x55, 0x6e, 0x69, - 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x42, 0x6f, 0x6f, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, - 0x75, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x52, 0x04, - 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x1c, 0x0a, 0x1a, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, - 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, - 0x73, 0x68, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x64, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, + 0x66, 0x6f, 0x22, 0x75, 0x0a, 0x1a, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x43, 0x68, + 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x70, + 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, + 0x6f, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, + 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x1b, 0x55, 0x6e, + 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x46, + 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, + 0x6f, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, + 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x6f, 0x6f, 0x73, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, + 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x39, 0x0a, 0x16, + 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, + 0x65, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x3a, 0x0a, 0x17, 0x55, 0x6e, 0x69, 0x6f, 0x6e, + 0x67, 0x76, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, + 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x52, 0x04, 0x69, + 0x6e, 0x66, 0x6f, 0x22, 0x39, 0x0a, 0x16, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x42, + 0x6f, 0x6f, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1f, 0x0a, + 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, + 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x47, 0x76, 0x65, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x4c, + 0x0a, 0x1a, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x67, 0x76, 0x65, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, + 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x2e, 0x0a, 0x06, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x44, + 0x42, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x75, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1044,6 +1066,7 @@ var file_uniongve_uniongve_msg_proto_goTypes = []interface{}{ (*BattleFormation)(nil), // 19: BattleFormation (*BattleInfo)(nil), // 20: BattleInfo (*BattleReport)(nil), // 21: BattleReport + (*DBUnionRouletteRecord)(nil), // 22: DBUnionRouletteRecord } var file_uniongve_uniongve_msg_proto_depIdxs = []int32{ 17, // 0: UniongveInfoResp.info:type_name -> DBUnionGve @@ -1056,11 +1079,12 @@ var file_uniongve_uniongve_msg_proto_depIdxs = []int32{ 17, // 7: UniongveInfoChangePush.info:type_name -> DBUnionGve 17, // 8: UniongveStageChangePush.info:type_name -> DBUnionGve 17, // 9: UniongveBoosChangePush.info:type_name -> DBUnionGve - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 22, // 10: UniongveRouletteChangePush.record:type_name -> DBUnionRouletteRecord + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_uniongve_uniongve_msg_proto_init() } diff --git a/sys/db/dbmodel.go b/sys/db/dbmodel.go index 62ba11183..df2a04b6a 100644 --- a/sys/db/dbmodel.go +++ b/sys/db/dbmodel.go @@ -48,7 +48,7 @@ func NewDBModel(tableName string, expired time.Duration, conn *DBConn) *DBModel } } -//DB模型 +// DB模型 type DBModel struct { TableName string Expired time.Duration //过期时间 @@ -147,13 +147,13 @@ func (this *DBModel) UpdateModelLogs(table string, uID string, where bson.M, tar return err } -///创建锁对象 +// /创建锁对象 func (this *DBModel) NewRedisMutex(key string, outtime int) (result *lgredis.RedisMutex, err error) { result, err = this.Redis.NewRedisMutex(key, lgredis.SetExpiry(outtime)) return } -//添加新的数据 +// 添加新的数据 func (this *DBModel) Add(uid string, data interface{}, opt ...DBOption) (err error) { //defer log.Debug("DBModel Add", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data}) if err = this.Redis.HMSet(this.ukey(uid), data); err != nil { @@ -170,7 +170,7 @@ func (this *DBModel) Add(uid string, data interface{}, opt ...DBOption) (err err return } -//添加新的数据 +// 添加新的数据 func (this *DBModel) Adds(data map[string]interface{}, opt ...DBOption) (err error) { //defer log.Debug("DBModel Add", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data}) pipe := this.Redis.RedisPipe(context.TODO()) @@ -192,7 +192,7 @@ func (this *DBModel) Adds(data map[string]interface{}, opt ...DBOption) (err err return } -//添加新的数据到列表 +// 添加新的数据到列表 func (this *DBModel) AddList(uid string, id string, data interface{}, opt ...DBOption) (err error) { //defer log.Debug("DBModel AddList", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "_id", Value: id}, log.Field{Key: "data", Value: data}) key := this.ukeylist(uid, id) @@ -213,7 +213,7 @@ func (this *DBModel) AddList(uid string, id string, data interface{}, opt ...DBO return } -//添加新的多个数据到列表 data map[string]type +// 添加新的多个数据到列表 data map[string]type func (this *DBModel) AddLists(uid string, data interface{}, opt ...DBOption) (err error) { //defer log.Debug("DBModel AddLists", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data}) vof := reflect.ValueOf(data) @@ -256,7 +256,7 @@ func (this *DBModel) AddLists(uid string, data interface{}, opt ...DBOption) (er return } -//添加队列 +// 添加队列 func (this *DBModel) AddQueues(key string, uplimit int64, data interface{}) (outkey []string, err error) { //defer log.Debug("DBModel AddQueues", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "key", Value: key}, log.Field{Key: "data", Value: data}) vof := reflect.ValueOf(data) @@ -296,7 +296,7 @@ func (this *DBModel) AddQueues(key string, uplimit int64, data interface{}) (out return } -//修改数据多个字段 uid 作为主键 +// 修改数据多个字段 uid 作为主键 func (this *DBModel) Change(uid string, data map[string]interface{}, opt ...DBOption) (err error) { //defer log.Debug("DBModel Change", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data}) if err = this.Redis.HMSet(this.ukey(uid), data); err != nil { @@ -313,7 +313,7 @@ func (this *DBModel) Change(uid string, data map[string]interface{}, opt ...DBOp return nil } -//修改列表中一个数据 +// 修改列表中一个数据 func (this *DBModel) ChangeList(uid string, _id string, data map[string]interface{}, opt ...DBOption) (err error) { //defer log.Debug("DBModel ChangeList", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "_id", Value: _id}, log.Field{Key: "data", Value: data}) if err = this.Redis.HMSet(this.ukeylist(uid, _id), data); err != nil { @@ -336,7 +336,7 @@ func (this *DBModel) ChangeList(uid string, _id string, data map[string]interfac return nil } -//修改列表中多个数据 datas key是 _id value是 这个数据对象 +// 修改列表中多个数据 datas key是 _id value是 这个数据对象 func (this *DBModel) ChangeLists(uid string, datas map[string]interface{}, opt ...DBOption) (err error) { pipe := this.Redis.RedisPipe(context.TODO()) for k, v := range datas { @@ -366,7 +366,7 @@ func (this *DBModel) ChangeLists(uid string, datas map[string]interface{}, opt . return nil } -//读取全部数据 +// 读取全部数据 func (this *DBModel) Get(uid string, data interface{}, opt ...DBOption) (err error) { //defer log.Debug("DBModel Get", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data}) if err = this.Redis.HGetAll(this.ukey(uid), data); err != nil && err != lgredis.RedisNil { @@ -386,7 +386,7 @@ func (this *DBModel) Get(uid string, data interface{}, opt ...DBOption) (err err return } -//读取多个数据对象 +// 读取多个数据对象 func (this *DBModel) Gets(ids []string, data interface{}, opt ...DBOption) (onfound []string, err error) { //defer log.Debug("DBModel GetListObjs", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "ids", Value: ids}, log.Field{Key: "data", Value: data}) defer func() { //程序异常 收集异常信息传递给前端显示 @@ -515,7 +515,7 @@ func (this *DBModel) Gets(ids []string, data interface{}, opt ...DBOption) (onfo return } -//获取列表数据 注意 data 必须是 切片的指针 *[]type +// 获取列表数据 注意 data 必须是 切片的指针 *[]type func (this *DBModel) GetList(uid string, data interface{}) (err error) { //defer log.Debug("DBModel GetList", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data}) defer func() { //程序异常 收集异常信息传递给前端显示 @@ -643,7 +643,7 @@ func (this *DBModel) GetList(uid string, data interface{}) (err error) { return err } -//获取队列数据 +// 获取队列数据 func (this *DBModel) GetQueues(key string, count int, data interface{}) (err error) { //defer log.Debug("DBModel GetQueues", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "key", Value: key}, log.Field{Key: "data", Value: data}) var ( @@ -714,7 +714,7 @@ func (this *DBModel) GetQueues(key string, count int, data interface{}) (err err return } -//读取单个数据中 多个字段数据 +// 读取单个数据中 多个字段数据 func (this *DBModel) GetFields(uid string, data interface{}, fields ...string) (err error) { //defer log.Debug("DBModel GetFields", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "data", Value: data}) if err = this.Redis.HMGet(this.ukey(uid), data, fields...); err != nil && err != lgredis.RedisNil { @@ -734,7 +734,7 @@ func (this *DBModel) GetFields(uid string, data interface{}, fields ...string) ( return } -//读取List列表中单个数据中 多个字段数据 +// 读取List列表中单个数据中 多个字段数据 func (this *DBModel) GetListFields(uid string, id string, data interface{}, fields ...string) (err error) { //defer log.Debug("DBModel GetListFields", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "id", Value: id}, log.Field{Key: "data", Value: data}) var ( @@ -768,7 +768,7 @@ func (this *DBModel) GetListFields(uid string, id string, data interface{}, fiel return } -//读取列表数据中单个数据 +// 读取列表数据中单个数据 func (this *DBModel) GetListObj(uid string, id string, data interface{}) (err error) { //defer log.Debug("DBModel GetListObj", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "id", Value: id}, log.Field{Key: "data", Value: data}) var ( @@ -802,7 +802,7 @@ func (this *DBModel) GetListObj(uid string, id string, data interface{}) (err er return } -//读取列表数据中多条数据 +// 读取列表数据中多条数据 func (this *DBModel) GetListObjs(uid string, ids []string, data interface{}) (err error) { //defer log.Debug("DBModel GetListObjs", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "ids", Value: ids}, log.Field{Key: "data", Value: data}) defer func() { //程序异常 收集异常信息传递给前端显示 @@ -935,7 +935,86 @@ func (this *DBModel) GetListObjs(uid string, ids []string, data interface{}) (er return } -//删除目标数据 +// 读取列表数据中多条数据 +func (this *DBModel) GetRedisListObjs(uid string, ids []string, data interface{}) (onfound []string, err error) { + //defer log.Debug("DBModel GetListObjs", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "ids", Value: ids}, log.Field{Key: "data", Value: data}) + defer func() { //程序异常 收集异常信息传递给前端显示 + if r := recover(); r != nil { + buf := make([]byte, 4096) + l := runtime.Stack(buf, false) + err = fmt.Errorf("%v: %s", r, buf[:l]) + log.Errorf("[DB GetListObjs] TableName:%s uid:%s", this.TableName, uid) + } + }() + var ( + dtype reflect2.Type + dkind reflect.Kind + sType reflect2.Type + sliceType *reflect2.UnsafeSliceType + sliceelemType reflect2.Type + decoder codecore.IDecoderMapJson + dptr unsafe.Pointer + elemPtr unsafe.Pointer + n int + ok bool + tempdata map[string]string + pipe *pipe.RedisPipe = this.Redis.RedisPipe(context.TODO()) + result []*redis.StringStringMapCmd = make([]*redis.StringStringMapCmd, len(ids)) + ) + onfound = make([]string, 0, len(ids)) + dptr = reflect2.PtrOf(data) + dtype = reflect2.TypeOf(data) + dkind = dtype.Kind() + if dkind != reflect.Ptr { + err = fmt.Errorf("MCompModel: GetList(non-pointer %T)", data) + return + } + sType = dtype.(*reflect2.UnsafePtrType).Elem() + if sType.Kind() != reflect.Slice { + err = fmt.Errorf("MCompModel: GetList(data no slice %T)", data) + return + } + sliceType = sType.(*reflect2.UnsafeSliceType) + sliceelemType = sliceType.Elem() + if sliceelemType.Kind() != reflect.Ptr { + err = fmt.Errorf("MCompModel: GetList(sliceelemType non-pointer %T)", data) + return + } + if decoder, ok = codec.DecoderOf(sliceelemType, defconf).(codecore.IDecoderMapJson); !ok { + err = fmt.Errorf("MCompModel: GetList(data not support MarshalMapJson %T)", data) + return + } + sliceelemType = sliceelemType.(*reflect2.UnsafePtrType).Elem() + for i, v := range ids { + result[i] = pipe.HGetAllToMapString(this.ukeylist(uid, v)) + } + if _, err = pipe.Exec(); err == nil { + for i, v := range result { + if tempdata, err = v.Result(); err == nil { + sliceType.UnsafeGrow(dptr, n+1) + elemPtr = sliceType.UnsafeGetIndex(dptr, n) + if *((*unsafe.Pointer)(elemPtr)) == nil { + newPtr := sliceelemType.UnsafeNew() + if err = decoder.DecodeForMapJson(newPtr, json.GetReader([]byte{}), tempdata); err != nil { + log.Errorf("err:%v", err) + return + } + *((*unsafe.Pointer)(elemPtr)) = newPtr + } else { + decoder.DecodeForMapJson(*((*unsafe.Pointer)(elemPtr)), json.GetReader([]byte{}), tempdata) + } + n++ + } else { + onfound = append(onfound, ids[i]) + } + } + } else { + onfound = ids + } + return +} + +// 删除目标数据 func (this *DBModel) Del(id string, opt ...DBOption) (err error) { //defer log.Debug("DBModel Del", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}) err = this.Redis.Delete(this.ukey(id)) @@ -949,7 +1028,7 @@ func (this *DBModel) Del(id string, opt ...DBOption) (err error) { return nil } -//删除用户数据 +// 删除用户数据 func (this *DBModel) DelByUId(uid string, opt ...DBOption) (err error) { //defer log.Debug("DBModel Del", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}) err = this.Redis.Delete(this.ukey(uid)) @@ -963,7 +1042,7 @@ func (this *DBModel) DelByUId(uid string, opt ...DBOption) (err error) { return nil } -//删除多条数据 +// 删除多条数据 func (this *DBModel) DelListlds(uid string, ids []string, opt ...DBOption) (err error) { //defer log.Debug("DBModel DelListlds", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "ids", Value: ids}) listkey := this.ukey(uid) @@ -982,7 +1061,7 @@ func (this *DBModel) DelListlds(uid string, ids []string, opt ...DBOption) (err return } -//批量删除数据 +// 批量删除数据 func (this *DBModel) BatchDelLists(uid string) (err error) { //defer log.Debug("DBModel BatchDelLists", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}) var keys map[string]string