[feat] NewWsBaseController 参数调整

This commit is contained in:
what 2023-06-05 14:13:27 +08:00
parent 02cf3c74a5
commit 46afbc178a

View File

@ -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
}