"2006-01-02 15:04:05.000" 批次查询接口时间调整

This commit is contained in:
ziming 2025-04-14 15:18:58 +08:00
parent 86ae352bcc
commit 96c60af6a3
3 changed files with 31 additions and 4 deletions

View File

@ -49,10 +49,18 @@ func Test_NotifyProducer(t *testing.T) {
Topic: "voucher_order_notifyRetry", Topic: "voucher_order_notifyRetry",
} }
//c := &conf.RocketMQ{
// Addr: "http://rmq-cn-nwy3fn4ex09.cn-chengdu.rmq.aliyuncs.com:8080",
// AccessKey: "Qecl4cea2IAZPKoD",
// SecretKey: "Z3596KCFA9RAUR6k",
// SecretToken: "",
// EventMap: m,
//}
c := &conf.RocketMQ{ c := &conf.RocketMQ{
Addr: "http://rmq-cn-nwy3fn4ex09.cn-chengdu.rmq.aliyuncs.com:8080", Addr: "http://rmq-cn-j4g3zpaiz06-vpc.cn-beijing.rmq.aliyuncs.com:8080",
AccessKey: "Qecl4cea2IAZPKoD", AccessKey: "X3Dc7lRupY2bWc91",
SecretKey: "Z3596KCFA9RAUR6k", SecretKey: "5G4h85f4my10P4vK",
SecretToken: "", SecretToken: "",
EventMap: m, EventMap: m,
} }
@ -64,7 +72,7 @@ func Test_NotifyProducer(t *testing.T) {
} }
ctx := context.Background() ctx := context.Background()
shardingKey := "3" shardingKey := "22"
eventMap := c.EventMap["notifyRetry"] eventMap := c.EventMap["notifyRetry"]
sendOption := []mq.SendOption{ sendOption := []mq.SendOption{

View File

@ -36,6 +36,8 @@ func NewHTTPServer(
return ctx.String(http2.StatusOK, "pong") return ctx.String(http2.StatusOK, "pong")
}) })
srv.Route("/voucher/").GET("notifyRetry/{id}", cmb.NotifyRetry)
v1.RegisterCmbHTTPServer(srv, cmb) v1.RegisterCmbHTTPServer(srv, cmb)
return srv return srv

View File

@ -2,8 +2,11 @@ package service
import ( import (
"context" "context"
"fmt"
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/transport/http"
"github.com/robfig/cron" "github.com/robfig/cron"
"strconv"
v1 "voucher/api/v1" v1 "voucher/api/v1"
"voucher/internal/biz" "voucher/internal/biz"
"voucher/internal/biz/bo" "voucher/internal/biz/bo"
@ -55,3 +58,17 @@ func (c *CmbService) GetResponse(ctx context.Context, replyBizContent []byte) (*
return reply, nil return reply, nil
} }
func (this *CmbService) NotifyRetry(ctx http.Context) error {
id := ctx.Vars().Get("id")
if id == "" {
return fmt.Errorf("id is empty")
}
orderNotifyId, err := strconv.ParseUint(id, 10, 64)
if err != nil {
return err
}
return this.VoucherBiz.PushNotifyRetryDelayMQ(ctx, 1, orderNotifyId)
}