src/ApiBundle/Api/Resource/Uploader/UploaderFinish.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace ApiBundle\Api\Resource\Uploader;

use ApiBundle\Api\ApiRequest;
use ApiBundle\Api\Resource\AbstractResource;
use Biz\Common\CommonException;
use Biz\File\UploadFileException;
use Biz\System\SettingException;

class UploaderFinish extends AbstractResource
{
    public function get(ApiRequest $request, $type, $fileId)
    {
        $cloudAttachment = $this->getSettingService()->get('cloud_attachment', array());
        if (!($cloudAttachment['course'])) {
            throw SettingException::FORBIDDEN_CLOUD_ATTACHMENT();
        }

        $file = $this->getUploadFileService()->getUploadFileInit($fileId);
        if (empty($file)) {
            throw UploadFileException::NOTFOUND_FILE();
        }

        $params = $request->query->all();
        $params['id'] = $fileId;
        $params['uploadType'] = 'direct';

        if (empty($params)) {
            throw CommonException::ERROR_PARAMETER_MISSING();
        }

        $file = $this->getUploadFileService()->finishedUpload($params);

        return $file;
    }

    /**
     * @return \Biz\File\Service\Impl\UploadFileServiceImpl
     */
    protected function getUploadFileService()
    {
        return $this->service('File:UploadFileService');
    }

    /**
     * @return \Biz\System\Service\Impl\SettingServiceImpl
     */
    protected function getSettingService()
    {
        return $this->service('System:SettingService');
    }

    /**
     * @return \Biz\Course\Service\Impl\CourseServiceImpl
     */
    protected function getCourseService()
    {
        return $this->service('Course:CourseService');
    }

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。