go_dreamfactory/modules/hero/api.go
2022-06-28 12:07:12 +08:00

42 lines
905 B
Go

package hero
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type Api_Comp struct {
modules.MComp_GateComp
service core.IService
module *Hero
user comm.IUser
}
const ( //消息回复的头名称
StrengthenUplv = "strengthenherolv"
Hero_SubType_Info = "info" //英雄卡片信息
Hero_SubType_List = "list" //英雄列表
)
//组件初始化接口
func (this *Api_Comp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.MComp_GateComp.Init(service, module, comp, options)
this.module = module.(*Hero)
this.service = service
return
}
func (this *Api_Comp) Start() (err error) {
err = this.MComp_GateComp.Start()
var module core.IModule
if module, err = this.service.GetModule(comm.SM_UserModule); err != nil {
return
}
this.user = module.(comm.IUser)
return
}