feat(resource): 实现了灰度图的资源

This commit is contained in:
李东云
2022-08-29 19:27:52 +08:00
parent 60305d1aa2
commit f4c11c4dad
2 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
/**
* Grayscale.php@HDK
*
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2022/8/29
*/
namespace Singularity\HDK\Studio\Resource;
use Hyperf\Resource\Json\JsonResource;
use Singularity\HDK\Utils\Resource\ClassicResponse;
/**
* Singularity\HDK\Studio\Resource\Grayscale@HDK
*
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2022/8/29
*
* @property int $id
* @property string $nameZh 中文名称
* @property string $nameEn 英文名称
* @property string $path 原始图片路径
* @property string $pathPreview 压缩的预览用图片路径
* @property int $sort 排序值,数字越大越靠前
*/
class Grayscale extends JsonResource
{
use ClassicResponse;
public function toArray(): array
{
return [
'id' => $this->id,
'nameZh' => $this->nameZh,
'nameEn' => $this->nameEn,
'path' => $this->path,
'pathPreview' => $this->pathPreview,
'sort' => $this->sort,
];
}
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* GrayscaleCollection.php@HDK
*
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2022/8/29
*/
namespace Singularity\HDK\Studio\Resource;
use Hyperf\Resource\Json\ResourceCollection;
use Singularity\HDK\Utils\Resource\ClassicResponse;
/**
* Singularity\HDK\Studio\Resource\ GrayscaleCollection@HDK
*
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
* Powered by PhpStorm
* Created on 2022/8/29
*/
class GrayscaleCollection extends ResourceCollection
{
use ClassicResponse;
}