From 9b607a61ed0c2177d785bf07dbf13b76415af0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Sat, 8 Mar 2025 14:20:19 +0800 Subject: [PATCH] cmb --- internal/data/mq_test.go | 10 +++++----- internal/data/repoimpl/order_notify.go | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/data/mq_test.go b/internal/data/mq_test.go index ed69ef7..ce448b5 100644 --- a/internal/data/mq_test.go +++ b/internal/data/mq_test.go @@ -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 } } diff --git a/internal/data/repoimpl/order_notify.go b/internal/data/repoimpl/order_notify.go index 4a882ff..688ff11 100644 --- a/internal/data/repoimpl/order_notify.go +++ b/internal/data/repoimpl/order_notify.go @@ -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,