fusenapi/server/render/consumer/assemble_render_data.go

23 lines
554 B
Go
Raw Normal View History

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