Compare commits
2 Commits
0fa6d45ddf
...
f27daac6fa
Author | SHA1 | Date |
---|---|---|
guyuliang | f27daac6fa | |
guyuliang | d740896398 |
|
@ -145,8 +145,12 @@ public class IndexServiceImpl implements IndexService {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String result = warnUtil.call(WarnInfo.get7DayWarnTrend.getUrl(), "GET");
|
String result = warnUtil.call(WarnInfo.get7DayWarnTrend.getUrl(), "GET");
|
||||||
log.info("result:"+result);
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
return new GeneralResult(true, "查询成功");
|
if (!"200".equals(jsonObject.getString("code"))) {
|
||||||
|
log.info("result:" + result);
|
||||||
|
return new GeneralResult(false, "查询失败");
|
||||||
|
}
|
||||||
|
return new GeneralResult(true, jsonObject, "查询成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("查询失败", e);
|
log.info("查询失败", e);
|
||||||
return new GeneralResult(false, "查询失败");
|
return new GeneralResult(false, "查询失败");
|
||||||
|
@ -158,8 +162,12 @@ public class IndexServiceImpl implements IndexService {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String result = warnUtil.call(WarnInfo.get1DayWarnCount.getUrl(), "GET");
|
String result = warnUtil.call(WarnInfo.get1DayWarnCount.getUrl(), "GET");
|
||||||
log.info("result:"+result);
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
return new GeneralResult(true, "查询成功");
|
if (!"200".equals(jsonObject.getString("code"))) {
|
||||||
|
log.info("result:" + result);
|
||||||
|
return new GeneralResult(false, "查询失败");
|
||||||
|
}
|
||||||
|
return new GeneralResult(true, jsonObject, "查询成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("查询失败", e);
|
log.info("查询失败", e);
|
||||||
return new GeneralResult(false, "查询失败");
|
return new GeneralResult(false, "查询失败");
|
||||||
|
@ -170,8 +178,12 @@ public class IndexServiceImpl implements IndexService {
|
||||||
public GeneralResult warnList(RequestContext requestContext) {
|
public GeneralResult warnList(RequestContext requestContext) {
|
||||||
try {
|
try {
|
||||||
String result = warnUtil.call(WarnInfo.getWarnList.getUrl(), "GET");
|
String result = warnUtil.call(WarnInfo.getWarnList.getUrl(), "GET");
|
||||||
log.info("result:"+result);
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
return new GeneralResult(true, "查询成功");
|
if (!"200".equals(jsonObject.getString("code"))) {
|
||||||
|
log.info("result:" + result);
|
||||||
|
return new GeneralResult(false, "查询失败");
|
||||||
|
}
|
||||||
|
return new GeneralResult(true, jsonObject, "查询成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("查询失败", e);
|
log.info("查询失败", e);
|
||||||
return new GeneralResult(false, "查询失败");
|
return new GeneralResult(false, "查询失败");
|
||||||
|
|
Loading…
Reference in New Issue