diff --git a/modules/arena/modelarena.go b/modules/arena/modelarena.go index 7b393cad5..c85c657b4 100644 --- a/modules/arena/modelarena.go +++ b/modules/arena/modelarena.go @@ -34,7 +34,7 @@ func (this *modelArena) Init(service core.IService, module core.IModule, comp co this.MCompModel.Init(service, module, comp, opt) this.module = module.(*Arena) //创建uid索引 - this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + _, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bson.A{ bsonx.Doc{ {Key: "uid", Value: bsonx.Int32(1)}, diff --git a/modules/arena/modelrecord.go b/modules/arena/modelrecord.go index 7b02c814f..c71315bd0 100644 --- a/modules/arena/modelrecord.go +++ b/modules/arena/modelrecord.go @@ -21,7 +21,7 @@ func (this *modelRecord) Init(service core.IService, module core.IModule, comp c this.MCompModel.Init(service, module, comp, opt) this.module = module.(*Arena) //创建uid索引 - this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + _, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, }) return diff --git a/modules/battle/modelBattle.go b/modules/battle/modelBattle.go index e0481bbb5..76174d1c9 100644 --- a/modules/battle/modelBattle.go +++ b/modules/battle/modelBattle.go @@ -12,8 +12,6 @@ import ( "time" "go.mongodb.org/mongo-driver/bson/primitive" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/x/bsonx" ) ///数据组件 @@ -28,9 +26,9 @@ func (this *modelBattleComp) Init(service core.IService, module core.IModule, co this.MCompModel.Init(service, module, comp, opt) this.module = module.(*Battle) this.TableName = "battle" - this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ - Keys: bsonx.Doc{{Key: "heroid", Value: bsonx.Int32(1)}}, - }) + // _, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + // Keys: bsonx.Doc{{Key: "heroid", Value: bsonx.Int32(1)}}, + // }) return } diff --git a/modules/chat/modelChat.go b/modules/chat/modelChat.go index b28faef8a..c2a1a61df 100644 --- a/modules/chat/modelChat.go +++ b/modules/chat/modelChat.go @@ -32,7 +32,7 @@ func (this *modelChatComp) Init(service core.IService, module core.IModule, comp this.MCompModel.Init(service, module, comp, opt) this.module = module.(*Chat) //创建uid索引 - this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + _, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "ruid", Value: bsonx.Int32(1)}}, }) return diff --git a/modules/equipment/modelEquipment.go b/modules/equipment/modelEquipment.go index 68830a407..d4900e46c 100644 --- a/modules/equipment/modelEquipment.go +++ b/modules/equipment/modelEquipment.go @@ -27,7 +27,7 @@ func (this *modelEquipmentComp) Init(service core.IService, module core.IModule, this.MCompModel.Init(service, module, comp, opt) this.module = module.(*Equipment) //创建uid索引 - this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + _, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, }) return diff --git a/modules/forum/modelForum.go b/modules/forum/modelForum.go index 3a34421db..e5191991a 100644 --- a/modules/forum/modelForum.go +++ b/modules/forum/modelForum.go @@ -28,7 +28,7 @@ func (this *modelForumComp) Init(service core.IService, module core.IModule, com this.module = module.(*Forum) //创建uid索引 - this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + _, err = this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "heroid", Value: bsonx.Int32(1)}}, }) return