fastwhale / yii2-we-work-private
Yii2 private wechat work SDK
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- php: ^7.1
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-11-07 10:04:11 UTC
README
Yii2 private wechat work SDK
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist fastwhale/yii2-we-work-private "*"
or add
"fastwhale/yii2-we-work-private": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
/** @var Work $workApi */ $workApi = \Yii::createObject([ 'class' => Work::className(), 'corpid' => $corpid, 'secret' => $secret, 'privatizedBaseUrl' => 'https://privateHost', ]); /** @var Work $agentApi */ $agentApi = \Yii::createObject([ 'class' => Work::className(), 'corpid' => $corpid, 'secret' => $agentSecret, 'privatizedBaseUrl' => 'https://privateHost', ]); /** @var ServiceWork $serviceWork */ $serviceWork = \Yii::createObject([ 'class' => ServiceWork::className(), 'suite_id' => $suiteId, 'suite_secret' => $suiteSecret, 'suite_ticket' => $suiteTicket, 'auth_corpid' => $authCorpid, 'permanent_code' => $permanentCode, 'privatizedBaseUrl' => 'https://privateHost', ]); /** @var ServiceProvider $serviceProvider */ $serviceProvider = \Yii::createObject([ 'class' => ServiceProvider::className(), 'provider_corpid' => $providerCorpid, 'provider_secret' => $providerSecret, 'privatizedBaseUrl' => 'https://privateHost', ]);