This commit is contained in:
李子铭 2025-03-08 14:20:19 +08:00
parent 5dbd4762b4
commit 9b607a61ed
2 changed files with 6 additions and 5 deletions

View File

@ -11,7 +11,7 @@ func Test_OrderProducer(t *testing.T) {
m := make(map[string]*conf.EventMap)
m["order"] = &conf.EventMap{
Topic: "order",
Topic: "voucher_order_order",
}
c := &conf.RocketMQ{
@ -46,7 +46,7 @@ func Test_NotifyProducer(t *testing.T) {
m := make(map[string]*conf.EventMap)
m["notify"] = &conf.EventMap{
Topic: "notify",
Topic: "voucher_order_notify",
}
c := &conf.RocketMQ{
@ -64,15 +64,15 @@ func Test_NotifyProducer(t *testing.T) {
}
ctx := context.Background()
orderNo := ""
shardingKey := "752893584043413505_752893587050733569"
eventMap := c.EventMap["notify"]
sendOption := []mq.SendOption{
mq.WithSendShardingKeysOption(orderNo),
mq.WithSendShardingKeysOption(shardingKey),
}
if err = mqx.SendSync(ctx, eventMap.Topic, []byte("{}"), sendOption...); err != nil {
t.Errorf("入队失败 error = %v", err)
t.Errorf("回调通知入队失败 error = %v", err)
return
}
}

View File

@ -35,6 +35,7 @@ func (p *OrderNotifyRepoImpl) Create(ctx context.Context, req *bo.OrderNotifyBo)
OutRequestNo: req.OutRequestNo,
Status: vo.OrderNotifyStatusWait.GetValue(),
Request: req.Request,
Responses: "{}",
NotifyUrl: req.NotifyUrl,
CreateTime: &now,
UpdateTime: &now,