重构: 各类型 Controller 接口精简,配合 framework-v2 internal/handler 收拢公共实现
app.go/condflow.go/cron.go/event_stream.go/executor.go/gobridge.go/grpc.go/job.go/mcp.go/mqtt.go/res_virtual_table.go/ws.go/controller.go/support/service.go 精简掉搬到 framework-v2 internal/handler 里的公共默认实现,只保留接口定义。
This commit is contained in:
@@ -2,7 +2,6 @@ package contracts
|
||||
|
||||
import (
|
||||
"git.fsdpf.net/go/req"
|
||||
"github.com/samber/do/v2"
|
||||
)
|
||||
|
||||
type MqttService interface {
|
||||
@@ -56,40 +55,3 @@ type Mqtt interface {
|
||||
// OnRetainedExpired(g GlobalParams, topic string) error
|
||||
}
|
||||
|
||||
type MqttHandle struct {
|
||||
Controller
|
||||
}
|
||||
|
||||
func (this *MqttHandle) OnConnect(g req.GlobalParams) error {
|
||||
return ErrFuncNotImplemented
|
||||
}
|
||||
|
||||
func (this *MqttHandle) OnDisconnect(g req.GlobalParams) error {
|
||||
return ErrFuncNotImplemented
|
||||
}
|
||||
|
||||
func (this *MqttHandle) OnSubscribed(g req.GlobalParams, topic string) error {
|
||||
return ErrFuncNotImplemented
|
||||
}
|
||||
|
||||
func (this MqttHandle) OnUnsubscribed(g req.GlobalParams, topic string) error {
|
||||
return ErrFuncNotImplemented
|
||||
}
|
||||
|
||||
func (this MqttHandle) OnMessage(g req.GlobalParams, topic string, retain bool, qos byte) error {
|
||||
return ErrFuncNotImplemented
|
||||
}
|
||||
|
||||
func (this MqttHandle) OnMessageDropped(g req.GlobalParams, topic string, retain bool, qos byte) error {
|
||||
return ErrFuncNotImplemented
|
||||
}
|
||||
|
||||
func (this MqttHandle) OnPublish(g req.GlobalParams, topic string, retain bool, qos byte, raw []byte) ([]byte, error) {
|
||||
return nil, ErrFuncNotImplemented
|
||||
}
|
||||
|
||||
func NewMqttController(container do.Injector) Mqtt {
|
||||
return &MqttHandle{
|
||||
Controller: &BaseController{container},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user