From c4d22be7c99a02b06b7e1f13a32c70c0e254c48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Sat, 17 Sep 2022 16:58:38 +0800 Subject: [PATCH] - update mongo --- api_mongo.go | 15 --------------- const.go | 2 +- gin_mongo.go | 21 +++------------------ 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/api_mongo.go b/api_mongo.go index 25704e1..f5dacba 100644 --- a/api_mongo.go +++ b/api_mongo.go @@ -152,16 +152,6 @@ func (c *ApiClient) mongoCreateIndexes(ctx context.Context) { Key: "response_time", Value: -1, }}, - }, { - Keys: bson.D{{ - Key: "system_host_name", - Value: 1, - }}, - }, { - Keys: bson.D{{ - Key: "system_inside_ip", - Value: 1, - }}, }, { Keys: bson.D{{ Key: "system_os", @@ -172,11 +162,6 @@ func (c *ApiClient) mongoCreateIndexes(ctx context.Context) { Key: "system_arch", Value: -1, }}, - }, { - Keys: bson.D{{ - Key: "system_cpu_quantity", - Value: 1, - }}, }, { Keys: bson.D{{ Key: "go_version", diff --git a/const.go b/const.go index 3de75f4..2246d3f 100644 --- a/const.go +++ b/const.go @@ -1,5 +1,5 @@ package golog const ( - Version = "1.0.77" + Version = "1.0.78" ) diff --git a/gin_mongo.go b/gin_mongo.go index 76f33b0..a5dfb02 100644 --- a/gin_mongo.go +++ b/gin_mongo.go @@ -44,7 +44,7 @@ type ginMongoLog struct { RequestBody interface{} `json:"request_body,omitempty" bson:"request_body,omitempty"` //【请求】请求主体 RequestUrlQuery interface{} `json:"request_url_query,omitempty" bson:"request_url_query,omitempty"` //【请求】请求URL参数 RequestIp string `json:"request_ip,omitempty" bson:"request_ip,omitempty"` //【请求】请求客户端Ip - RequestIpCountry string `json:"request_ip_country,omitempty" bson:"request_ip_country,omitempty"` //【请求】请求客户端城市 + RequestIpCountry string `json:"request_ip_country,omitempty" bson:"request_ip_country,omitempty"` //【请求】请求客户端国家 RequestIpProvince string `json:"request_ip_province,omitempty" bson:"request_ip_province,omitempty"` //【请求】请求客户端省份 RequestIpCity string `json:"request_ip_city,omitempty" bson:"request_ip_city,omitempty"` //【请求】请求客户端城市 RequestIpIsp string `json:"request_ip_isp,omitempty" bson:"request_ip_isp,omitempty"` //【请求】请求客户端运营商 @@ -158,11 +158,6 @@ func (c *GinClient) mongoCreateIndexes(ctx context.Context) { Key: "request_method", Value: 1, }}, - }, { - Keys: bson.D{{ - Key: "request_proto", - Value: 1, - }}, }, { Keys: bson.D{{ Key: "request_ip", @@ -203,11 +198,6 @@ func (c *GinClient) mongoCreateIndexes(ctx context.Context) { Key: "system_host_name", Value: 1, }}, - }, { - Keys: bson.D{{ - Key: "system_inside_ip", - Value: 1, - }}, }, { Keys: bson.D{{ Key: "system_os", @@ -218,11 +208,6 @@ func (c *GinClient) mongoCreateIndexes(ctx context.Context) { Key: "system_arch", Value: -1, }}, - }, { - Keys: bson.D{{ - Key: "system_cpu_quantity", - Value: 1, - }}, }, { Keys: bson.D{{ Key: "go_version", @@ -286,7 +271,7 @@ func (c *GinClient) mongoRecordJson(ginCtx *gin.Context, traceId string, request RequestReferer: ginCtx.Request.Referer(), //【请求】请求referer RequestUrlQuery: ginCtx.Request.URL.Query(), //【请求】请求URL参数 RequestIp: clientIp, //【请求】请求客户端Ip - RequestIpCountry: requestClientIpCountry, //【请求】请求客户端城市 + RequestIpCountry: requestClientIpCountry, //【请求】请求客户端国家 RequestIpProvince: requestClientIpProvince, //【请求】请求客户端省份 RequestIpCity: requestClientIpCity, //【请求】请求客户端城市 RequestIpIsp: requestClientIpIsp, //【请求】请求客户端运营商 @@ -347,7 +332,7 @@ func (c *GinClient) mongoRecordXml(ginCtx *gin.Context, traceId string, requestT RequestReferer: ginCtx.Request.Referer(), //【请求】请求referer RequestUrlQuery: ginCtx.Request.URL.Query(), //【请求】请求URL参数 RequestIp: clientIp, //【请求】请求客户端Ip - RequestIpCountry: requestClientIpCountry, //【请求】请求客户端城市 + RequestIpCountry: requestClientIpCountry, //【请求】请求客户端国家 RequestIpProvince: requestClientIpProvince, //【请求】请求客户端省份 RequestIpCity: requestClientIpCity, //【请求】请求客户端城市 RequestIpIsp: requestClientIpIsp, //【请求】请求客户端运营商