Skip to content

Commit 3e26d14

Browse files
committed
使用配置提供命令
1 parent 02d9c5d commit 3e26d14

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/Command/SyncMigrationCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
*/
1212
namespace KY\WorkWxUser\Command;
1313

14-
use Hyperf\Command\Annotation\Command;
1514
use Hyperf\Command\Command as BaseCommand;
1615
use Hyperf\Utils\Filesystem\Filesystem;
1716
use Psr\Container\ContainerInterface;
1817
use Symfony\Component\Finder\Finder;
1918

20-
#[Command]
2119
class SyncMigrationCommand extends BaseCommand
2220
{
2321
public function __construct(private ContainerInterface $container)

src/Command/WeChatCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
*/
1212
namespace KY\WorkWxUser\Command;
1313

14-
use Hyperf\Command\Annotation\Command;
1514
use Hyperf\Command\Command as HyperfCommand;
1615
use KY\WorkWxUser\UserService;
1716
use KY\WorkWxUser\WeChat\DepartmentWeChat;
1817
use KY\WorkWxUser\WeChat\UserWeChat;
1918
use Psr\Container\ContainerInterface;
2019

21-
#[Command]
2220
class WeChatCommand extends HyperfCommand
2321
{
2422
public function __construct(protected ContainerInterface $container)

src/ConfigProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
1212
namespace KY\WorkWxUser;
1313

1414
use EasyWeChat\Work\Application;
15+
use KY\WorkWxUser\Command\SyncMigrationCommand;
16+
use KY\WorkWxUser\Command\WeChatCommand;
1517
use KY\WorkWxUser\WeChat\WeChatFactory;
1618

1719
class ConfigProvider
1820
{
1921
public function __invoke(): array
2022
{
2123
return [
24+
'commands' => [
25+
SyncMigrationCommand::class,
26+
WeChatCommand::class,
27+
],
2228
'dependencies' => [
2329
Application::class => WeChatFactory::class,
2430
],

0 commit comments

Comments
 (0)