Files
nl-admin-api/app/Service/common/oss/OssStorageInterface.php
2026-08-10 18:32:06 +08:00

35 lines
938 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Service\common\oss;
/**
* OSS 存储驱动统一契约:工厂按 driver 返回实现类UploadService 只依赖本接口
*/
interface OssStorageInterface
{
/**
* 注入本请求的运行时配置(密钥已解密)
*
* @param array $config OssRuntimeConfigService::getActiveConfig()
*/
public function withConfig(array $config): static;
/**
* 上传图片对象
*
* @param mixed $filePath 本地路径或 UploadedFile
* @param string $key 对象键
* @return array{key:string,url:string}|false
*/
public function uploadImage($filePath, string $key): bool|array;
/**
* 上传视频/通用文件对象
*
* @param mixed $filePath 本地路径或 UploadedFile
* @param string $key 对象键
* @return array{key:string,url:string}|false
*/
public function uploadVideo($filePath, string $key): bool|array;
}