|
|
|
@ -15,11 +15,13 @@ import com.xjs.common.client.api.lq.LqAWordFeignClient;
|
|
|
|
|
import com.xjs.common.client.api.lq.LqDogDiaryFeignClient;
|
|
|
|
|
import com.xjs.common.client.api.lq.LqPoisonChickenFeignClient;
|
|
|
|
|
import com.xjs.common.client.api.roll.*;
|
|
|
|
|
import com.xjs.properties.AlApiProperties;
|
|
|
|
|
import com.xjs.properties.BaiduProperties;
|
|
|
|
|
import com.xjs.properties.GaodeProperties;
|
|
|
|
|
import com.xjs.properties.RollProperties;
|
|
|
|
|
import com.xjs.common.client.api.tianxing.*;
|
|
|
|
|
import com.xjs.common.client.api.youdao.YouDaoFeignClient;
|
|
|
|
|
import com.xjs.consts.ApiConst;
|
|
|
|
|
import com.xjs.properties.*;
|
|
|
|
|
import com.xjs.translation.domain.qo.translation.BaiDuTranslationQo;
|
|
|
|
|
import com.xjs.translation.domain.qo.translation.RollTranslationQo;
|
|
|
|
|
import com.xjs.translation.domain.qo.translation.YouDaoTranslationQo;
|
|
|
|
|
import com.xjs.weather.domain.IPInfoVo;
|
|
|
|
|
import com.xjs.weather.domain.RequestBody;
|
|
|
|
|
import com.xjs.weather.service.IPService;
|
|
|
|
@ -29,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import static com.xjs.consts.ApiConst.DEMOTE_ERROR;
|
|
|
|
@ -47,12 +50,22 @@ public class CheckApiStatusTask {
|
|
|
|
|
/**
|
|
|
|
|
* 需要输入的文本内容
|
|
|
|
|
*/
|
|
|
|
|
public static final String content = "test";
|
|
|
|
|
private static final String content = "测试";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 城市编码
|
|
|
|
|
*/
|
|
|
|
|
public static final String cityId = "360100";
|
|
|
|
|
private static final String cityId = "360100";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 城市名称
|
|
|
|
|
*/
|
|
|
|
|
public static final String city = "南昌";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 手机号码
|
|
|
|
|
*/
|
|
|
|
|
public static final String mobile = "18907084291";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@ -70,6 +83,8 @@ public class CheckApiStatusTask {
|
|
|
|
|
private GaodeProperties gaodeProperties;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollProperties rollProperties;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingProperties tianXingProperties;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private AlapiJokeAllFeignClient alapiJokeAllFeignClient;
|
|
|
|
@ -93,7 +108,48 @@ public class CheckApiStatusTask {
|
|
|
|
|
private RollHistoryTodayFeignClient rollHistoryTodayFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollHolidayFeignClient rollHolidayFeignClient;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollIdcardQueryFeignClient rollIdcardQueryFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollIPFeignClient rollIPFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollJokeFeignClient rollJokeFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollMMYJFeignClient rollMMYJFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollMobileBelongFeignClient rollMobileBelongFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollSimpleComplexFeignClient rollSimpleComplexFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollTranslationFeignClient rollTranslationFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private RollWeatherFeignClient rollWeatherFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingBDRSFeignClient tianXingBDRSFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingDYRSFeignClient tianXingDYRSFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingJDTCFeignClient tianXingJDTCFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingMMMYFeignClient tianXingMMMYFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingMMYJFeignClient tianXingMMYJFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingOneEnglishFeignClient tianXingOneEnglishFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingPYQFeignClient tianXingPYQFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingQWRSFeignClient tianXingQWRSFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingTranDictClient tianXingTranDictClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingWBRSFeignClient tianXingWBRSFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingWXRSFeignClient tianXingWXRSFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TianXingWYYFeignClient tianXingWYYFeignClient;
|
|
|
|
|
@Autowired
|
|
|
|
|
private YouDaoFeignClient youDaoFeignClient;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查api状态 <br>
|
|
|
|
@ -168,8 +224,131 @@ public class CheckApiStatusTask {
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollHoliday).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckRollJoke = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkRollJoke();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollJoke).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckRollIp = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkRollIp();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollIp).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckRollIdCardQuery = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkRollIdCardQuery();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollIdCardQuery).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckRollMMYJ = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkRollMMYJ();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollMMYJ).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckRollMobileBelong = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkRollMobileBelong();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollMobileBelong).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckRollSimpleComplex = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkRollSimpleComplex();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollSimpleComplex).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckRollTranslation = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkRollTranslation();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollTranslation).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckRollWeather = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkRollWeather();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckRollWeather).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingBDRS = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingBDRS();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingBDRS).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingDYRS = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingDYRS();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingDYRS).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingJDTC = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingJDTC();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingJDTC).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingMMMY = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingMMMY();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingMMMY).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingMMYJ = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingMMYJ();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingMMYJ).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingOneEnglish = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingOneEnglish();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingOneEnglish).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingPYQ = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingPYQ();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingPYQ).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingQWRS = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingQWRS();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingQWRS).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingTranDict = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingTranDict();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingTranDict).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingWBRS = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingWBRS();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingWBRS).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingWXRS = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingWXRS();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingWXRS).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckTianXingWYY = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkTianXingWYY();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckTianXingWYY).start();
|
|
|
|
|
|
|
|
|
|
Runnable runCheckYouDaoTranslation = () -> {
|
|
|
|
|
log.info("线程启动:" + Thread.currentThread().getName());
|
|
|
|
|
this.checkYouDaoTranslation();
|
|
|
|
|
};
|
|
|
|
|
new Thread(runCheckYouDaoTranslation).start();
|
|
|
|
|
|
|
|
|
|
//this.checkAlapiJoke();
|
|
|
|
|
//this.checkBaiduTranslation();
|
|
|
|
@ -179,9 +358,30 @@ public class CheckApiStatusTask {
|
|
|
|
|
//this.checkLqPoisonChicken();
|
|
|
|
|
//this.checkRollBeautyPicture();
|
|
|
|
|
//this.checkRollChineseDict();
|
|
|
|
|
this.checkRollGarbageSorting();
|
|
|
|
|
this.checkRollHistoryToday();
|
|
|
|
|
this.checkRollHoliday();
|
|
|
|
|
//this.checkRollGarbageSorting();
|
|
|
|
|
//this.checkRollHistoryToday();
|
|
|
|
|
//this.checkRollHoliday();
|
|
|
|
|
//this.checkRollJoke();
|
|
|
|
|
//this.checkRollIp();
|
|
|
|
|
//this.checkRollIdCardQuery();
|
|
|
|
|
//this.checkRollMMYJ();
|
|
|
|
|
//this.checkRollMobileBelong();
|
|
|
|
|
//this.checkRollSimpleComplex();
|
|
|
|
|
//this.checkRollTranslation();
|
|
|
|
|
//this.checkRollWeather();
|
|
|
|
|
//this.checkTianXingBDRS();
|
|
|
|
|
//this.checkTianXingDYRS();
|
|
|
|
|
//this.checkTianXingJDTC();
|
|
|
|
|
//this.checkTianXingMMMY();
|
|
|
|
|
//this.checkTianXingMMYJ();
|
|
|
|
|
//this.checkTianXingOneEnglish();
|
|
|
|
|
//this.checkTianXingPYQ();
|
|
|
|
|
//this.checkTianXingQWRS();
|
|
|
|
|
//this.checkTianXingTranDict();
|
|
|
|
|
//this.checkTianXingWBRS();
|
|
|
|
|
//this.checkTianXingWXRS();
|
|
|
|
|
//this.checkTianXingWYY();
|
|
|
|
|
//this.checkYouDaoTranslation();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -189,10 +389,361 @@ public class CheckApiStatusTask {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// todo 还剩20多个api检查没写
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查有道平台 翻译API
|
|
|
|
|
*/
|
|
|
|
|
private void checkYouDaoTranslation() {
|
|
|
|
|
YouDaoTranslationQo youDaoTranslationQo = new YouDaoTranslationQo();
|
|
|
|
|
youDaoTranslationQo.setI(content);
|
|
|
|
|
JSONObject jsonObject = youDaoFeignClient.translationApi(youDaoTranslationQo);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(YouDaoFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现有道平台 翻译API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 网易云热评API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingWYY() {
|
|
|
|
|
com.xjs.copywriting.domain.RequestBody requestBody = new com.xjs.copywriting.domain.RequestBody();
|
|
|
|
|
requestBody.setKey(tianXingProperties.getKey());
|
|
|
|
|
JSONObject jsonObject = tianXingWYYFeignClient.copyWritingApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingWYYFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 网易云热评API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 微信热搜榜API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingWXRS() {
|
|
|
|
|
JSONObject jsonObject = tianXingWXRSFeignClient.topSearchApi(tianXingProperties.getKey());
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingWXRSFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 微信热搜榜API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 微博热搜榜API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingWBRS() {
|
|
|
|
|
JSONObject jsonObject = tianXingWBRSFeignClient.topSearchApi(tianXingProperties.getKey());
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingWBRSFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 微博热搜榜API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 翻译字典API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingTranDict() {
|
|
|
|
|
com.xjs.copywriting.domain.RequestBody requestBody = new com.xjs.copywriting.domain.RequestBody();
|
|
|
|
|
requestBody.setWord(content);
|
|
|
|
|
requestBody.setKey(tianXingProperties.getKey());
|
|
|
|
|
JSONObject jsonObject = tianXingTranDictClient.tranDictApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingTranDictClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 翻译字典API异常");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 全网热搜榜API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingQWRS() {
|
|
|
|
|
JSONObject jsonObject = tianXingQWRSFeignClient.topSearchApi(tianXingProperties.getKey());
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingQWRSFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 全网热搜榜API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 朋友圈文案API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingPYQ() {
|
|
|
|
|
com.xjs.copywriting.domain.RequestBody requestBody = new com.xjs.copywriting.domain.RequestBody();
|
|
|
|
|
requestBody.setKey(tianXingProperties.getKey());
|
|
|
|
|
JSONObject jsonObject = tianXingPYQFeignClient.copyWritingApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingPYQFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 朋友圈文案API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 英语一言API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingOneEnglish() {
|
|
|
|
|
com.xjs.oneenglish.domain.RequestBody requestBody = new com.xjs.oneenglish.domain.RequestBody();
|
|
|
|
|
requestBody.setKey(tianXingProperties.getKey());
|
|
|
|
|
JSONObject jsonObject = tianXingOneEnglishFeignClient.oneEnglishApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingOneEnglishFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 英语一言API异常");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 每日一句API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingMMYJ() {
|
|
|
|
|
com.xjs.aword.domain.RequestBody requestBody = new com.xjs.aword.domain.RequestBody();
|
|
|
|
|
requestBody.setKey(tianXingProperties.getKey());
|
|
|
|
|
JSONObject jsonObject = tianXingMMYJFeignClient.aWordApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingMMYJFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 每日一句API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 名人名言API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingMMMY() {
|
|
|
|
|
com.xjs.copywriting.domain.RequestBody requestBody = new com.xjs.copywriting.domain.RequestBody();
|
|
|
|
|
requestBody.setKey(tianXingProperties.getKey());
|
|
|
|
|
JSONObject jsonObject = tianXingMMMYFeignClient.copyWritingApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingMMMYFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 名人名言API异常");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 经典台词API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingJDTC() {
|
|
|
|
|
com.xjs.copywriting.domain.RequestBody requestBody = new com.xjs.copywriting.domain.RequestBody();
|
|
|
|
|
requestBody.setKey(tianXingProperties.getKey());
|
|
|
|
|
JSONObject jsonObject = tianXingJDTCFeignClient.copyWritingApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingJDTCFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 经典台词API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 抖音热搜榜API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingDYRS() {
|
|
|
|
|
JSONObject jsonObject = tianXingDYRSFeignClient.topSearchApi(tianXingProperties.getKey());
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingDYRSFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 抖音热搜榜API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查天行平台 百度热搜榜API
|
|
|
|
|
*/
|
|
|
|
|
private void checkTianXingBDRS() {
|
|
|
|
|
JSONObject jsonObject = tianXingBDRSFeignClient.topSearchApi(tianXingProperties.getKey());
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(TianXingBDRSFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现天行平台 百度热搜榜API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查ROLL平台 天气API
|
|
|
|
|
*/
|
|
|
|
|
private void checkRollWeather() {
|
|
|
|
|
com.xjs.apitools.domain.RequestBody requestBody = getRequestBody();
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject1 = rollWeatherFeignClient.nowWeatherApi(requestBody, city);
|
|
|
|
|
JSONObject jsonObject2 = rollWeatherFeignClient.forecastWeatherApi(requestBody, city);
|
|
|
|
|
|
|
|
|
|
if (jsonObject1.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollWeatherFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 实时天气API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (jsonObject2.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollWeatherFeignClient.class).get(1);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 预报天气API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查ROLL平台 翻译API
|
|
|
|
|
*/
|
|
|
|
|
private void checkRollTranslation() {
|
|
|
|
|
RollTranslationQo rollTranslationQo = new RollTranslationQo();
|
|
|
|
|
rollTranslationQo.setApp_id(rollProperties.getApp_id());
|
|
|
|
|
rollTranslationQo.setApp_secret(rollProperties.getApp_secret());
|
|
|
|
|
rollTranslationQo.setContent(content);
|
|
|
|
|
JSONObject jsonObject = rollTranslationFeignClient.translationApi(rollTranslationQo);
|
|
|
|
|
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollTranslationFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 翻译API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查ROLL平台 简繁转换API
|
|
|
|
|
*/
|
|
|
|
|
private void checkRollSimpleComplex() {
|
|
|
|
|
com.xjs.apitools.domain.RequestBody requestBody = getRequestBody();
|
|
|
|
|
requestBody.setType(1);
|
|
|
|
|
requestBody.setContent(content);
|
|
|
|
|
JSONObject jsonObject = rollSimpleComplexFeignClient.simpleComplexApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollSimpleComplexFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 简繁转换API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查ROLL平台 手机归属地API
|
|
|
|
|
*/
|
|
|
|
|
private void checkRollMobileBelong() {
|
|
|
|
|
com.xjs.apitools.domain.RequestBody requestBody = getRequestBody();
|
|
|
|
|
requestBody.setMobile(mobile);
|
|
|
|
|
JSONObject jsonObject = rollMobileBelongFeignClient.mobileBelongApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollMobileBelongFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 手机归属地API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查ROLL平台 每日一句API
|
|
|
|
|
*/
|
|
|
|
|
private void checkRollMMYJ() {
|
|
|
|
|
com.xjs.copywriting.domain.RequestBody requestBody = new com.xjs.copywriting.domain.RequestBody();
|
|
|
|
|
requestBody.setCount(20);
|
|
|
|
|
requestBody.setApp_id(rollProperties.getApp_id());
|
|
|
|
|
requestBody.setApp_secret(rollProperties.getApp_secret());
|
|
|
|
|
JSONObject jsonObject = rollMMYJFeignClient.copyWritingApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollMMYJFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 每日一句API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查ROLL平台 搞笑段子API
|
|
|
|
|
*/
|
|
|
|
|
private void checkRollJoke() {
|
|
|
|
|
com.xjs.copywriting.domain.RequestBody requestBody = new com.xjs.copywriting.domain.RequestBody();
|
|
|
|
|
requestBody.setApp_id(rollProperties.getApp_id());
|
|
|
|
|
requestBody.setApp_secret(rollProperties.getApp_secret());
|
|
|
|
|
JSONObject jsonObject = rollJokeFeignClient.jokeApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollJokeFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 搞笑段子API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查ROLL平台 IP信息API
|
|
|
|
|
*/
|
|
|
|
|
private void checkRollIp() {
|
|
|
|
|
com.xjs.copywriting.domain.RequestBody requestBody = new com.xjs.copywriting.domain.RequestBody();
|
|
|
|
|
requestBody.setIp(ApiConst.LOCAL_IP);
|
|
|
|
|
requestBody.setApp_id(rollProperties.getApp_id());
|
|
|
|
|
requestBody.setApp_secret(rollProperties.getApp_secret());
|
|
|
|
|
JSONObject jsonObject = rollIPFeignClient.ipApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollIPFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 IP信息API异常");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查ROLL平台 身份证查询API
|
|
|
|
|
*/
|
|
|
|
|
private void checkRollIdCardQuery() {
|
|
|
|
|
com.xjs.apitools.domain.RequestBody requestBody = getRequestBody();
|
|
|
|
|
JSONObject jsonObject = rollIdcardQueryFeignClient.idcardQueryApi(requestBody);
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollIdcardQueryFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 身份证查询API异常");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查alapi平台笑话大全API
|
|
|
|
|
*/
|
|
|
|
@ -203,7 +754,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(AlapiJokeAllFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(AlapiJokeAllFeignClient.class).get(0);
|
|
|
|
|
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
|
|
|
|
@ -231,7 +782,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(BaiduFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(BaiduFeignClient.class).get(0);
|
|
|
|
|
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
|
|
|
|
@ -262,7 +813,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(GaodeWeatherFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(GaodeWeatherFeignClient.class).get(0);
|
|
|
|
|
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
|
|
|
|
@ -279,7 +830,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(LqAWordFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(LqAWordFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现零七平台 一言API异常");
|
|
|
|
|
}
|
|
|
|
@ -294,7 +845,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(LqDogDiaryFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(LqDogDiaryFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现零七平台 舔狗日记API异常");
|
|
|
|
|
}
|
|
|
|
@ -308,7 +859,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(LqPoisonChickenFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(LqPoisonChickenFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现零七平台 毒鸡汤API异常");
|
|
|
|
|
}
|
|
|
|
@ -324,7 +875,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollBeautyPictureFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollBeautyPictureFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 美女图片API异常");
|
|
|
|
|
|
|
|
|
@ -340,7 +891,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollChineseDictFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollChineseDictFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 汉语字典API异常");
|
|
|
|
|
|
|
|
|
@ -356,7 +907,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollGarbageSortingDeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollGarbageSortingDeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 垃圾分类API异常");
|
|
|
|
|
}
|
|
|
|
@ -372,7 +923,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollHistoryTodayFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollHistoryTodayFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 历史今天API异常");
|
|
|
|
|
}
|
|
|
|
@ -386,8 +937,8 @@ public class CheckApiStatusTask {
|
|
|
|
|
if (!jsonObject.containsKey(DEMOTE_ERROR)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollHolidayFeignClient.class);
|
|
|
|
|
this.getAnnotationInfo(RollHolidayFeignClient.class);
|
|
|
|
|
String[] info = this.getAnnotationInfo(RollHolidayFeignClient.class).get(0);
|
|
|
|
|
this.selectAndUpdate(info);
|
|
|
|
|
log.error("检查发现ROLL平台 节假日API异常");
|
|
|
|
|
}
|
|
|
|
@ -412,22 +963,25 @@ public class CheckApiStatusTask {
|
|
|
|
|
* @param cls 反射类
|
|
|
|
|
* @return 注解信息 [0]=name [1]=url
|
|
|
|
|
*/
|
|
|
|
|
private String[] getAnnotationInfo(Class<?> cls) {
|
|
|
|
|
private List<String[]> getAnnotationInfo(Class<?> cls) {
|
|
|
|
|
|
|
|
|
|
Method[] publicMethods = ReflectUtil.getPublicMethods(cls);
|
|
|
|
|
|
|
|
|
|
List<String[]> strings = new ArrayList<>();
|
|
|
|
|
if (publicMethods.length > 0) {
|
|
|
|
|
|
|
|
|
|
for (Method method : publicMethods) {
|
|
|
|
|
ApiLog annotation = method.getAnnotation(ApiLog.class);
|
|
|
|
|
if (annotation != null) {
|
|
|
|
|
String name = annotation.name();
|
|
|
|
|
String url = annotation.url();
|
|
|
|
|
|
|
|
|
|
return new String[]{name, url};
|
|
|
|
|
strings.add(new String[]{name, url});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return strings;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
strings.add(new String[]{});
|
|
|
|
|
return strings;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -437,7 +991,7 @@ public class CheckApiStatusTask {
|
|
|
|
|
* @param info 注解信息 [0]=name [1]=url
|
|
|
|
|
*/
|
|
|
|
|
private void selectAndUpdate(String[] info) {
|
|
|
|
|
if (info != null) {
|
|
|
|
|
if (info != null && info.length != 0) {
|
|
|
|
|
ApiRecord apiRecord = new ApiRecord();
|
|
|
|
|
apiRecord.setApiName(info[0]);
|
|
|
|
|
apiRecord.setApiUrl(info[1]);
|
|
|
|
|