/// <summary> /// 取得資料 /// </summary> /// <returns></returns> public IHttpActionResult Get(string methods = null, string location = "臺北市", string qs = null) { var service = new OpenWeatherAPIService(); methods = methods == null ? "F-C0032-001" : methods; var parameters = string.Format("format=json&locationName={0}", location); var responseData = qs == null?service.GetDatas(methods, parameters) : service.GetDatas(methods, qs); return(Ok(responseData)); }
public void Satup() { _apiService = new OpenWeatherAPIService(); }