diff --git a/controller.go b/controller.go index 2067fab..ff14273 100644 --- a/controller.go +++ b/controller.go @@ -82,13 +82,6 @@ func (this BaseController) Dispatch(job string, payload any, u User) error { return do.MustInvoke[Job](this.Container()).Dispatch(job, payload, u) } -func NewHttpBaseController(container *do.Injector, request *http.Request) HttpController { - return &HttpBaseController{ - Controller: &BaseController{container}, - request: request, - } -} - func (this HttpBaseController) Request() *http.Request { return this.request } @@ -109,13 +102,6 @@ func (HttpBaseController) Execute(params GlobalParams) any { return nil } -func NewWsBaseController(ws WsClient, container *do.Injector, request *http.Request) WsController { - return &WsBaseController{ - HttpController: NewHttpBaseController(container, request), - ws: ws, - } -} - func (this WsBaseController) WsClient() WsClient { return this.ws } @@ -129,22 +115,36 @@ func (WsBaseController) WsClientGroup(GlobalParams) WsClientGroup { return defaultWsClientGroup } +func (JobBaseController) Handle(any) error { + return nil +} + +func (GRpcBaseController) GetGRpcServiceDesc() *grpc.ServiceDesc { + return nil +} + +func NewHttpBaseController(container *do.Injector, request *http.Request) HttpController { + return &HttpBaseController{ + Controller: &BaseController{container}, + request: request, + } +} + +func NewWsBaseController(ws WsClient, ctr HttpController) WsController { + return &WsBaseController{ + HttpController: ctr, + ws: ws, + } +} + func NewGRpBaseController(container *do.Injector) JobController { return &JobBaseController{ Controller: &BaseController{container}, } } -func (JobBaseController) Handle(any) error { - return nil -} - func NewJobBaseController(container *do.Injector) GRpController { return &GRpcBaseController{ Controller: &BaseController{container}, } } - -func (GRpcBaseController) GetGRpcServiceDesc() *grpc.ServiceDesc { - return nil -}