register tag

This commit is contained in:
ziming 2025-06-19 10:30:34 +08:00
parent adbdc0e4bd
commit 854e5a9e7e
3 changed files with 9 additions and 9 deletions

View File

@ -8,9 +8,9 @@ import (
"voucher/internal/biz/bo" "voucher/internal/biz/bo"
) )
func (v *VoucherBiz) PushWechatRetry(ctx context.Context, productNo string) error { func (v *VoucherBiz) PushWechatRetry(ctx context.Context, batchNo string) error {
product, err := v.ProductRepo.GetByProductNo(ctx, productNo) product, err := v.ProductRepo.GetByBatchNo(ctx, batchNo)
if err != nil { if err != nil {
return err return err
} }

View File

@ -38,10 +38,10 @@ func NewHTTPServer(
srv.Route("/voucher/").POST("notifyRetry/{id}", cmb.NotifyRetry) srv.Route("/voucher/").POST("notifyRetry/{id}", cmb.NotifyRetry)
srv.Route("/voucher/").POST("queryOrder/{order_no}", cmb.QueryOrder) srv.Route("/voucher/").POST("queryOrder/{order_no}", cmb.QueryOrder)
srv.Route("/voucher/").POST("registerTag/{product_no}", cmb.RegisterTag) srv.Route("/voucher/").POST("registerTag/{batch_no}", cmb.RegisterTag)
srv.Route("/voucher/").POST("pushWechatQuery", cmb.PushWechatQuery) srv.Route("/voucher/").POST("pushWechatQuery", cmb.PushWechatQuery)
srv.Route("/voucher/").POST("timeSliceQueryPush", cmb.TimeSliceQueryPush) srv.Route("/voucher/").POST("timeSliceQueryPush", cmb.TimeSliceQueryPush)
srv.Route("/voucher/").POST("pushWechatRetry/{product_no}", cmb.PushWechatRetry) srv.Route("/voucher/").POST("pushWechatRetry/{batch_no}", cmb.PushWechatRetry)
v1.RegisterCmbHTTPServer(srv, cmb) v1.RegisterCmbHTTPServer(srv, cmb)

View File

@ -104,17 +104,17 @@ func (this *CmbService) TimeSliceQueryPush(ctx http.Context) error {
func (this *CmbService) PushWechatRetry(ctx http.Context) error { func (this *CmbService) PushWechatRetry(ctx http.Context) error {
productNo := ctx.Vars().Get("product_no") batchNo := ctx.Vars().Get("batch_no")
if productNo == "" { if batchNo == "" {
return fmt.Errorf("product_no is empty") return fmt.Errorf("batch_no is empty")
} }
err := this.VoucherBiz.PushWechatRetry(ctx, productNo) err := this.VoucherBiz.PushWechatRetry(ctx, batchNo)
if err != nil { if err != nil {
return err return err
} }
return ctx.JSON(http2.StatusOK, map[string]interface{}{ return ctx.JSON(http2.StatusOK, map[string]interface{}{
"data": productNo, "data": batchNo,
}) })
} }