register tag
This commit is contained in:
parent
adbdc0e4bd
commit
854e5a9e7e
|
|
@ -8,9 +8,9 @@ import (
|
|||
"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 {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ func NewHTTPServer(
|
|||
|
||||
srv.Route("/voucher/").POST("notifyRetry/{id}", cmb.NotifyRetry)
|
||||
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("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)
|
||||
|
||||
|
|
|
|||
|
|
@ -104,17 +104,17 @@ func (this *CmbService) TimeSliceQueryPush(ctx http.Context) error {
|
|||
|
||||
func (this *CmbService) PushWechatRetry(ctx http.Context) error {
|
||||
|
||||
productNo := ctx.Vars().Get("product_no")
|
||||
if productNo == "" {
|
||||
return fmt.Errorf("product_no is empty")
|
||||
batchNo := ctx.Vars().Get("batch_no")
|
||||
if batchNo == "" {
|
||||
return fmt.Errorf("batch_no is empty")
|
||||
}
|
||||
|
||||
err := this.VoucherBiz.PushWechatRetry(ctx, productNo)
|
||||
err := this.VoucherBiz.PushWechatRetry(ctx, batchNo)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return ctx.JSON(http2.StatusOK, map[string]interface{}{
|
||||
"data": productNo,
|
||||
"data": batchNo,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue