37 lines
942 B
Go
37 lines
942 B
Go
package parkour
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
///竞速数据模块
|
|
type ModelMatchComp struct {
|
|
modules.MCompModel
|
|
module *Parkour
|
|
}
|
|
|
|
//组件初始化接口 只是用redis 层
|
|
func (this *ModelMatchComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) {
|
|
this.TableName = comm.TableParkourMatch
|
|
this.MCompModel.Init(service, module, comp, opt)
|
|
this.module = module.(*Parkour)
|
|
return
|
|
}
|
|
|
|
///添加匹配队伍
|
|
func (this *ModelMatchComp) addteam(team *pb.DBRaceTeam) (err error) {
|
|
// var (
|
|
// teams []*pb.DBRaceTeam = make([]*pb.DBRaceTeam, 0)
|
|
// )
|
|
// if err = this.GetQueues(this.TableName, 1000, &teams); err == redis.RedisNil {
|
|
// if outkey, err = this.AddQueues(this.TableName, 1000, data); err != nil {
|
|
// this.module.Errorf("err:%v", err)
|
|
// return
|
|
// }
|
|
// }
|
|
return
|
|
}
|