sunshine
2024-11-05 1bd51ea22b75760704843d9bed886a7262bb1cb1
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.nova.sankuai.controller.v2;
 
import com.nova.sankuai.domain.dto.H5LoanMarketViewLogDto;
import com.nova.sankuai.infra.utils.ResultJson;
import com.nova.sankuai.security.UserDetail;
import com.nova.sankuai.service.IChannelDownloadLogService;
import com.nova.sankuai.service.IChannelViewLogService;
import com.nova.sankuai.service.IH5LoanMarketViewLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
 
/**
 * @author weikangdi
 * @create 2021/12/30
 */
@Api(tags = "渠道UV统计V2")
@RestController
@RequestMapping(value = "/api/v2/channelVisit")
@AllArgsConstructor
public class ChannelViewLogV2Controller {
 
    private final IChannelViewLogService channelViewLogService;
 
    private final IChannelDownloadLogService channelDownloadLogService;
 
    private final IH5LoanMarketViewLogService h5LoanMarketViewLogService;
 
    @GetMapping(value = "/addVisitLog")
    @ApiOperation(value = "增加渠道UV统计记录")
    public ResultJson<Void> addVisitLog(String appId, Integer type) {
        channelViewLogService.addVisitLog(appId, type);
        return ResultJson.success();
    }
 
    @GetMapping(value = "/addDownloadLog")
    @ApiOperation(value = "新增渠道下载统计记录")
    public ResultJson<Void> addDownloadLog(@AuthenticationPrincipal UserDetail userDetail, String downloadUrl) {
        channelDownloadLogService.addDownloadLog(downloadUrl,  userDetail);
        return ResultJson.success();
    }
 
    @PostMapping(value = "/addH5LoanMarketViewLog")
    @ApiOperation(value = "增加H5渠道贷超UV统计记录")
    public ResultJson<Void> addH5LoanMarketViewLog(@RequestBody H5LoanMarketViewLogDto viewLogDto) {
        h5LoanMarketViewLogService.addH5LoanMarketViewLog(viewLogDto);
        return ResultJson.success();
    }
 
    @GetMapping(value = "/addAutoDownloadLog")
    @ApiOperation(value = "新增联登下载统计记录")
    public ResultJson<Void> addAutoDownloadLog(@RequestParam("userId") Long userId, @RequestParam("downloadUrl") String downloadUrl) {
        channelDownloadLogService.addAutoDownloadLog(userId, downloadUrl);
        return ResultJson.success();
    }
}