Browse Source

获取天气业务,增加日志

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
eb3ae37a6c
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java

+ 5
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java View File



@Override @Override
public AirWeatherVO getWeather(Integer airportId) throws ServiceException { public AirWeatherVO getWeather(Integer airportId) throws ServiceException {
log.info("获取天气信息信息");
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId());
//这边需要配置到yml文件里面 //这边需要配置到yml文件里面
String url = tenant.getAirportUrl() + "/api/airportInterface/getWeather"; String url = tenant.getAirportUrl() + "/api/airportInterface/getWeather";
String param = "airportId=" + airportId; String param = "airportId=" + airportId;
log.info("获取天气信息信息,调用机场接口");
log.info("获取天气信息信息,url={}", url);
log.info("获取天气信息信息,param={}", param);
String weatherStr = HttpUtils.sendGet(url, param); String weatherStr = HttpUtils.sendGet(url, param);
log.info("获取天气信息信息,调用机场接口结束,weatherStr={}", weatherStr);
JsonResult jsonResult; JsonResult jsonResult;
try { try {
jsonResult = JacksonUtil.json2pojo(weatherStr, JsonResult.class); jsonResult = JacksonUtil.json2pojo(weatherStr, JsonResult.class);

Loading…
Cancel
Save