1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-23 11:58:41 +08:00
koogua 79a2253918 1.文章单页等增加关键字
2.专题增加封面上传
2022-09-15 20:39:49 +08:00

41 lines
949 B
PHP

<?php
/**
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.koogua.com
*/
namespace App\Services\Logic\Topic;
use App\Models\Topic as TopicModel;
use App\Services\Logic\Service as LogicService;
use App\Services\Logic\TopicTrait;
class TopicInfo extends LogicService
{
use TopicTrait;
public function handle($id)
{
$topic = $this->checkTopic($id);
return $this->handleTopic($topic);
}
protected function handleTopic(TopicModel $topic)
{
return [
'id' => $topic->id,
'title' => $topic->title,
'topic' => $topic->cover,
'summary' => $topic->summary,
'published' => $topic->published,
'deleted' => $topic->deleted,
'create_time' => $topic->create_time,
'update_time' => $topic->update_time,
];
}
}