diff --git a/backend/app/Platform/Tools/Request/PlatformRequest.php b/backend/app/Platform/Tools/Request/PlatformRequest.php new file mode 100644 index 0000000..295e20e --- /dev/null +++ b/backend/app/Platform/Tools/Request/PlatformRequest.php @@ -0,0 +1,52 @@ +filter(function($el) use ($name){ + return strtolower($el['label']) == $name ? $el : null; + }); + + if($platforms->isEmpty()){ + throw new \InvalidArgumentException("tools 中未找到 name 为 $name 的公司信息,请确认 tools 系统中已创建该公司的记录!"); + } + + return $platforms->first(); + } + public static function all($query = []): array + { + $path = 'api/ext/platforms'; + return static::fetch($collection, $path, $query); + + } + + protected static function fetch($path, $query) + { + return static::get($path, $query); + } + + public static function update(int $id, array $data): array + { + $path = "/api/ext/platforms/$id"; + return static::put($path, [], $data); + } + + + + +}