"2006-01-02 15:04:05.000" 批次查询接口时间调整
This commit is contained in:
parent
86ae352bcc
commit
96c60af6a3
|
|
@ -49,10 +49,18 @@ func Test_NotifyProducer(t *testing.T) {
|
|||
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{
|
||||
Addr: "http://rmq-cn-nwy3fn4ex09.cn-chengdu.rmq.aliyuncs.com:8080",
|
||||
AccessKey: "Qecl4cea2IAZPKoD",
|
||||
SecretKey: "Z3596KCFA9RAUR6k",
|
||||
Addr: "http://rmq-cn-j4g3zpaiz06-vpc.cn-beijing.rmq.aliyuncs.com:8080",
|
||||
AccessKey: "X3Dc7lRupY2bWc91",
|
||||
SecretKey: "5G4h85f4my10P4vK",
|
||||
SecretToken: "",
|
||||
EventMap: m,
|
||||
}
|
||||
|
|
@ -64,7 +72,7 @@ func Test_NotifyProducer(t *testing.T) {
|
|||
}
|
||||
|
||||
ctx := context.Background()
|
||||
shardingKey := "3"
|
||||
shardingKey := "22"
|
||||
|
||||
eventMap := c.EventMap["notifyRetry"]
|
||||
sendOption := []mq.SendOption{
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ func NewHTTPServer(
|
|||
return ctx.String(http2.StatusOK, "pong")
|
||||
})
|
||||
|
||||
srv.Route("/voucher/").GET("notifyRetry/{id}", cmb.NotifyRetry)
|
||||
|
||||
v1.RegisterCmbHTTPServer(srv, cmb)
|
||||
|
||||
return srv
|
||||
|
|
|
|||
|
|
@ -2,8 +2,11 @@ package service
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
"github.com/go-kratos/kratos/v2/transport/http"
|
||||
"github.com/robfig/cron"
|
||||
"strconv"
|
||||
v1 "voucher/api/v1"
|
||||
"voucher/internal/biz"
|
||||
"voucher/internal/biz/bo"
|
||||
|
|
@ -55,3 +58,17 @@ func (c *CmbService) GetResponse(ctx context.Context, replyBizContent []byte) (*
|
|||
|
||||
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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue