feat : site
This commit is contained in:
@@ -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 ?? '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user