-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Gerfey/AL_update_client
Дополнил немного клиент
- Loading branch information
Showing
11 changed files
with
164 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,75 @@ | ||
# tecdoc | ||
Клиент для работы c TecDoc API | ||
# TecDoc API | ||
|
||
[![Source Code][badge-source]][source] | ||
[![Software License][badge-license]][license] | ||
[![Total Downloads][badge-downloads]][downloads] | ||
|
||
gerfey/tecdoc-client - client for working with the TecDoc API, designed to run on Laravel. | ||
|
||
## Installation | ||
|
||
The preferred method of installation is via [Packagist][] and [Composer][]. Run | ||
the following command to install the package and add it as a requirement to your | ||
project's `composer.json`: | ||
|
||
```bash | ||
composer require gerfey/tecdoc-client | ||
``` | ||
|
||
### Settings | ||
|
||
1. Use command ```php artisan vendor:publish ``` and select tag: ***tecdoc*** | ||
2. Check files ***tecdoc.php*** to path ***.../laravel-project/config/*** | ||
3. Create the ***TECDOC_PROVIDER_ID***, ***TECDOC_API_KEY***, ***TECDOC_LANGUAGE_CODE*** keys in the file ***.env*** | ||
|
||
### Run | ||
|
||
```php | ||
<?php | ||
|
||
$tecDoc = new \Gerfey\TecDoc\Request\Pegasus\Pegasus_3_0(new \Gerfey\TecDoc\Http\TecDocClient()); | ||
dd($tecDoc->getAmBrands()->getJson()); | ||
``` | ||
|
||
### Result | ||
|
||
```json | ||
{#1821 | ||
+"data": {#1820 | ||
+"array": array:142 [ | ||
0 => {#1685 | ||
+"brandId": 1 | ||
+"brandLogoID": "100000" | ||
+"brandName": "SPIDAN" | ||
} | ||
1 => {#1677 | ||
+"brandId": 2 | ||
+"brandLogoID": "200001" | ||
+"brandName": "HELLA" | ||
} | ||
... | ||
] | ||
} | ||
+"status": 200 | ||
} | ||
``` | ||
|
||
## Copyright and License | ||
|
||
The gerfey/tecdoc-client library is copyright © [Alexander Levchenkov](https://vk.com/gerfey) and | ||
licensed for use under the MIT License (MIT). Please see [LICENSE][] for more | ||
information. | ||
|
||
[packagist]: https://packagist.org/packages/gerfey/tecdoc-client | ||
[composer]: http://getcomposer.org/ | ||
|
||
[badge-source]: https://img.shields.io/badge/gerfey/tecdoc-client-blue.svg?style=flat-square | ||
[badge-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square | ||
[badge-build]: https://img.shields.io/travis/gerfey/tecdoc-client/master.svg?style=flat-square | ||
[badge-downloads]: https://img.shields.io/packagist/dt/gerfey/tecdoc-client.svg?style=flat-square | ||
|
||
[source]: https://github.com/gerfey/tecdoc-client | ||
[release]: https://packagist.org/packages/gerfey/tecdoc-client | ||
[license]: https://github.com/gerfey/tecdoc-client/blob/master/LICENSE | ||
[build]: https://travis-ci.org/gerfey/tecdoc-client | ||
[downloads]: https://packagist.org/packages/gerfey/tecdoc-client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,46 @@ | ||
{ | ||
"name": "gerfey/tecdoc-client", | ||
"description": "Client for working with the TecDoc API", | ||
"keywords": [ | ||
"Gerfey", | ||
"API", | ||
"TecDoc" | ||
], | ||
"homepage": "https://github.com/Gerfey/tecdoc-client", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Alexander Levchenkov", | ||
"email": "sanjia@live.ru", | ||
"homepage": "https://github.com/gerfey", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"guzzlehttp/guzzle": "^7.3.0", | ||
"jms/serializer": "^1.1" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Gerfey\\TecDoc\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Gerfey\\TecDoc\\": "tests/" | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
} | ||
"name": "gerfey/tecdoc-client", | ||
"description": "Client for working with the TecDoc API", | ||
"keywords": [ | ||
"Gerfey", | ||
"API", | ||
"TecDoc" | ||
], | ||
"homepage": "https://github.com/Gerfey/tecdoc-client", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Alexander Levchenkov", | ||
"email": "sanjia@live.ru", | ||
"homepage": "https://github.com/gerfey", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.0|^8.1", | ||
"guzzlehttp/guzzle": "^7.4.5", | ||
"jms/serializer": "^1.1" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Gerfey\\TecDoc\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Gerfey\\TecDoc\\": "tests/" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Gerfey\\TecDoc\\GerfeyTecDocServiceProvider" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
<?php | ||
|
||
return [ | ||
'hostname' => 'https://webservice.tecalliance.services', | ||
'endpoint' => '/pegasus-3-0/services/TecdocToCatDLB.jsonEndpoint', | ||
|
||
'auth' => [ | ||
'provider_id' => env('TECDOC_PROVIDER_ID'), | ||
'api_key' => env('TECDOC_API_KEY'), | ||
'language_code' => env('TECDOC_LANGUAGE_CODE'), | ||
] | ||
]; | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Gerfey\TecDoc; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class GerfeyTecDocServiceProvider extends ServiceProvider | ||
{ | ||
public function register() | ||
{ | ||
if ($this->app->runningInConsole()) { | ||
$this->mergeConfigFrom(__DIR__ . '/../config/tecdoc.php', 'tecdoc'); | ||
|
||
$this->publishes( | ||
[ | ||
__DIR__ . '/../config/tecdoc.php' => config_path('tecdoc.php'), | ||
], | ||
'tecdoc' | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.