admin
2025-02-11 8cc47cfe4c6d6b48e62cf00f6cbd0951ec57c264
src/test/java/com/everyday/word/WordsTest.java
@@ -73,7 +73,7 @@
    @Test
    public void pullDataFromYouDaoWeb() throws InterruptedException {
        EnglishWordsMapper.DaoQuery daoQuery=new EnglishWordsMapper.DaoQuery();
        int page=5;
        for (int page = 200; page < 300; page++) {
        int pageSize = 100;
        List<EnglishWords> list = englishWordsService.list(daoQuery,page, pageSize);
        Set<String> oSpellings=new HashSet<>();
@@ -84,13 +84,13 @@
        spellings.addAll(oSpellings);
        Set<String>  infoSellings =   YouDaoWebUtil.getBaseInfoSpellings();
        spellings.removeAll(infoSellings);
        for(String s:spellings){
            try {
                String result = YouDaoWebApi.getInfoBySpelling(s);
                if (!StringUtil.isNullOrEmpty(result) && result.length() > 100) {
                        System.out.println("info:"+s);
                    YouDaoWebUtil.saveBaseInfo(s,result);
                }
            }catch(Exception e){
@@ -109,6 +109,7 @@
            try {
                String result = YouDaoWebApi.getLJBySpelling(s);
                if (!StringUtil.isNullOrEmpty(result) && result.length() > 100) {
                        System.out.println("lj:"+s);
                    YouDaoWebUtil.saveLJ(s,result);
                }
            }catch(Exception e){
@@ -119,8 +120,7 @@
            Thread.sleep(1000 + (int) (Math.random()*1000));
        }
        }
    }