package com.liquidnet.service.kylin;

import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinIpAreaVo;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import com.liquidnet.service.kylin.utils.DataUtils;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

/**
 * @author AnJiabin <anjiabin@zhengzai.tv>
 * @version V1.0
 * @Description: TODO
 * @class: TestDataUtil
 * @Package com.liquidnet.service.kylin
 * @Copyright: LightNet @ Copyright (c) 2021
 * @date 2021/9/12 14:37
 */
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class TestDataUtil {
    @Autowired
    private DataUtils dataUtils;

    @Test
    public void myPerformancesList(){

        List<KylinPerformanceVo> kylinPerformanceVoList = dataUtils.myPerformancesList("270788673588551684937456");
        for(KylinPerformanceVo vo:kylinPerformanceVoList){
            log.info("performanceid:{} ",vo.getPerformancesId());
            log.info("title:{}",vo.getTitle());
        }
    }

    @Test
    public void getIpAreaByIp(){
//        KylinIpAreaVo kylinIpAreaVo = dataUtils.getKylinIpAreaVo("1.58.222.0");
        KylinIpAreaVo kylinIpAreaVo = dataUtils.getKylinIpAreaVo("1.58.227.0");
        System.out.println(JsonUtils.toJson(kylinIpAreaVo));
    }
}
