baywa-re-lusy/users-api-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

baywa-re-lusy/users-api-sdk

最新稳定版本:5.0.1

Composer 安装命令:

composer require baywa-re-lusy/users-api-sdk

包简介

BayWa r.e. LUSY Users API SDK

README 文档

README

This SDK can be used to retrieve Users and Subsidiaries.

All dependencies injected into the constructor are PSR-compatible:

Installation

composer require baywa-re-lusy/users-api-sdk

Usage

use Laminas\Cache\Storage\Adapter\Apcu;

$tokenCache  = new \Laminas\Cache\Psr\CacheItemPool\CacheItemPoolDecorator(new Apcu());
$resultCache = new \Laminas\Cache\Psr\CacheItemPool\CacheItemPoolDecorator(new Apcu());
$httpClient  = new \GuzzleHttp\Client();

$usersApiClient = new \BayWaReLusy\UsersAPI\SDK\UsersApiClient(
    "<URL to Users API>",
    "<URL to Token API Endpoint>",
    "<Client ID>",
    "<Client Secret>",
    $tokenCache,
    $resultCache,
    $httpClient    
);

$users            = $usersApiClient->getUsers();
$subsidiaries     = $usersApiClient->getSubsidiaries();
$user             = $usersApiClient->getUser('<userId>');

Cache Refresh via Console commands

This SDK contains Symfony Console commands to refresh the User/Subsidiary cache. You can include the Console commands into your application:

$cliApp = new \Symfony\Component\Console\Application();

$cliApp->add(new \BayWaReLusy\UsersAPI\SDK\Console\RefreshUserCache($usersApiClient));
$cliApp->add(new \BayWaReLusy\UsersAPI\SDK\Console\RefreshSubsidiaryCache($usersApiClient)));

And then run the Console commands with:

./console users-api-sdk:refresh-user-cache
./console users-api-sdk:refresh-subsidiary-cache

统计信息

  • 总下载量: 440
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2023-02-02