|
@@ -158,6 +158,10 @@ func GetFlowPercentDuration(advertiser string, action string) *adslib.FlogContro
|
158
|
158
|
|
159
|
159
|
// 设置回调回来的广告动作的次数
|
160
|
160
|
func SetDistributeActionNum(advertiser string, action string, bannerid int) {
|
|
161
|
+ if adslib.GetConf().TestMode {
|
|
162
|
+ return
|
|
163
|
+ }
|
|
164
|
+
|
161
|
165
|
if advertiser == "" {
|
162
|
166
|
return
|
163
|
167
|
}
|
|
@@ -196,6 +200,9 @@ func GetDeviceIpReport(deviceId string, ip string) (bool, error) {
|
196
|
200
|
|
197
|
201
|
// 设置设备+ip上报的时间点
|
198
|
202
|
func SetDeviceIpReport(deviceid string, ip string) {
|
|
203
|
+ if adslib.GetConf().TestMode {
|
|
204
|
+ return
|
|
205
|
+ }
|
199
|
206
|
conn := ads_redis.RedisConn.Get()
|
200
|
207
|
defer conn.Close()
|
201
|
208
|
|
|
@@ -205,6 +212,9 @@ func SetDeviceIpReport(deviceid string, ip string) {
|
205
|
212
|
|
206
|
213
|
// 设置总请求到广告的次数
|
207
|
214
|
func SetAdsRequestNum(advertiser string, bannerId int) {
|
|
215
|
+ if adslib.GetConf().TestMode {
|
|
216
|
+ return
|
|
217
|
+ }
|
208
|
218
|
if advertiser == "" {
|
209
|
219
|
return
|
210
|
220
|
}
|
|
@@ -220,6 +230,9 @@ func SetAdsRequestNum(advertiser string, bannerId int) {
|
220
|
230
|
}
|
221
|
231
|
|
222
|
232
|
func SetAdsRealRequestNum(advertiser string) {
|
|
233
|
+ if adslib.GetConf().TestMode {
|
|
234
|
+ return
|
|
235
|
+ }
|
223
|
236
|
if advertiser == "" {
|
224
|
237
|
return
|
225
|
238
|
}
|
|
@@ -260,6 +273,9 @@ func GetMinScriptOrderByAdv(advertiser string) (int64, error) {
|
260
|
273
|
|
261
|
274
|
// 设置来源的曝光次数
|
262
|
275
|
func SetReqSourceView(adv string, reqSource string, source string) {
|
|
276
|
+ if adslib.GetConf().TestMode {
|
|
277
|
+ return
|
|
278
|
+ }
|
263
|
279
|
conn := ads_redis.RedisConn.Get()
|
264
|
280
|
defer conn.Close()
|
265
|
281
|
|
|
@@ -309,6 +325,10 @@ func GetFinishedDispatchCount(orderId int64, dispatchType string, curTime time.T
|
309
|
325
|
// 增加已经投放的量
|
310
|
326
|
// dispatchType: "click", "show"
|
311
|
327
|
func IncrFinishedDispatchCount(orderId int64, dispatchType string, incrCnt int, curTime time.Time) (int, error) {
|
|
328
|
+ if adslib.GetConf().TestMode {
|
|
329
|
+ return 0, nil
|
|
330
|
+ }
|
|
331
|
+
|
312
|
332
|
conn := ads_redis.RedisConn.Get()
|
313
|
333
|
defer conn.Close()
|
314
|
334
|
|
|
@@ -347,6 +367,10 @@ func GetPreMinuteFinishedDispatchCount(orderId int64, dispatchType string, curTi
|
347
|
367
|
// 增加当前分钟已经投放的量
|
348
|
368
|
// dispatchType: "click", "show"
|
349
|
369
|
func IncrPreMinuteFinishedDispatchCount(orderId int64, dispatchType string, incrCnt int, curTime time.Time) (int, error) {
|
|
370
|
+ if adslib.GetConf().TestMode {
|
|
371
|
+ return 0, nil
|
|
372
|
+ }
|
|
373
|
+
|
350
|
374
|
conn := ads_redis.RedisConn.Get()
|
351
|
375
|
defer conn.Close()
|
352
|
376
|
|
|
@@ -363,6 +387,9 @@ func IncrPreMinuteFinishedDispatchCount(orderId int64, dispatchType string, incr
|
363
|
387
|
// 设置总计划投放数量
|
364
|
388
|
// dispatchType: "click", "show"
|
365
|
389
|
func SetPlanDispatchCount(orderId int64, dispatchType string, cnt int, curTime time.Time) {
|
|
390
|
+ if adslib.GetConf().TestMode {
|
|
391
|
+ return
|
|
392
|
+ }
|
366
|
393
|
conn := ads_redis.RedisConn.Get()
|
367
|
394
|
defer conn.Close()
|
368
|
395
|
|
|
@@ -373,6 +400,9 @@ func SetPlanDispatchCount(orderId int64, dispatchType string, cnt int, curTime t
|
373
|
400
|
// 设置订单计划投放数量
|
374
|
401
|
// dispatchType: "click", "show"
|
375
|
402
|
func SetOrderPlanDispatchCount(orderId int64, dispatchType string, cnt int, curTime time.Time) {
|
|
403
|
+ if adslib.GetConf().TestMode {
|
|
404
|
+ return
|
|
405
|
+ }
|
376
|
406
|
conn := ads_redis.RedisConn.Get()
|
377
|
407
|
defer conn.Close()
|
378
|
408
|
|