go_dreamfactory/modules/user/module.go
2022-06-28 18:05:44 +08:00

52 lines
1.1 KiB
Go

package user
import (
"go_dreamfactory/comm"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go_dreamfactory/lego/core"
)
func NewModule() core.IModule {
m := new(User)
return m
}
type User struct {
modules.ModuleBase
api *apiComp
modelUser *ModelUser
modelSession *ModelSession
}
func (this *User) GetType() core.M_Modules {
return comm.ModuleUser
}
func (this *User) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *User) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelUser = this.RegisterComp(new(ModelUser)).(*ModelUser)
this.modelSession = this.RegisterComp(new(ModelSession)).(*ModelSession)
}
//获取英雄列表
func (this *User) GetHeroList(uid string) []*pb.DBHero {
return nil
}
func (this *User) QueryAttributeValue(uid string, attr string) (value int32) {
return
}
func (this *User) AddAttributeValue(uid string, attr string, add int32) (code pb.ErrorCode) {
return
}