del code
This commit is contained in:
parent
bc4c6451e5
commit
517559eed1
1
go.sum
1
go.sum
|
|
@ -133,7 +133,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
|
|||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=
|
||||
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ func NewHTTPServer(
|
|||
|
||||
srv.Route("/voucher/").GET("notifyRetry/{id}", cmb.NotifyRetry)
|
||||
srv.Route("/voucher/").GET("queryOrder/{order_no}", cmb.QueryOrder)
|
||||
srv.Route("/voucher/").GET("queryByOrderNo/{order_no}", cmb.QueryByOrderNo)
|
||||
|
||||
v1.RegisterCmbHTTPServer(srv, cmb)
|
||||
|
||||
|
|
|
|||
|
|
@ -90,55 +90,3 @@ func (this *CmbService) QueryOrder(ctx http.Context) error {
|
|||
"data": str,
|
||||
})
|
||||
}
|
||||
|
||||
func (this *CmbService) QueryByOrderNo(ctx http.Context) error {
|
||||
|
||||
// 获取访问ip
|
||||
ip := ctx.Request().Header.Get("X-Forwarded-For")
|
||||
if len(ip) == 0 {
|
||||
ip = ctx.Request().RemoteAddr
|
||||
}
|
||||
if ip != "117.175.169.61" && ip != "127.0.0.1" {
|
||||
return fmt.Errorf("ip check fail,IP:%s", ip)
|
||||
}
|
||||
|
||||
orderNo := ctx.Vars().Get("order_no")
|
||||
if orderNo == "" {
|
||||
return fmt.Errorf("orderNo is empty")
|
||||
}
|
||||
|
||||
order, err := this.VoucherBiz.OrderQuery(ctx, orderNo)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msg := "# <font color='green'>" +
|
||||
"<h1>订单查询</h1>" +
|
||||
"</font> \n" +
|
||||
"<font color='black'>" +
|
||||
"查询结果" +
|
||||
"[<font color='red'>%s</font>]悉知" +
|
||||
"</font>"
|
||||
|
||||
s := "\n订单号:%s\n招行订单号:%s\n订单状态:%s\nopenid:%s\n微信券ID:%s\n商品编号:%s\n批次号:%s\n商户号:%s\nappId:%s\n订单创建时间:%s\n" +
|
||||
"领取成功时间(成功即有该值):%s\n最后一次核销时间(核销即有该值):%s\n订单备注说明(失败说明):%s\n"
|
||||
orderMsg := fmt.Sprintf(s,
|
||||
orderNo,
|
||||
order.OutBizNo,
|
||||
order.Status.GetText(),
|
||||
order.Account,
|
||||
order.VoucherNo,
|
||||
order.ProductNo,
|
||||
order.BatchNo,
|
||||
order.MerchantNo,
|
||||
order.AppID,
|
||||
order.CreateTime.Format("2006-01-02 15:04:05"),
|
||||
order.ReceiveSuccessTime.Format("2006-01-02 15:04:05"),
|
||||
order.LastUseTime.Format("2006-01-02 15:04:05"),
|
||||
order.Remark,
|
||||
)
|
||||
|
||||
str := fmt.Sprintf(msg, orderMsg)
|
||||
|
||||
return ctx.String(http2.StatusOK, str)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue