diff --git a/backend/app/Platform/Tmall/Producer/TmallOrderProducer.php b/backend/app/Platform/Tmall/Producer/TmallOrderProducer.php index 991d77b..d8019e5 100644 --- a/backend/app/Platform/Tmall/Producer/TmallOrderProducer.php +++ b/backend/app/Platform/Tmall/Producer/TmallOrderProducer.php @@ -13,4 +13,21 @@ class TmallOrderProducer extends OrderProducer # @attention 注解的配置不会在直接 new 实例化时自动应用到对象属性上 protected string $exchange = 'tmall.exchange'; protected string|array $routingKey = 'order.tmall'; + + /** + * 构建消息格式 + * + * @param array $data 原始订单数据 + * @return array + */ + + protected function buildMessage(array $data): array + { + // 根据 RabbitMQ.md 中定义的消息格式规范 + $parent_meta = parent::buildMessage($data); + $parent_meta['platform'] = 'tmall'; + $parent_meta['meta']['source_system'] = 'tmall_api'; + + return $parent_meta; + } }; \ No newline at end of file