- update log

master v1.0.75
李光春 1 year ago
parent 928edfc60e
commit 1dceba325c

@ -1,5 +1,5 @@
package go_library
func Version() string {
return "1.0.74"
return "1.0.75"
}

@ -25,7 +25,7 @@ type apiPostgresqlLog struct {
RequestIp string `gorm:"default:0.0.0.0;index;comment:【请求】请求Ip" json:"request_ip,omitempty"` //【请求】请求Ip
ResponseHeader string `gorm:"comment:【返回】头部" json:"response_header,omitempty"` //【返回】头部
ResponseStatusCode int `gorm:"index;comment:【返回】状态码" json:"response_status_code,omitempty"` //【返回】状态码
ResponseBody string `gorm:"comment:【返回】数据" json:"response_content,omitempty"` //【返回】数据
ResponseBody string `gorm:"comment:【返回】数据" json:"response_body,omitempty"` //【返回】数据
ResponseContentLength int64 `gorm:"comment:【返回】大小" json:"response_content_length,omitempty"` //【返回】大小
ResponseTime time.Time `gorm:"index;comment:【返回】时间" json:"response_time,omitempty"` //【返回】时间
SystemHostName string `gorm:"index;comment:【系统】主机名" json:"system_host_name,omitempty"` //【系统】主机名
@ -123,7 +123,7 @@ func (c *ApiClient) gormMiddlewareXml(ctx context.Context, request gorequest.Res
}
if !request.HeaderIsImg() {
if len(request.ResponseBody) > 0 {
data.ResponseBody = dorm.JsonEncodeNoError(request.ResponseBody) //【返回】内容
data.ResponseBody = dorm.XmlEncodeNoError(dorm.XmlDecodeNoError(request.ResponseBody)) //【返回】内容
}
}

@ -7,7 +7,6 @@ import (
"github.com/dtapps/go-library/utils/gotime"
"github.com/dtapps/go-library/utils/gourl"
"github.com/gin-gonic/gin"
"log"
"time"
)
@ -104,7 +103,6 @@ func (c *GinClient) gormRecordJson(ginCtx *gin.Context, traceId string, requestT
if len(requestBody) > 0 {
data.RequestBody = dorm.JsonEncodeNoError(requestBody) //【请求】请求主体
log.Println(data.RequestBody)
}
c.gormRecord(data)
@ -143,7 +141,6 @@ func (c *GinClient) gormRecordXml(ginCtx *gin.Context, traceId string, requestTi
if len(requestBody) > 0 {
data.RequestBody = dorm.XmlEncodeNoError(dorm.XmlDecodeNoError(requestBody)) //【请求】请求内容
log.Println(data.RequestBody)
}
c.gormRecord(data)

Loading…
Cancel
Save