mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-24 20:06:09 +08:00
39 lines
817 B
PHP
39 lines
817 B
PHP
<?php
|
|
/**
|
|
* @copyright Copyright (c) 2023 深圳市酷瓜软件有限公司
|
|
* @license https://opensource.org/licenses/GPL-2.0
|
|
* @link https://www.koogua.com
|
|
*/
|
|
|
|
namespace App\Services\Logic\User;
|
|
|
|
use App\Models\User as UserModel;
|
|
use App\Services\Logic\Service as LogicService;
|
|
use App\Services\Logic\UserTrait;
|
|
|
|
class ShallowUserInfo extends LogicService
|
|
{
|
|
|
|
use UserTrait;
|
|
|
|
public function handle($id)
|
|
{
|
|
$user = $this->checkUser($id);
|
|
|
|
return $this->handleUser($user);
|
|
}
|
|
|
|
protected function handleUser(UserModel $user)
|
|
{
|
|
return [
|
|
'id' => $user->id,
|
|
'name' => $user->name,
|
|
'avatar' => $user->avatar,
|
|
'title' => $user->title,
|
|
'about' => $user->about,
|
|
'vip' => $user->vip,
|
|
];
|
|
}
|
|
|
|
}
|