From d1851413fbf2ed7a216ee4903bf0a98da765b1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Fri, 13 May 2022 13:55:59 +0800 Subject: [PATCH] update time --- api.go | 5 ++--- gin.go | 5 ++--- version.go | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/api.go b/api.go index 4f6bafc..ad0a2dd 100644 --- a/api.go +++ b/api.go @@ -3,7 +3,6 @@ package golog import ( "gorm.io/datatypes" "gorm.io/gorm" - "time" ) // 接口定义 @@ -15,7 +14,7 @@ type api struct { // ApiPostgresqlLog 结构体 type ApiPostgresqlLog struct { LogId uint `gorm:"primaryKey"` //【记录】编号 - RequestTime time.Time `gorm:"index"` //【请求】时间 + RequestTime TimeString `gorm:"index"` //【请求】时间 RequestUri string `gorm:"type:text"` //【请求】链接 RequestUrl string `gorm:"type:text"` //【请求】链接 RequestApi string `gorm:"type:text;index"` //【请求】接口 @@ -26,7 +25,7 @@ type ApiPostgresqlLog struct { ResponseStatusCode int `gorm:"type:bigint"` //【返回】状态码 ResponseBody datatypes.JSON `gorm:"type:jsonb"` //【返回】内容 ResponseContentLength int64 `gorm:"type:bigint"` //【返回】大小 - ResponseTime time.Time `gorm:"index"` //【返回】时间 + ResponseTime TimeString `gorm:"index"` //【返回】时间 } // AutoMigrate 自动迁移 diff --git a/gin.go b/gin.go index 832ff03..cbdcf08 100644 --- a/gin.go +++ b/gin.go @@ -3,7 +3,6 @@ package golog import ( "gorm.io/datatypes" "gorm.io/gorm" - "time" ) // 框架定义 @@ -16,7 +15,7 @@ type gin struct { type GinPostgresqlLog struct { LogId uint `gorm:"primaryKey"` //【记录】编号 TraceId string `gorm:"type:text"` //【系统】链编号 - RequestTime time.Time `gorm:"index"` //【请求】时间 + RequestTime TimeString `gorm:"index"` //【请求】时间 RequestUri string `gorm:"type:text"` //【请求】请求链接 域名+路径+参数 RequestUrl string `gorm:"type:text"` //【请求】请求链接 域名+路径 RequestApi string `gorm:"type:text;index"` //【请求】请求接口 路径 @@ -33,7 +32,7 @@ type GinPostgresqlLog struct { RequestIpCity string `gorm:"type:text"` //【请求】请求客户端城市 RequestIpIsp string `gorm:"type:text"` //【请求】请求客户端运营商 RequestHeader datatypes.JSON `gorm:"type:jsonb"` //【请求】请求头 - ResponseTime time.Time `gorm:"index"` //【返回】时间 + ResponseTime TimeString `gorm:"index"` //【返回】时间 ResponseCode int `gorm:"type:bigint"` //【返回】状态码 ResponseMsg string `gorm:"type:text"` //【返回】描述 ResponseData datatypes.JSON `gorm:"type:jsonb"` //【返回】数据 diff --git a/version.go b/version.go index b2dfcd6..e6b92c1 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package golog -const Version = "1.0.2" +const Version = "1.0.3"