fusenapi/server/render/consumer/assemble_render_data.go
laodaming 31a3966e39 fix
2023-08-07 19:13:16 +08:00

23 lines
554 B
Go

package consumer
import (
"encoding/json"
"fusenapi/utils/websocket_data"
"github.com/zeromicro/go-zero/core/logx"
)
// 消费渲染需要组装的数据
type MqConsumerRenderAssemble struct {
}
func (m *MqConsumerRenderAssemble) Run(data []byte) error {
logx.Info("收到需要组装的消息:", string(data))
var parseInfo websocket_data.AssembleRenderData
if err := json.Unmarshal(data, &parseInfo); err != nil {
logx.Error("MqConsumerRenderAssemble数据格式错误:", err)
return nil //不返回错误就删除消息
}
return nil
}