You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
1.4 KiB

/*
管理系统
*/
package user
import (
"yunyan/comm"
"yunyan/modules"
"yunyan/lego/base"
"yunyan/lego/core"
)
// @title user模塊 API
// @version 1.0
// @description 处理用戶數據相關接口
func NewModule() core.IModule {
m := new(User)
return m
}
type User struct {
modules.ModuleBase
service base.IRPCXService //rpcx服务接口 主要client->server
api *apiComp
model *modelUserComp
configmodel *modelConfigComp
cache *modelCacheComp
options *Options
analyze comm.IAnalyze
}
func (this *User) GetType() core.M_Modules {
return comm.ModuleUser
}
func (this *User) NewOptions() (options core.IModuleOptions) {
return new(Options)
}
func (this *User) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
this.service = service.(base.IRPCXService)
this.options = options.(*Options)
if err = this.ModuleBase.Init(service, module, options); err != nil {
return
}
return
}
func (this *User) Start() (err error) {
if err = this.ModuleBase.Start(); err != nil {
return
}
return
}
func (this *User) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.model = this.RegisterComp(new(modelUserComp)).(*modelUserComp)
this.cache = this.RegisterComp(new(modelCacheComp)).(*modelCacheComp)
this.configmodel = this.RegisterComp(new(modelConfigComp)).(*modelConfigComp)
}