您好,我使用 api 平台创建了小“foo”api,现在我正在尝试使用自己的实体,但我不断收到 404 错误,找不到资源。
我正在关注本教程: https ://api-platform.com/docs/distribution/
这是我的实体
<?php
namespace AppBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
/**
* Job
*
* @ApiResource
* @ORM\Entity
*/
class Job
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=100, nullable=false)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="description", type="text")
*/
private $description;
/**
* @var Location The location this job is about.
*
* @ORM\ManyToOne(targetEntity="Location", inversedBy="jobs")
*/
private $location;
如果有人可以帮助我解决为什么这不起作用,我将不胜感激:)
提前谢谢了!