admin
2020-04-28 061e912ff3cec51f8f8dcb4e6336bcd2fc03c164
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.yeshi.fanli.controller;
 
import java.io.PrintWriter;
 
import javax.annotation.Resource;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
 
import com.yeshi.fanli.entity.ad.DouYinClickEvent;
import com.yeshi.fanli.entity.push.DeviceActive;
import com.yeshi.fanli.service.inter.ad.DouYinClickEventService;
import com.yeshi.fanli.service.inter.push.DeviceActiveService;
import com.yeshi.fanli.util.ad.DouYinAdUtil;
 
@Controller
@RequestMapping("ad/callback/douyin")
public class DouYinCallBackController {
    @Resource
    private DouYinClickEventService douYinClickEventService;
 
    @Resource
    private DeviceActiveService deviceActiveService;
 
    /**
     * 抖音下载回调
     * 
     * @param out
     */
    @RequestMapping("monitor")
    public void download(DouYinClickEvent event, PrintWriter out) {
        douYinClickEventService.save(event);
        if (event.getOs() == 0) {
            DeviceActive active = deviceActiveService.getFirstActiveInfo(event.getAndroidId());
            if (active != null) {
                DouYinAdUtil.activeAndroid(event.getCallback(), event.getImei(), active.getCreateTime().getTime());
            }
        }
        out.print("success");
    }
 
}