package com.malk.yiyao;

import cn.hutool.core.io.IORuntimeException;
import com.alibaba.fastjson.JSONObject;
import com.malk.server.aliwork.YDConf;
import com.malk.server.aliwork.YDParam;
import com.malk.server.dingtalk.DDR_New;
import com.malk.utils.UtilHttp;
import com.malk.utils.UtilMap;
import com.malk.yiyao.service.YiyaoService;
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.SpringRunner;

import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@SpringBootTest
@RunWith(SpringRunner.class)
public class YiyaoTest {
    @Autowired
    private YiyaoService yiyaoService;


    @Test
    public void test() {
        yiyaoService.updateYiyao1();
    }

    @Test
    public void test2() {
        yiyaoService.updateYiyao2();
    }

    @Test
    public void test3() {
        yiyaoService.updateYiyao3();
    }

    @Test
    public void test4() {
        yiyaoService.updateYiyao4();
    }

    @Test
    public void test5() {
        yiyaoService.updateYiyao5();
    }

    @Test
    public void test6() {
        yiyaoService.updateYiyao6();
    }

    @Test
    public void test7() {
        yiyaoService.updateYiyao7();
    }

    @Test
    public void test8() {
        yiyaoService.updateYiyao8();
    }

    @Test
    public void test9() {
        yiyaoService.updateYiyao9();
    }

    @Test
    public void test10() {
        yiyaoService.updateYiyao10();
    }

    @Test
    public void test11() {
        JSONObject json = new JSONObject();
        json.put("timeStamp", 1754541812234L);
        json.put("eventId","50d550f6fb9444c0b99dae58d503a280");
        json.put("CorpId","dingf11f7d6ff834577b");
        json.put("StaffId","134213470523662878");
        json.put("EventType","check_in");
        json.put("EventTime",1754541812234L);
        json.put("BizId","4566b06c-9167-4dd9-b47f-0531a2e10ce0");
        json.put("staffId","134213470523662878");
        json.put("TimeStamp", 1754541812234L);

        yiyaoService.getCheckInData(json);
    }

    @Test
    public void test12() {
        try {
           throw new IORuntimeException("测试异常");
        } catch (IORuntimeException e) {
            log.info("异常信息：{}", e.getMessage());
        }catch (Exception e) {
            log.error("请求失败：", e);
        }
    }

}