load->library('RadioService', array(), 'radioService'); $this->tokenChecked = $this->radioService->checkToken(); } public function index_get() { echo 'Invalid Access'; } public function schedule_get() { if (is_null($this->tokenChecked)) { $this->res(200, 'Success', $this->radioService->getSchedule($this->get('categoryId'), $this->get('day'))); } else if ($this->tokenChecked == 402) { $this->res(402, 'Token expired'); } else if ($this->tokenChecked == 401){ $this->res(401, 'error'); } } public function category_get() { if (is_null($this->tokenChecked)) { $this->res(200, 'Success', $this->radioService->getCategory($this->radioService->getAppId($this->get('appId')))); } else if ($this->tokenChecked == 402) { $this->res(402, 'Token expired'); } else if ($this->tokenChecked == 401){ $this->res(401, 'error'); } } public function app_get() { if (is_null($this->tokenChecked)) { $this->res(200, 'Success', $this->radioService->getApp($this->radioService->getAppId($this->get('appId')))); } else if ($this->tokenChecked == 402) { $this->res(402, 'Token expired'); } else if ($this->tokenChecked == 401){ $this->res(401, 'error'); } } }