Skip to content

Commit

Permalink
delete test file
Browse files Browse the repository at this point in the history
  • Loading branch information
WangNingkai committed Nov 27, 2018
1 parent 477dbb1 commit 050d416
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 0 additions & 5 deletions app/Console/Commands/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,5 @@ public function __construct()
public function handle()
{
Tool::refreshToken();
$res1 = OneDrive::requestApi('get', '/me/drive/items/01FGBPEHWUSY5I7NIRV5CIAAPFVJFPEBP4');
// $res2 = OneDrive::requestApi('get', '/me/drive/root:/share:/children?$expand=thumbnails&$top=2');
// $res = OneDrive::requestApi('get', '/me/drive/root/children?$top=2');
// dump(OneDrive::handleResponse($res));
dd($res1);
}
}
10 changes: 6 additions & 4 deletions app/Helpers/OneDrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,13 @@ public static function getDrive()
/**
* Get Drive Item Children
* @param $itemId
* @param $query
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public static function getChildren($itemId = '')
public static function getChildren($itemId = '', $query = '')
{
$endpoint = $itemId ? "/me/drive/items/{$itemId}/children" : "/me/drive/root/children";
$endpoint = $itemId ? "/me/drive/items/{$itemId}/children{$query}" : "/me/drive/root/children{$query}";
$response = self::requestApi('get', $endpoint);
if ($response instanceof Response) {
$response = json_decode($response->getBody()->getContents(), true);
Expand All @@ -179,12 +180,13 @@ public static function getChildren($itemId = '')
/**
* Get Drive Item Children by Path
* @param $path
* @param $query
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public static function getChildrenByPath($path = '/')
public static function getChildrenByPath($path = '/', $query = '')
{
$endpoint = $path === '/' ? "/me/drive/root/children" : "/me/drive/root{$path}children";
$endpoint = $path === '/' ? "/me/drive/root/children{$query}" : "/me/drive/root{$path}children{$query}";
$response = self::requestApi('get', $endpoint);
if ($response instanceof Response) {
$response = json_decode($response->getBody()->getContents(), true);
Expand Down

0 comments on commit 050d416

Please sign in to comment.