Przeglądaj źródła

调用机场平台获取机场列表接口调整参数

tags/v1.0.0^2
wanjing 1 rok temu
rodzic
commit
01d2a717f9
1 zmienionych plików z 8 dodań i 2 usunięć
  1. +8
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/AirportServiceImpl.java

+ 8
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/AirportServiceImpl.java Wyświetl plik

@@ -14,6 +14,8 @@ import com.tuoheng.common.core.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Objects;

@Service
@@ -34,9 +36,13 @@ public class AirportServiceImpl implements AirportService {
if (StringUtils.isEmpty(tenant.getAirportUrl())) {
return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg());
}

String url = tenant.getAirportUrl() + SystemConstant.API_AIRPORT_LIST;
String param = "page=1&limit=10";
String param;
try {
param = "page=1&limit=1000&tenantName=" + URLEncoder.encode(tenant.getName(), "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
String airPortStr = HttpUtils.sendGet(url, param);

JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);

Ładowanie…
Anuluj
Zapisz