feat(studio): 更新 task 的 source 字段值资源模型,以兼容传入数组

Signed-off-by: 李东云 <dongyun.li@luxcreo.ai>
This commit is contained in:
李东云
2022-05-16 16:22:47 +08:00
parent 9c61d25e3f
commit c5362d4675
3 changed files with 16 additions and 16 deletions

View File

@@ -36,12 +36,12 @@ final class Frame extends JsonResource
public function toArray(): array
{
return [
'modelId' => $this->modelId,
'modelUrl' => $this->modelUrl,
'latticeId' => $this->latticeId,
'scalingRatio' => $this->scalingRatio,
'size' => $this->size,
'surfaceNum' => $this->surfaceNum,
'modelId' => $this->modelId ?? $this['modelId'],
'modelUrl' => $this->modelUrl ?? $this['modelUrl'],
'latticeId' => $this->latticeId ?? $this['latticeId'],
'scalingRatio' => $this->scalingRatio ?? $this['scalingRatio'],
'size' => $this->size ?? $this['size'],
'surfaceNum' => $this->surfaceNum ?? $this['size'],
];
}
}

View File

@@ -39,14 +39,14 @@ final class Lattice extends JsonResource
public function toArray(): array
{
return [
'modelId' => $this->modelId,
'modelUrl' => $this->modelUrl,
'action' => $this->action->getValue(),
'latticeId' => $this->latticeId,
'scalingRatio' => $this->scalingRatio,
'size' => $this->size,
'wide' => $this->wide,
'surfaceNum' => $this->surfaceNum,
'modelId' => $this->modelId ?? $this['modelId'],
'modelUrl' => $this->modelUrl ?? $this['modelUrl'],
'action' => ($this->action ?? $this['action'])->getValue(),
'latticeId' => $this->latticeId ?? $this['latticeId'],
'scalingRatio' => $this->scalingRatio ?? $this['scalingRatio'],
'size' => $this->size ?? $this['size'],
'wide' => $this->wide ?? $this['wide'],
'surfaceNum' => $this->surfaceNum ?? $this['surfaceNum'],
];
}
}

View File

@@ -31,8 +31,8 @@ final class Preflight extends JsonResource
public function toArray(): array
{
return [
'modelId' => $this->modelId,
'modelUrl' => $this->modelUrl,
'modelId' => $this->modelId ?? $this['modelId'],
'modelUrl' => $this->modelUrl ?? $this['modelUrl'],
];
}
}