Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
 public void Satup()
 {
     _apiService = new OpenWeatherAPIService();
 }