package com.duck8823.model.open.weather.map;

import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j;
import net.arnx.jsonic.JSON;
import org.json.JSONObject;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.Map;

/**
 * OpenWeatherMap
 * Created by duck8823 on 2017/05/07.
 */
@Log4j
@AllArgsConstructor
public class OpenWeatherMap {

	private static final String BASE_URL = "http://api.openweathermap.org/data/2.5/forecast";

	private String apiKey;

	public JSONObject search(double lat, double lon) throws IOException {
		HttpRequest request = new NetHttpTransport().createRequestFactory().buildGetRequest(new GenericUrl(BASE_URL + "?APPID=" + apiKey + "&lat=" + BigDecimal.valueOf(lat).toPlainString() + "&lon=" + BigDecimal.valueOf(lon).toPlainString()));
		return new JSONObject(request.execute().getContent());
	}
}

@@ -136,57 +136,8 @@
 st;%0A
-import com.google.api.client.http.HttpTransport;%0A
 impo
@@ -970,16 +970,50 @@
 NObject(
+(Map%3CString, Object%3E) JSON.decode(
 request.
@@ -1035,15 +1035,16 @@
 ntent())
+)
 ;%0A%09%7D%0A%7D%0A

Fix create jsonObject