package com.fs.app.controller;

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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

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

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

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