feat : site

This commit is contained in:
2024-11-12 15:40:33 +08:00
parent 82dd7450af
commit 900d98234b
7 changed files with 169 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ namespace App\Service\ServiceTrait\Common;
use App\Exception\ErrException;
use App\Model\OssObject;
use Hyperf\Di\Annotation\Inject;
use Hyperf\Tappable\HigherOrderTapProxy;
trait OssTrait
{
@@ -85,4 +86,18 @@ trait OssTrait
return $res;
}
/**
* @param int $ossId
* @return HigherOrderTapProxy|mixed|string|null
*/
public function getOssObjectById(int $ossId): mixed
{
$data = $this->ossObjectModel->getInfoById($ossId);
if (empty($data)){
return '';
}
return $data->url ?? '';
}
}