<?php
 namespace Module\Document\Api\Controller; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Response; use ModStart\Core\Util\ArrayUtil; use ModStart\Module\ModuleBaseController; use Module\Document\Util\DocumentUtil; class DocumentController extends ModuleBaseController { public function lists() { $documents = DocumentUtil::listWithCache(); return Response::generateSuccessData(ArrayUtil::keepItemsKeys($documents, ['id', 'title'])); } public function get() { $id = InputPackage::buildFromInput()->getInteger('id'); $document = DocumentUtil::get($id); return Response::generateSuccessData($document); } }