query1 order
This commit is contained in:
parent
396e53e9fc
commit
2238f24820
|
|
@ -38,7 +38,7 @@ func NewHTTPServer(
|
||||||
|
|
||||||
srv.Route("/voucher/").POST("orderNotifyRetry", cmb.OrderNotifyRetry)
|
srv.Route("/voucher/").POST("orderNotifyRetry", cmb.OrderNotifyRetry)
|
||||||
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}/{phone}", cmb.QueryOrder)
|
||||||
srv.Route("/voucher/").POST("queryStock/{product_no}", cmb.QueryStock)
|
srv.Route("/voucher/").POST("queryStock/{product_no}", cmb.QueryStock)
|
||||||
srv.Route("/voucher/").POST("registerTag/{id}", cmb.RegisterTag)
|
srv.Route("/voucher/").POST("registerTag/{id}", cmb.RegisterTag)
|
||||||
srv.Route("/voucher/").POST("pushWechatQuery", cmb.PushWechatQuery)
|
srv.Route("/voucher/").POST("pushWechatQuery", cmb.PushWechatQuery)
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,24 @@ func (this *CmbService) NotifyRetry(ctx http.Context) error {
|
||||||
return this.VoucherBiz.PushNotifyRetryDelayMQ(ctx, 1, orderNotifyId)
|
return this.VoucherBiz.PushNotifyRetryDelayMQ(ctx, 1, orderNotifyId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var ds = map[string]bool{
|
||||||
|
"13474987525": true,
|
||||||
|
"15221117226": true,
|
||||||
|
"18666173766": true,
|
||||||
|
}
|
||||||
|
|
||||||
func (this *CmbService) QueryOrder(ctx http.Context) error {
|
func (this *CmbService) QueryOrder(ctx http.Context) error {
|
||||||
|
|
||||||
|
phone := ctx.Vars().Get("phone")
|
||||||
|
if phone == "" {
|
||||||
|
return fmt.Errorf("phone is empty")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, ok := ds[phone]
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("无权限~")
|
||||||
|
}
|
||||||
|
|
||||||
orderNo := ctx.Vars().Get("order_no")
|
orderNo := ctx.Vars().Get("order_no")
|
||||||
if orderNo == "" {
|
if orderNo == "" {
|
||||||
return fmt.Errorf("orderNo is empty")
|
return fmt.Errorf("orderNo is empty")
|
||||||
|
|
@ -60,9 +76,7 @@ func (this *CmbService) QueryOrder(ctx http.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.JSON(http2.StatusOK, map[string]interface{}{
|
return ctx.String(http2.StatusOK, str)
|
||||||
"data": str,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CmbService) QueryStock(ctx http.Context) error {
|
func (this *CmbService) QueryStock(ctx http.Context) error {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue