去掉servicetype

This commit is contained in:
boyce
2019-02-21 10:24:18 +08:00
parent d61d17efbc
commit 0095f517de
3 changed files with 4 additions and 11 deletions

View File

@@ -39,14 +39,13 @@ type IModule interface {
}
type IService interface {
Init(Iservice IService, servicetype int) error
Init(Iservice IService) error
OnInit() error
OnRun() bool
OnFetchService(iservice IService) error
OnSetupService(iservice IService) //其他服务被安装
OnRemoveService(iservice IService) //其他服务被安装
GetServiceType() int
GetServiceName() string
SetServiceName(serviceName string) bool
GetServiceId() int
@@ -74,7 +73,6 @@ type BaseService struct {
serviceid int
servicename string
servicetype int
Status int
}
@@ -99,10 +97,6 @@ func (slf *BaseService) GetServiceId() int {
return slf.serviceid
}
func (slf *BaseService) GetServiceType() int {
return slf.servicetype
}
func (slf *BaseService) GetServiceName() string {
return slf.servicename
}
@@ -129,7 +123,7 @@ func (slf *BaseService) OnRemoveService(iservice IService) {
return
}
func (slf *BaseService) Init(iservice IService, servicetype int) error {
func (slf *BaseService) Init(iservice IService) error {
slf.ownerService = iservice
slf.servicename = fmt.Sprintf("%T", iservice)
parts := strings.Split(slf.servicename, ".")
@@ -140,7 +134,6 @@ func (slf *BaseService) Init(iservice IService, servicetype int) error {
}
slf.servicename = parts[1]
slf.servicetype = servicetype
slf.serviceid = InstanceServiceMgr().GenServiceID()
return nil

View File

@@ -61,7 +61,7 @@ func NewHttpServerService(port uint16) *HttpServerService {
http := new(HttpServerService)
http.port = port
http.Init(http, 0)
http.Init(http)
return http
}

View File

@@ -32,7 +32,7 @@ func NewWSServerService(port uint16) *WSServerService {
wss.port = port
wss.Init(wss, 0)
wss.Init(wss)
return wss
}