From 2d5ae8ea0110117141b7bedba541fccdc57450a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 17 Feb 2020 16:19:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=97=A5=E8=AE=A2=E5=8D=95=E6=89=93?= =?UTF-8?q?=E6=AC=BE=E6=8F=92=E5=85=A5=E6=97=A5=E5=BF=97=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/event/event.go | 12 ++++++++---- business/partner/purchase/jx/localjx/order.go | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/business/jxstore/event/event.go b/business/jxstore/event/event.go index a9a682e93..1d464bc75 100644 --- a/business/jxstore/event/event.go +++ b/business/jxstore/event/event.go @@ -31,7 +31,7 @@ type CheckCookie struct { Status string `json:"status"` } -func AddOperateEvent(ctx *jxcontext.Context, accessUUID, jsonData string, errCode, errMsg string, useTime int) (err error) { +func AddOperateEvent(ctx *jxcontext.Context, accessUUID, jsonData string, errCode, errMsg string, useTime int, apiFunctionSpec string) (err error) { var ( apiFunction string db = dao.GetDB() @@ -39,9 +39,13 @@ func AddOperateEvent(ctx *jxcontext.Context, accessUUID, jsonData string, errCod if ctx.GetRequest() == nil { return nil } - url := ctx.GetRequest().URL.Path - if url != "" { - apiFunction = url[strings.LastIndex(url, "/")+1 : len(url)] + if apiFunctionSpec != "" { + url := ctx.GetRequest().URL.Path + if url != "" { + apiFunction = url[strings.LastIndex(url, "/")+1 : len(url)] + } + } else { + apiFunction = apiFunctionSpec } if apiFunction != "" { if apiFunction[0:3] == "Get" || NoUseEventMap[apiFunction] != "" { diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index fe2b6aa06..0bb68ed63 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -762,7 +762,7 @@ func AutoPayForPopluarMan(ctx *jxcontext.Context) (err error) { } else { errCode = model.ErrCodeSuccess } - err = event.AddOperateEvent(ctx, ctx.GetTrackInfo(), cms.BuildDiffData(mapResult), errCode, errMsg, 0) + err = event.AddOperateEvent(ctx, ctx.GetTrackInfo(), cms.BuildDiffData(mapResult), errCode, errMsg, 0, "AutoPayForPopluarMan") return err }