src/Topxia/MobileBundleV2/Processor/Impl/CourseProcessorImpl.php

(开头部分) 1KB

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

<?php

namespace Topxia\MobileBundleV2\Processor\Impl;

use AppBundle\Common\Exception\AbstractException;
use Biz\Util\EdusohoLiveClient;
use AppBundle\Common\ArrayToolkit;
use Symfony\Component\HttpFoundation\Response;
use Topxia\MobileBundleV2\Processor\BaseProcessor;
use Topxia\MobileBundleV2\Processor\CourseProcessor;

class CourseProcessorImpl extends BaseProcessor implements CourseProcessor
{
    public function getVersion()
    {
        return $this->formData;
    }

    public function getCourseNotices()
    {
        $start = (int) $this->getParam('start', 0);
        $limit = (int) $this->getParam('limit', 10);
        $courseId = $this->getParam('courseId');

        if (empty($courseId)) {
            return array();
        }

        $conditions = array(
            'targetType' => 'course',
            'targetId' => $courseId,
        );

        $announcements = $this->getAnnouncementService()->searchAnnouncements(
            $conditions,
            array('createdTime' => 'DESC'),
            $start,
            $limit
        );
        $announcements = array_values($announcements);

        return $this->filterAnnouncements($announcements);
    }

    public function getLessonNote()
    {
        $courseId = $this->getParam('courseId');
        $lessonId = $this->getParam('lessonId');

        $user = $this->controller->getUserByToken($this->request);

        if (!$user->isLogin()) {
            return $this->createErrorResponse('not_login', '您尚未登录,不能查看笔记!');
        }

        $lessonNote = $this->controller->getNoteService()->getCourseNoteByUserIdAndTaskId($user['id'], $lessonId);

        if (empty($lessonNote)) {
            return null;
        }

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

AI 解读 AI

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

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