我正在尝试获取 URL“/videoGame”来运行“listAllVideoGames”方法和“/videoGame/#”(其中 # 是一个数字)来运行“getVideoGame”方法。使用“@priority”注释更改优先级我可以同时调用两个 URL,但找不到执行我描述的方法。
/**
* @uri /videoGame
* @uri /videoGame/:id
*/
class VideoGame extends Resource{
protected function getDao(){
return new VideoGameDao();
}
/**
* @uri /videoGame
* @json
* @provides application/json
* @method GET
*/
public function listAllVideoGames(){
return new Response(Response::OK,$this->dao->getAllVideoGames());
}
/**
* @uri /videoGame/:id
* @json
* @provides application/json
* @method GET
*/
public function getVideoGame($id){
$vg = $this->dao->getVideoGame($id);
if ($vg){
return new Response(Response::OK,$vg);
}else{
throw new NotFoundException();
}
}
}