update trade
This commit is contained in:
parent
2d1838174e
commit
311f45c351
@ -141,6 +141,7 @@ const (
|
|||||||
TableSeasonRecord = "seasonRecord" // 赛季塔记录
|
TableSeasonRecord = "seasonRecord" // 赛季塔记录
|
||||||
/// 美食馆
|
/// 美食馆
|
||||||
TableSmithy = "smithy"
|
TableSmithy = "smithy"
|
||||||
|
TableSmithyTrade = "trade"
|
||||||
/// 赛季塔数据表
|
/// 赛季塔数据表
|
||||||
TableSeasonPagoda = "seasonpagoda"
|
TableSeasonPagoda = "seasonpagoda"
|
||||||
//
|
//
|
||||||
|
27
modules/smithy/model_trade.go
Normal file
27
modules/smithy/model_trade.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package smithy
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/lego/core"
|
||||||
|
"go_dreamfactory/modules"
|
||||||
|
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type modelTrade struct {
|
||||||
|
modules.MCompModel
|
||||||
|
module *Smithy
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *modelTrade) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
|
this.TableName = string(comm.TableSmithyTrade)
|
||||||
|
err = this.MCompModel.Init(service, module, comp, options)
|
||||||
|
this.module = module.(*Smithy)
|
||||||
|
// uid 创建索引
|
||||||
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//
|
@ -15,6 +15,7 @@ import (
|
|||||||
type Smithy struct {
|
type Smithy struct {
|
||||||
modules.ModuleBase
|
modules.ModuleBase
|
||||||
modelSmithy *modelSmithy
|
modelSmithy *modelSmithy
|
||||||
|
modelTrade *modelTrade
|
||||||
api *apiComp
|
api *apiComp
|
||||||
configure *configureComp
|
configure *configureComp
|
||||||
}
|
}
|
||||||
@ -38,6 +39,7 @@ func (this *Smithy) OnInstallComp() {
|
|||||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||||
this.modelSmithy = this.RegisterComp(new(modelSmithy)).(*modelSmithy)
|
this.modelSmithy = this.RegisterComp(new(modelSmithy)).(*modelSmithy)
|
||||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||||
|
this.modelTrade = this.RegisterComp(new(modelTrade)).(*modelTrade)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 接口信息
|
// 接口信息
|
||||||
|
Loading…
Reference in New Issue
Block a user