调整接口
parent
ddcfbac80e
commit
32226b4b92
|
|
@ -28,7 +28,7 @@ class RegionController extends Controller
|
||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$info = Region::with(['currentPlant'])->show()->findOrFail($id);
|
$info = Region::with(['currentPlant', 'monitorModes'])->show()->findOrFail($id);
|
||||||
|
|
||||||
return $this->json(RegionResource::make($info));
|
return $this->json(RegionResource::make($info));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ class RegionResource extends JsonResource
|
||||||
'position_x'=> $this->position_x,
|
'position_x'=> $this->position_x,
|
||||||
'position_y'=> $this->position_y,
|
'position_y'=> $this->position_y,
|
||||||
'canvasbox'=> '1350,900',
|
'canvasbox'=> '1350,900',
|
||||||
|
'monitor_modes' => MonitorModeResource::collection($this->whenLoaded('monitorModes')),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue