HaikangApplicationTests.java 2.76 KB
package com.sincere.haikang;

import com.alibaba.fastjson.JSONObject;
import com.sincere.haikang.bean.StudentBean;
import com.sincere.haikang.dao.UserDao;
import com.sincere.haikang.server.AttendanceService;
import com.sincere.haikang.test.TK_Question;
import com.sincere.haikang.utils.ApiHelper;
import com.sincere.haikang.utils.FileUtils;
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 org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;

import java.io.*;
import java.util.*;

@RunWith(SpringRunner.class)
@SpringBootTest
public class HaikangApplicationTests {

//    @Autowired
//    AttendanceService attendanceService;

    @Autowired
    UserDao userDao;

//    private String url = "http://172.16.3.174:8001/";

    private String url = "http://114.55.30.100:9020/";

    @Test
    public void my() throws IOException {
//
//        File file = new File("C:\\TaoHandong\\copy\\21_qiandaoErr.txt");
//        BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
//
//        String content = "";
//        String result = "";
//        while ((content=bufferedReader.readLine())!=null){
//
//            if (content.split("cardNo:").length>1&&!result.contains(content.split("cardNo:")[1])){
//                result+="\'"+content.split("cardNo:")[1]+"\',";
//            }
//
//        }
//        System.out.println("result:"+result+result.split(",").length);

    }

    @Test
    public void contextLoads() {
        /*try {
            BufferedReader bufferedReader = new BufferedReader(new FileReader("C:\\TaoHandong\\copy\\1\\21_寝室签到接口记录.txt"));
            String content = null;
//            StringBuilder stringBuilder = new StringBuilder();
            Set<String> strings = new HashSet<>();
            String mapString = "";
            while ((content = bufferedReader.readLine()) != null) {
                strings.add(content);
                if (!StringUtils.isEmpty(content)){
//                    System.out.println("content:" + content.split("传入参数:")[1]);
                    mapString = content.split("传入参数:")[1];
                    String urlHXY ="http://campus.myjxt.com/api/XiaoAnCommon/SendHXY";
                    String result2 = ApiHelper.doPost(urlHXY, new HashMap<String, String>(), mapString);
//                    JSONObject jsonObject = JSONObject.parseObject(result2);
                    System.out.println("urlHXY:" + result2);
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }*/

    }

    @Test
    public void test(){



    }


}