package dragon import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/modules" "go_dreamfactory/pb" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/x/bsonx" ) type ModelDragon struct { modules.MCompModel module *Dragon } func (this *ModelDragon) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { this.TableName = comm.TableHero err = this.MCompModel.Init(service, module, comp, options) this.module = module.(*Dragon) // 通过uid创建索引 this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, }) return } // 初始化英雄 func (this *ModelDragon) InitHero(uid string, heroCfgId string) *pb.DBHero { return nil }