feat(studio): 更新晶格生成任务 source 的资源模型

Signed-off-by: 李东云 <dongyun.li@luxcreo.ai>
This commit is contained in:
李东云
2022-05-18 11:38:02 +08:00
parent 4904c558ca
commit 6b5b41abf0

View File

@@ -23,14 +23,14 @@ use Singularity\HDK\Utils\Resource\ClassicResponse;
* Powered by PhpStorm
* Created on 2022/5/13
*
* @property string $modelId 要处理的模型文件 ID
* @property string $modelUrl 要处理的模型文件完整路径
* @property TaskLatticeAction $action 模型精度
* @property \Singularity\HDK\Studio\Resource\Lattice $lattice 晶格
* @property float $scalingRatio 密度比,两位小数
* @property float $size 晶格尺寸
* @property float $wide 杆径粗细
* @property int $surfaceNum 面数
* @property string $fileId 要处理的模型文件 ID
* @property string $fileUrl 要处理的模型文件完整路径
* @property TaskLatticeAction $action 模型精度
* @property string $latticeId 晶格
* @property float $scalingRatio 密度比,两位小数
* @property float $size 晶格尺寸
* @property float $wide 杆径粗细
* @property int $surfaceNum 面数
*/
final class Lattice extends JsonResource
{
@@ -38,11 +38,12 @@ final class Lattice extends JsonResource
public function toArray(): array
{
$action = $this->action ?? $this['action'];
return [
'modelId' => $this->modelId ?? $this['modelId'],
'modelUrl' => $this->modelUrl ?? $this['modelUrl'],
'action' => ($this->action ?? $this['action'])->getValue(),
'lattice' => ($this->lattice ?? $this['lattice'])->title,
'fileId' => $this->fileId ?? $this['fileId'],
'fileUrl' => $this->fileUrl ?? $this['fileUrl'],
'action' => is_string($action) ? $action : $action->getValue(),
'lattice' => $this->latticeId ?? $this['latticeId'],
'scalingRatio' => $this->scalingRatio ?? $this['scalingRatio'],
'size' => $this->size ?? $this['size'],
'wide' => $this->wide ?? $this['wide'],