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();
|
}
|
}
|