config->getAccessToken(); $result = $this->request->post($this->generate_url . $config, $url); if (!$result->isResultsOK()) { throw new \Exception($result->getMessage()); } return $result->getData(); } /** * @param $id * @param $tagName * @return mixed * @throws \Exception */ public function tag_edit($id, $tagName) { $url['tag[id]'] = $id; $url['tag[name]'] = $tagName; $config = $this->config->getAccessToken(); $result = $this->request->post($this->tag_edit . $config, $url); if (!$result->isResultsOK()) { throw new \Exception($result->getMessage()); } return $result->getData(); } /** * @param $id * @param $tagName * @return mixed * @throws \Exception */ public function tag_delete($id) { $url['tag[id]'] = $id; $config = $this->config->getAccessToken(); $result = $this->request->post($this->tag_delete . $config, $url); if (!$result->isResultsOK()) { throw new \Exception($result->getMessage()); } return $result->getData(); } /** * @param $id * @param string[] $openid_list * @return mixed * @throws \Exception */ public function user_batch_add_tag($id, array $openid_list) { $url['tagid'] = $id; $url['openid_list'] = $openid_list; $config = $this->config->getAccessToken(); $result = $this->request->post($this->user_batch_add_tag . $config, $url); if (!$result->isResultsOK()) { throw new \Exception($result->getMessage()); } return $result->getData(); } /** * @param $id * @param string[] $openid_list * @return mixed * @throws \Exception */ public function user_batch_remove_tag($id, array $openid_list) { $url['tagid'] = $id; $url['openid_list'] = $openid_list; $config = $this->config->getAccessToken(); $result = $this->request->post($this->user_batch_remove_tag . $config, $url); if (!$result->isResultsOK()) { throw new \Exception($result->getMessage()); } return $result->getData(); } /** * @return mixed * @throws \Exception */ public function tagList() { $config = $this->config->getAccessToken(); $result = $this->request->get($this->tag_lists . $config); if (!$result->isResultsOK()) { throw new \Exception($result->getMessage()); } return $result->getData(); } /** * @return mixed * @throws \Exception */ public function tag_fans_list() { $config = $this->config->getAccessToken(); $result = $this->request->get($this->tag_fans_list . $config); if (!$result->isResultsOK()) { throw new \Exception($result->getMessage()); } return $result->getData(); } /** * @param $openid * @return mixed * @throws \Exception */ public function user_tag($openid) { $config = $this->config->getAccessToken(); $result = $this->request->post($this->user_tag . $config, [ 'openid' => $openid ]); if (!$result->isResultsOK()) { throw new \Exception($result->getMessage()); } return $result->getData(); } }