update tmall order producer
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user