Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module rename. #664

Merged
merged 3 commits into from
Apr 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Staff/Staff.php → src/CustomerService/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

/**
* Staff.php.
* CustomerService.php.
*
* @author overtrue <[email protected]>
* @copyright 2015 overtrue <[email protected]>
Expand All @@ -19,15 +19,15 @@
* @see http://overtrue.me
*/

namespace EasyWeChat\Staff;
namespace EasyWeChat\CustomerService;

use EasyWeChat\Core\AbstractAPI;
use EasyWeChat\Support\Collection;

/**
* Class Staff.
* Class CustomerService.
*/
class Staff extends AbstractAPI
class CustomerService extends AbstractAPI
{
const API_LISTS = 'https://api.weixin.qq.com/cgi-bin/customservice/getkflist';
const API_ONLINE = 'https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist';
Expand Down Expand Up @@ -155,7 +155,7 @@ public function avatar($account, $path)
*
* @param \EasyWeChat\Message\AbstractMessage|string $message
*
* @return \EasyWeChat\Staff\MessageBuilder
* @return \EasyWeChat\CustomerService\MessageBuilder
*
* @throws \EasyWeChat\Core\Exceptions\InvalidArgumentException
*/
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @see http://overtrue.me
*/

namespace EasyWeChat\Staff;
namespace EasyWeChat\CustomerService;

use EasyWeChat\Core\Exceptions\InvalidArgumentException;
use EasyWeChat\Core\Exceptions\RuntimeException;
Expand Down Expand Up @@ -54,20 +54,20 @@ class MessageBuilder
protected $account;

/**
* Staff instance.
* Customer service instance.
*
* @var \EasyWeChat\Staff\Staff
* @var \EasyWeChat\CustomerService\CustomerService
*/
protected $staff;
protected $customerService;

/**
* MessageBuilder constructor.
*
* @param \EasyWeChat\Staff\Staff $staff
* @param \EasyWeChat\CustomerService\CustomerService $customerService
*/
public function __construct(Staff $staff)
public function __construct(CustomerService $customerService)
{
$this->staff = $staff;
$this->customerService = $customerService;
}

/**
Expand Down Expand Up @@ -148,7 +148,7 @@ public function send()
$message = array_merge($message, $content);
}

return $this->staff->send($message);
return $this->customerService->send($message);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Staff/README.md → src/CustomerService/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# staff
# customer-service
微信 SDK 客服模块
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Staff;
namespace EasyWeChat\CustomerService;

use Pimple\Container;
use Pimple\ServiceProviderInterface;
Expand All @@ -40,11 +40,11 @@ class ServiceProvider implements ServiceProviderInterface
*/
public function register(Container $pimple)
{
$pimple['staff'] = function ($pimple) {
return new Staff($pimple['access_token']);
$pimple['customer_service'] = function ($pimple) {
return new CustomerService($pimple['access_token']);
};

$pimple['staff_session'] = $pimple['staff.session'] = function ($pimple) {
$pimple['customer_service_session'] = $pimple['customer_service.session'] = function ($pimple) {
return new Session($pimple['access_token']);
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Staff/Session.php → src/CustomerService/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @see http://overtrue.me
*/

namespace EasyWeChat\Staff;
namespace EasyWeChat\CustomerService;

use EasyWeChat\Core\AbstractAPI;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @see http://overtrue.me
*/

namespace EasyWeChat\Staff;
namespace EasyWeChat\CustomerService;

use EasyWeChat\Message\AbstractMessage;
use EasyWeChat\Message\News;
Expand Down
8 changes: 4 additions & 4 deletions src/Staff/composer.json → src/CustomerService/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "easywechat/staff",
"description": "staff module for EasyWeChat SDK.",
"keywords": ["wechat", "weixin", "SDK", "staff", "easywechat"],
"name": "easywechat/customer-service",
"description": "customer-service module for EasyWeChat SDK.",
"keywords": ["wechat", "weixin", "SDK", "customer-service", "easywechat"],
"license": "MIT",
"authors": [
{
Expand All @@ -11,7 +11,7 @@
],
"autoload": {
"psr-4": {
"EasyWeChat\\Staff\\": "."
"EasyWeChat\\CustomerService\\": "."
}
},
"minimum-stability":"dev",
Expand Down
8 changes: 4 additions & 4 deletions src/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
* @property \EasyWeChat\Js\Js $js
* @property \Overtrue\Socialite\Providers\WeChatProvider $oauth
* @property \EasyWeChat\Menu\Menu $menu
* @property \EasyWeChat\Notice\Notice $notice
* @property \EasyWeChat\TemplateMessage\TemplateMessage $template_message
* @property \EasyWeChat\Material\Material $material
* @property \EasyWeChat\Material\Temporary $material_temporary
* @property \EasyWeChat\Staff\Staff $staff
* @property \EasyWeChat\CustomerService\CustomerService $CustomerService
* @property \EasyWeChat\Url\Url $url
* @property \EasyWeChat\QRCode\QRCode $qrcode
* @property \EasyWeChat\Semantic\Semantic $semantic
Expand Down Expand Up @@ -83,9 +83,9 @@ class Application extends Container
\EasyWeChat\Js\ServiceProvider::class,
\EasyWeChat\OAuth\ServiceProvider::class,
\EasyWeChat\Menu\ServiceProvider::class,
\EasyWeChat\Notice\ServiceProvider::class,
\EasyWeChat\TemplateMessage\ServiceProvider::class,
\EasyWeChat\Material\ServiceProvider::class,
\EasyWeChat\Staff\ServiceProvider::class,
\EasyWeChat\CustomerService\ServiceProvider::class,
\EasyWeChat\Url\ServiceProvider::class,
\EasyWeChat\QRCode\ServiceProvider::class,
\EasyWeChat\Semantic\ServiceProvider::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

/**
* Staff.php.
* CustomerService.php.
*
* Part of Overtrue\WeChat.
*
Expand All @@ -24,10 +24,10 @@
* @see http://overtrue.me
*/

namespace EasyWeChat\MiniProgram\Staff;
namespace EasyWeChat\MiniProgram\CustomerService;

use EasyWeChat\Staff\Staff as BaseStaff;
use EasyWeChat\CustomerService\CustomerService as BaseCustomerService;

class Staff extends BaseStaff
class CustomerService extends BaseCustomerService
{
}
8 changes: 4 additions & 4 deletions src/MiniProgram/MiniProgram.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
/**
* Class MiniProgram.
*
* @property \EasyWeChat\MiniProgram\Server\Guard $server
* @property \EasyWeChat\MiniProgram\Sns\Sns $sns
* @property \EasyWeChat\MiniProgram\Notice\Notice $notice
* @property \EasyWeChat\MiniProgram\Staff\Staff $staff
* @property \EasyWeChat\MiniProgram\Stats\Stats $stats
* @property \EasyWeChat\MiniProgram\Server\Guard $server
* @property \EasyWeChat\MiniProgram\TemplateMessage\TemplateMessage $template_message
* @property \EasyWeChat\MiniProgram\QRCode\QRCode $qrcode
* @property \EasyWeChat\MiniProgram\Material\Temporary $material_temporary
* @property \EasyWeChat\MiniProgram\Stats\Stats $stats
* @property \EasyWeChat\MiniProgram\CustomerService\CustomerService $customer_service
*/
class MiniProgram
{
Expand Down
12 changes: 6 additions & 6 deletions src/MiniProgram/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
namespace EasyWeChat\MiniProgram;

use EasyWeChat\Encryption\Encryptor;
use EasyWeChat\MiniProgram\CustomerService\CustomerService;
use EasyWeChat\MiniProgram\Material\Temporary;
use EasyWeChat\MiniProgram\Notice\Notice;
use EasyWeChat\MiniProgram\QRCode\QRCode;
use EasyWeChat\MiniProgram\Server\Guard;
use EasyWeChat\MiniProgram\Sns\Sns;
use EasyWeChat\MiniProgram\Staff\Staff;
use EasyWeChat\MiniProgram\Stats\Stats;
use EasyWeChat\MiniProgram\TemplateMessage\TemplateMessage;
use Pimple\Container;
use Pimple\ServiceProviderInterface;

Expand Down Expand Up @@ -72,12 +72,12 @@ public function register(Container $pimple)
return $server;
};

$pimple['mini_program.staff'] = function ($pimple) {
return new Staff($pimple['mini_program.access_token']);
$pimple['mini_program.customer_service'] = function ($pimple) {
return new CustomerService($pimple['mini_program.access_token']);
};

$pimple['mini_program.notice'] = function ($pimple) {
return new Notice($pimple['mini_program.access_token']);
$pimple['mini_program.template_message'] = function ($pimple) {
return new TemplateMessage($pimple['mini_program.access_token']);
};

$pimple['mini_program.material_temporary'] = function ($pimple) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

/**
* Notice.php.
* TemplateMessage.php.
*
* Part of Overtrue\WeChat.
*
Expand All @@ -24,11 +24,11 @@
* @see http://overtrue.me
*/

namespace EasyWeChat\MiniProgram\Notice;
namespace EasyWeChat\MiniProgram\TemplateMessage;

use EasyWeChat\Notice\Notice as BaseNotice;
use EasyWeChat\TemplateMessage\TemplateMessage as BaseTemplateMessage;

class Notice extends BaseNotice
class TemplateMessage extends BaseTemplateMessage
{
/**
* {@inheritdoc}.
Expand Down Expand Up @@ -58,7 +58,7 @@ class Notice extends BaseNotice
protected $required = ['touser', 'template_id', 'form_id'];

/**
* Send notice message.
* Send template message.
*/
const API_SEND_NOTICE = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send';
const API_SEND_TEMPLATE_MESSAGE = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send';
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Notice/README.md → src/TemplateMessage/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# notice
# template-message
微信 SDK 模板消息
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* with this source code in the file LICENSE.
*/

namespace EasyWeChat\Notice;
namespace EasyWeChat\TemplateMessage;

use Pimple\Container;
use Pimple\ServiceProviderInterface;
Expand All @@ -40,8 +40,8 @@ class ServiceProvider implements ServiceProviderInterface
*/
public function register(Container $pimple)
{
$pimple['notice'] = function ($pimple) {
return new Notice($pimple['access_token']);
$pimple['template_message'] = function ($pimple) {
return new TemplateMessage($pimple['access_token']);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

/**
* Notice.php.
* TemplateMessage.php.
*
* @author overtrue <[email protected]>
* @copyright 2015 overtrue <[email protected]>
Expand All @@ -19,16 +19,16 @@
* @see http://overtrue.me
*/

namespace EasyWeChat\Notice;
namespace EasyWeChat\TemplateMessage;

use EasyWeChat\Core\AbstractAPI;
use EasyWeChat\Core\AccessToken;
use EasyWeChat\Core\Exceptions\InvalidArgumentException;

/**
* Class Notice.
* Class TemplateMessage.
*/
class Notice extends AbstractAPI
class TemplateMessage extends AbstractAPI
{
/**
* Default color.
Expand Down Expand Up @@ -63,15 +63,15 @@ class Notice extends AbstractAPI
*/
protected $messageBackup;

const API_SEND_NOTICE = 'https://api.weixin.qq.com/cgi-bin/message/template/send';
const API_SEND_TEMPLATE_MESSAGE = 'https://api.weixin.qq.com/cgi-bin/message/template/send';
const API_SET_INDUSTRY = 'https://api.weixin.qq.com/cgi-bin/template/api_set_industry';
const API_ADD_TEMPLATE = 'https://api.weixin.qq.com/cgi-bin/template/api_add_template';
const API_GET_INDUSTRY = 'https://api.weixin.qq.com/cgi-bin/template/get_industry';
const API_GET_ALL_PRIVATE_TEMPLATE = 'https://api.weixin.qq.com/cgi-bin/template/get_all_private_template';
const API_DEL_PRIVATE_TEMPLATE = 'https://api.weixin.qq.com/cgi-bin/template/del_private_template';

/**
* Notice constructor.
* TemplateMessage constructor.
*
* @param \EasyWeChat\Core\AccessToken $accessToken
*/
Expand Down Expand Up @@ -149,7 +149,7 @@ public function deletePrivateTemplate($templateId)
}

/**
* Send a notice message.
* Send a template message.
*
* @param $data
*
Expand All @@ -173,7 +173,7 @@ public function send($data = [])

$this->message = $this->messageBackup;

return $this->parseJSON('json', [static::API_SEND_NOTICE, $params]);
return $this->parseJSON('json', [static::API_SEND_TEMPLATE_MESSAGE, $params]);
}

/**
Expand All @@ -182,7 +182,7 @@ public function send($data = [])
* @param string $method
* @param array $args
*
* @return Notice
* @return \EasyWeChat\TemplateMessage\TemplateMessage
*/
public function __call($method, $args)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "easywechat/notice",
"description": "notice module for EasyWeChat SDK.",
"keywords": ["wechat", "weixin", "SDK", "notice", "easywechat"],
"name": "easywechat/template-message",
"description": "template-message module for EasyWeChat SDK.",
"keywords": ["wechat", "weixin", "SDK", "template-message", "easywechat"],
"license": "MIT",
"authors": [
{
Expand All @@ -11,7 +11,7 @@
],
"autoload": {
"psr-4": {
"EasyWeChat\\Notice\\": "."
"EasyWeChat\\TemplateMessage\\": "."
}
},
"minimum-stability":"dev",
Expand Down
Loading