feat: 请求写日志fix

This commit is contained in:
wolter 2024-12-25 13:39:07 +08:00
parent 888fb18165
commit 74c1039d1c
2 changed files with 8 additions and 1 deletions

View File

@ -38,6 +38,7 @@ func ServerRecovery() gin.HandlerFunc {
//"request_uri": c.Request.URL.Path,
//"data": make(map[string]string),
})
c.Abort()
}
}()

View File

@ -35,9 +35,15 @@ func RequestLogUpdate(log *orderrequestlogmodel.OrderRequestLog) (logOut *orderr
func AddRequestLog(requestDataByte []byte, ip string, url string) (int64, int) {
tempMap := make(map[string]interface{})
_ = 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{
OutTradeNo: tempMap["out_trade_no"].(string),
OutTradeNo: outTradeNo,
IpAddress: ip,
MerchantRequest: string(requestDataByte),
URL: url,