limingxinleo / feishu
飞书SDK
Installs: 4 316
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 3
Forks: 8
Open Issues: 0
Requires
- php: >=8.0
- hyperf/codec: ^3.0
- hyperf/guzzle: ^3.0
- hyperf/support: ^3.0
- jetbrains/phpstorm-attributes: ^1.0
- pimple/pimple: ^3.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- hyperf/config: ^3.0
- hyperf/di: ^3.0
- hyperf/testing: ^3.0
- mockery/mockery: ^1.3
- phpstan/phpstan: ^1.0
- phpstan/phpstan-deprecation-rules: ^1.1
README
composer require limingxinleo/feishu
使用
具体使用方法请查看 飞书文档
快速开始
Hyperf
框架中,可以直接使用 Fan\Feishu\Factory
。
- 发布配置
php bin/hyperf.php vendor:publish limingxinleo/feishu
- 注入并使用
<?php use Fan\Feishu\Factory; use Hyperf\Di\Annotation\Inject; class IndexController { #[Inject] public Factory $factory; public function index() { return $this->factory->get('default')->contact->batchGetUserId(emails: ['l@hyperf.io']); } }
其他框架,可以自行 new Application()
使用。
<?php use Fan\Feishu\Application; $app = new Application([ 'app_id' => 'xxx', 'app_secret' => 'xxx', 'http' => [ 'base_uri' => 'https://open.feishu.cn', 'http_errors' => false, 'timeout' => 2, ], ]); $result = $app->contact->batchGetUserId(emails: ['l@hyperf.io']);