mirror of
https://github.com/duanhf2012/origin.git
synced 2026-03-14 04:37:33 +08:00
去掉servicetype
This commit is contained in:
@@ -39,14 +39,13 @@ type IModule interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IService interface {
|
type IService interface {
|
||||||
Init(Iservice IService, servicetype int) error
|
Init(Iservice IService) error
|
||||||
OnInit() error
|
OnInit() error
|
||||||
OnRun() bool
|
OnRun() bool
|
||||||
OnFetchService(iservice IService) error
|
OnFetchService(iservice IService) error
|
||||||
OnSetupService(iservice IService) //其他服务被安装
|
OnSetupService(iservice IService) //其他服务被安装
|
||||||
OnRemoveService(iservice IService) //其他服务被安装
|
OnRemoveService(iservice IService) //其他服务被安装
|
||||||
|
|
||||||
GetServiceType() int
|
|
||||||
GetServiceName() string
|
GetServiceName() string
|
||||||
SetServiceName(serviceName string) bool
|
SetServiceName(serviceName string) bool
|
||||||
GetServiceId() int
|
GetServiceId() int
|
||||||
@@ -74,7 +73,6 @@ type BaseService struct {
|
|||||||
|
|
||||||
serviceid int
|
serviceid int
|
||||||
servicename string
|
servicename string
|
||||||
servicetype int
|
|
||||||
Status int
|
Status int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,10 +97,6 @@ func (slf *BaseService) GetServiceId() int {
|
|||||||
return slf.serviceid
|
return slf.serviceid
|
||||||
}
|
}
|
||||||
|
|
||||||
func (slf *BaseService) GetServiceType() int {
|
|
||||||
return slf.servicetype
|
|
||||||
}
|
|
||||||
|
|
||||||
func (slf *BaseService) GetServiceName() string {
|
func (slf *BaseService) GetServiceName() string {
|
||||||
return slf.servicename
|
return slf.servicename
|
||||||
}
|
}
|
||||||
@@ -129,7 +123,7 @@ func (slf *BaseService) OnRemoveService(iservice IService) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (slf *BaseService) Init(iservice IService, servicetype int) error {
|
func (slf *BaseService) Init(iservice IService) error {
|
||||||
slf.ownerService = iservice
|
slf.ownerService = iservice
|
||||||
slf.servicename = fmt.Sprintf("%T", iservice)
|
slf.servicename = fmt.Sprintf("%T", iservice)
|
||||||
parts := strings.Split(slf.servicename, ".")
|
parts := strings.Split(slf.servicename, ".")
|
||||||
@@ -140,7 +134,6 @@ func (slf *BaseService) Init(iservice IService, servicetype int) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
slf.servicename = parts[1]
|
slf.servicename = parts[1]
|
||||||
slf.servicetype = servicetype
|
|
||||||
slf.serviceid = InstanceServiceMgr().GenServiceID()
|
slf.serviceid = InstanceServiceMgr().GenServiceID()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func NewHttpServerService(port uint16) *HttpServerService {
|
|||||||
http := new(HttpServerService)
|
http := new(HttpServerService)
|
||||||
|
|
||||||
http.port = port
|
http.port = port
|
||||||
http.Init(http, 0)
|
http.Init(http)
|
||||||
return http
|
return http
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func NewWSServerService(port uint16) *WSServerService {
|
|||||||
|
|
||||||
wss.port = port
|
wss.port = port
|
||||||
|
|
||||||
wss.Init(wss, 0)
|
wss.Init(wss)
|
||||||
return wss
|
return wss
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user