et-go 20240919重建
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
592 B

package processors
import (
"context"
"errors"
"gitea.anxinyun.cn/container/common_models"
"log"
)
type Process struct {
name string
}
func NewProcess(name string) *Process {
return &Process{name: name}
}
func (p *Process) Process(ctx context.Context, params any) (any, error) {
log.Printf("[%s]开始执行", p.name)
if ProcessData, ok := params.(*common_models.ProcessData); !ok {
return nil, errors.New("不是[DeviceData]类型数据")
} else {
log.Printf("[%s]-[%s]处理...", ProcessData.DeviceData.DeviceId, ProcessData.DeviceData.Name)
return ProcessData, nil
}
}