// Copyright 2019 getensh.com. All rights reserved. // Use of this source code is governed by getensh.com. package utils import ( //"fmt" "gd_vehicle/apis" "time" ) func AppendLog(LReqs *[]apis.ThirdpartLogWrite, LReq *apis.ThirdpartLogWrite, startTime uint64) { endTime := uint64(time.Now().UnixNano()) LReq.Elapsed = float64(endTime-startTime) / 1000000 LReq.Timestamp = int64(startTime / 1e9) *LReqs = append(*LReqs, *LReq) } func SetAccessLogReqCodeMsgState(lReq *apis.ThirdpartLogWrite, code int, rawCode, msg string, state bool) { lReq.State = state lReq.Msg = msg if lReq.State && code != 20001 && msg == "" { lReq.Msg = "成功" } lReq.Code = code lReq.RawCode = rawCode }