package com.tzld.piaoquan.api;

import com.tzld.piaoquan.api.dao.mapper.contentplatform.ExternalChannelMapper;
import com.tzld.piaoquan.api.job.ExternalChannelProcessJob;
import com.tzld.piaoquan.api.model.po.contentplatform.ExternalChannel;
import com.tzld.piaoquan.api.model.po.contentplatform.ExternalChannelExample;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest(classes = GrowthServerApplication.class)
@Slf4j
public class ExternalChannelTest {
    @Autowired
    ExternalChannelProcessJob job;
    @Autowired
    ExternalChannelMapper externalChannelMapper;


    @Test
    public void testSyncContentPlatformQwDatastatReplyTotalJob() {
        ExternalChannelExample example = new ExternalChannelExample();
        example.createCriteria().andRootSourceIdEqualTo("fwhtouliu_tencentgzh_20260320_49679899_1847006a");
        List<ExternalChannel> externalChannels = externalChannelMapper.selectByExample(example);

        job.processSingleRecord(externalChannels.get(0));
    }
}
