package com.fs.app.controller;

import com.fs.newAdv.dto.req.TraceIdDto;
import com.fs.newAdv.integration.client.advertiser.BaiduApiClient;
import com.fs.newAdv.enums.SystemEventTypeEnum;
import com.fs.newAdv.event.ConversionEventPublisher;
import com.fs.newAdv.service.IPromotionAccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 广告商监测链接
 *
 * @author zhangqin
 */
@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private ConversionEventPublisher conversionEventPublisher;
    @Autowired
    private BaiduApiClient baiduApiClient;
    @Autowired
    private IPromotionAccountService promotionAccountService;

    @PostMapping("/test1")
    public void test1(@RequestBody TraceIdDto traceId) {
        log.info("模拟 当日加群 事件完成");
        conversionEventPublisher.publishConversionEvent(traceId.getTraceId(), SystemEventTypeEnum.GROUP_TODAY);
    }

    @PostMapping("/test2")
    public void test2(@RequestBody TraceIdDto traceId) {
        log.info("模拟 当日加微 事件完成");
        conversionEventPublisher.publishConversionEvent(traceId.getTraceId(), SystemEventTypeEnum.WEI_CHAT_TODAY);
    }

    @PostMapping("/test3")
    public void test3(@RequestBody TraceIdDto traceId) {
        log.info("模拟 微信授权 事件完成");
        conversionEventPublisher.publishConversionEvent(traceId.getTraceId(), SystemEventTypeEnum.AUTH_TODAY_CREATE);
    }
}
