mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-12 22:54:43 +08:00
去掉servicetype
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -61,7 +61,7 @@ func NewHttpServerService(port uint16) *HttpServerService {
|
||||
http := new(HttpServerService)
|
||||
|
||||
http.port = port
|
||||
http.Init(http, 0)
|
||||
http.Init(http)
|
||||
return http
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ func NewWSServerService(port uint16) *WSServerService {
|
||||
|
||||
wss.port = port
|
||||
|
||||
wss.Init(wss, 0)
|
||||
wss.Init(wss)
|
||||
return wss
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user