mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKit.git
synced 2026-01-15 00:35:08 +08:00
62
src/Studio/Resource/File.php
Normal file
62
src/Studio/Resource/File.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* File.php@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/5/19
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Studio\Resource;
|
||||
|
||||
use Hyperf\Resource\Json\JsonResource;
|
||||
use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
|
||||
/**
|
||||
* Singularity\HDK\Studio\Resource\File@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/5/19
|
||||
*
|
||||
* @property string $fileId
|
||||
* @property string $userId 创建用户的 id,不确定能不能获取到
|
||||
* @property string $wsId 所属工作空间 ID
|
||||
* @property string $taskId 所属任务 ID,type为source可为空
|
||||
* @property string $type 模型类型。source 源文件,output 产物
|
||||
* @property string $name 文件名
|
||||
* @property string $path 相对路径
|
||||
* @property string $fullPath 完整url路径
|
||||
* @property string $mimeType 资源类型,例如jpeg图片的资源类型为image/jpeg
|
||||
* @property int $size Object大小
|
||||
* @property string $length 模型文件长
|
||||
* @property string $width 模型文件宽
|
||||
* @property string $height 模型文件高
|
||||
* @property string $external 完整的回调响应信息
|
||||
* @property \Carbon\Carbon $createdAt
|
||||
*/
|
||||
final class File extends JsonResource
|
||||
{
|
||||
use ClassicResponse;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'fileId' => $this->fileId,
|
||||
'workspaceId' => $this->wsId ?? null,
|
||||
'type' => $this->type,
|
||||
'name' => $this->name,
|
||||
'path' => $this->path,
|
||||
'fullPath' => $this->fullPath,
|
||||
'mimeType' => $this->mimeType,
|
||||
'size' => $this->size,
|
||||
'model' => [
|
||||
'length' => $this->length,
|
||||
'width' => $this->width,
|
||||
'height' => $this->height,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user