我为实现实现了一个接口:
interface ICrmClientsRepository
{
public function create(CreateClientDTO $createClientDTO);
public function updateById(
string $id,
UpdateClientDTO $updateClientDTO
);
public function getById(
string $id
);
public function getList($page = 1,$perPage = 50);
public function getListByCreatedRange($startDate, $endDate);
}
在 1 个存储库实现中,我只需要 getList(),但不需要 getListByCreatedRange() 实现,因为在 1 个 CRM 中我们只采用页面记录。在 2 中,相反,我们只取日期,因为没有页面等等。这种情况下我应该怎么办?这两者没有通用的方法,因为它们有不同的方法,并且留下未实现的接口方法不是一个好主意。