|
@@ -38,7 +38,7 @@ func adsHandler(c *gin.Context) {
|
38
|
38
|
|
39
|
39
|
log.Printf("%+v", request)
|
40
|
40
|
|
41
|
|
- // 放这里主要为了拿到reqeust id做日志记录
|
|
41
|
+ // 放这里主要为了拿到request id做日志记录
|
42
|
42
|
dspInfo := utils.DspParam{}
|
43
|
43
|
dspInfo.Init()
|
44
|
44
|
|
|
@@ -83,7 +83,7 @@ func adsHandler(c *gin.Context) {
|
83
|
83
|
c.String(404, "ip 2 region failed: %s", err)
|
84
|
84
|
return
|
85
|
85
|
}
|
86
|
|
- fmt.Printf("ip 2 region: %s, %+v\n", ip, ipInfo)
|
|
86
|
+ log.WithField("request_id", dspInfo.RequestId).Infof("ip 2 region: %s, %+v", ip, ipInfo)
|
87
|
87
|
|
88
|
88
|
// 上報
|
89
|
89
|
if request.NewAdsFlag == 1 {
|
|
@@ -159,10 +159,8 @@ func adsHandler(c *gin.Context) {
|
159
|
159
|
// 需要凭空
|
160
|
160
|
log.WithField("request_id", dspInfo.RequestId).Infof("need control: %d", lastReqTime)
|
161
|
161
|
needControl = true
|
162
|
|
- device.SetAdsTagLog(advertiser, request.ReqSource, "DS_FREQ_0", cityCode)
|
163
|
162
|
} else {
|
164
|
163
|
device.SetIpReqTime(ip, time.Now().Unix())
|
165
|
|
- device.SetAdsTagLog(advertiser, request.ReqSource, "DS_FREQ_1", cityCode)
|
166
|
164
|
}
|
167
|
165
|
|
168
|
166
|
//### 检查是否是ip黑名单
|
|
@@ -173,7 +171,6 @@ func adsHandler(c *gin.Context) {
|
173
|
171
|
return
|
174
|
172
|
}
|
175
|
173
|
if isIpBlack {
|
176
|
|
- graylog.LogApi("black_ip_list", ip, "", request.ReqSource)
|
177
|
174
|
device.SetAdsTagLog(advertiser, request.ReqSource, "DS_BLACK_IP", cityCode)
|
178
|
175
|
}
|
179
|
176
|
|
|
@@ -270,7 +267,7 @@ func adsHandler(c *gin.Context) {
|
270
|
267
|
IP string `json:"ip"`
|
271
|
268
|
City string `json:"city"`
|
272
|
269
|
CityCode int `json:"city_code"`
|
273
|
|
- Province string
|
|
270
|
+ Province string `json:"province"`
|
274
|
271
|
HitFlag int `json:"hit_flag"`
|
275
|
272
|
LeftCnt int `json:"left_cnt"`
|
276
|
273
|
ReplaceUa string `json:"replace_ua"`
|