mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-23 03:50:56 +08:00
32 lines
634 B
PHP
32 lines
634 B
PHP
<?php
|
|
|
|
namespace App\Services\Frontend\Topic;
|
|
|
|
use App\Models\Topic as TopicModel;
|
|
use App\Services\Frontend\Service as FrontendService;
|
|
use App\Services\Frontend\TopicTrait;
|
|
|
|
class TopicInfo extends FrontendService
|
|
{
|
|
|
|
use TopicTrait;
|
|
|
|
public function handle($id)
|
|
{
|
|
$topic = $this->checkTopicCache($id);
|
|
|
|
return $this->handleTopic($topic);
|
|
}
|
|
|
|
protected function handleTopic(TopicModel $topic)
|
|
{
|
|
return [
|
|
'id' => $topic->id,
|
|
'title' => $topic->title,
|
|
'summary' => $topic->about,
|
|
'course_count' => $topic->course_count,
|
|
];
|
|
}
|
|
|
|
}
|