feat: 请求写日志fix
This commit is contained in:
parent
888fb18165
commit
74c1039d1c
|
@ -38,6 +38,7 @@ func ServerRecovery() gin.HandlerFunc {
|
||||||
//"request_uri": c.Request.URL.Path,
|
//"request_uri": c.Request.URL.Path,
|
||||||
//"data": make(map[string]string),
|
//"data": make(map[string]string),
|
||||||
})
|
})
|
||||||
|
c.Abort()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,15 @@ func RequestLogUpdate(log *orderrequestlogmodel.OrderRequestLog) (logOut *orderr
|
||||||
func AddRequestLog(requestDataByte []byte, ip string, url string) (int64, int) {
|
func AddRequestLog(requestDataByte []byte, ip string, url string) (int64, int) {
|
||||||
tempMap := make(map[string]interface{})
|
tempMap := make(map[string]interface{})
|
||||||
_ = json.Unmarshal(requestDataByte, &tempMap)
|
_ = json.Unmarshal(requestDataByte, &tempMap)
|
||||||
|
var outTradeNo string
|
||||||
|
if tempMap["out_trade_no"] != nil {
|
||||||
|
if v, ok := tempMap["out_trade_no"].(string); ok {
|
||||||
|
outTradeNo = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
requestLog, checkCode := RequestLogCreate(&orderrequestlogmodel.OrderRequestLog{
|
requestLog, checkCode := RequestLogCreate(&orderrequestlogmodel.OrderRequestLog{
|
||||||
OutTradeNo: tempMap["out_trade_no"].(string),
|
OutTradeNo: outTradeNo,
|
||||||
IpAddress: ip,
|
IpAddress: ip,
|
||||||
MerchantRequest: string(requestDataByte),
|
MerchantRequest: string(requestDataByte),
|
||||||
URL: url,
|
URL: url,
|
||||||
|
|
Loading…
Reference in New Issue