上传招募代码

This commit is contained in:
liwei 2023-07-18 19:21:34 +08:00
parent e102d2f548
commit 593472e461
17 changed files with 578 additions and 195 deletions

View File

@ -293,7 +293,8 @@ const (
///工会战
TableUniongve = "uniongve"
///工会轮盘
TableUnionroulette = "unionroulette"
//全局表
TableGlobal = "global"
)

View File

@ -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)
//添加/减少属性值 第四个参数控制是否推送给前端

View File

@ -148,6 +148,11 @@ func (this *MCompModel) GetListObjs(uid string, ids []string, data interface{})
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...)

View File

@ -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)

View File

@ -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"
@ -116,6 +117,7 @@ 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,
Lastrefresh: configure.Now().Unix(),
}
}
item.Items[conf.Id].Buyunm++
@ -179,6 +181,7 @@ 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,
Lastrefresh: configure.Now().Unix(),
}
}
item.Items[conf.Id].Buyunm++

View File

@ -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)

View File

@ -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})

View File

@ -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
}

View File

@ -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,
})
}

View File

@ -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,
})
}

View File

@ -19,6 +19,7 @@ type UnionGve struct {
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)
}

View File

@ -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{}{

View File

@ -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 {

View File

@ -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
}

View File

@ -96,7 +96,6 @@ type DBUnionGve struct {
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"` //轮盘记录
}
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 {
@ -306,13 +354,13 @@ type DBGveRouletteRecord struct {
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"`
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
(*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,
},

View File

@ -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() }

View File

@ -935,6 +935,85 @@ 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})