app_key = $appKey; return $this; } /** * 组参 * @param array $param * @return $this */ public function param(array $param): self { $this->param = $param; return $this; } /** * 空气质量实时数据 * https://wx.jdcloud.com/market/datas/26/1656 * @return array|bool|mixed|string */ public function pm25Cities() { $this->url = "https://way.jd.com/pm25/cities"; return $this->http(); } /** * 中国和世界天气预报 * https://wx.jdcloud.com/market/datas/26/10610 */ public function heFreeWeather() { $this->url = "https://way.jd.com/he/freeweather"; return $this->http(); } /** * 全国天气预报 * https://wx.jdcloud.com/market/datas/26/11065 */ public function jiSuApiWeather() { $this->url = "https://way.jd.com/jisuapi/weather"; return $this->http(); } /** * 菜谱大全 * https://wx.jdcloud.com/market/datas/26/11072 */ public function jiSuApiSearch() { $this->url = "https://way.jd.com/jisuapi/search"; return $this->http(); } /** * IP商圈字典 * https://wx.jdcloud.com/market/datas/26/13432 */ public function rtBaSiaIpAreaDict() { $this->url = "https://way.jd.com/RTBAsia/ip_area_dict"; return $this->http(); } /** * 请求 * @return array|bool|mixed|string */ private function http() { $this->param['appkey'] = $this->app_key; $this->param = http_build_query($this->param); return HttpService::instance() ->url("{$this->url}?{$this->param}") ->toArray(); } }