This commit is contained in:
ziming 2025-06-20 10:02:49 +08:00
parent 5e5c13d9dc
commit 4ca7aec637
2 changed files with 16 additions and 0 deletions

View File

@ -38,6 +38,7 @@ func NewHTTPServer(
srv.Route("/voucher/").POST("notifyRetry/{id}", cmb.NotifyRetry)
srv.Route("/voucher/").POST("queryOrder/{order_no}", cmb.QueryOrder)
srv.Route("/voucher/").POST("queryStock/{product_no}", cmb.QueryStock)
srv.Route("/voucher/").POST("registerTag/{batch_no}", cmb.RegisterTag)
srv.Route("/voucher/").POST("pushWechatQuery", cmb.PushWechatQuery)
srv.Route("/voucher/").POST("timeSliceQueryPush", cmb.TimeSliceQueryPush)

View File

@ -41,6 +41,21 @@ func (this *CmbService) QueryOrder(ctx http.Context) error {
})
}
func (this *CmbService) QueryStock(ctx http.Context) error {
no := ctx.Vars().Get("product_no")
if no == "" {
return fmt.Errorf("product_no is empty")
}
resp, err := this.VoucherBiz.CmbProductQuery(ctx, no)
if err != nil {
return err
}
return ctx.JSON(http2.StatusOK, resp)
}
func (this *CmbService) PushWechatQuery(ctx http.Context) error {
bodyBytes, err := io.ReadAll(ctx.Request().Body)