Commit c9454cdf authored by 王源's avatar 王源
Browse files

Merge branch 'hotfix' into test

parents 80a40f66 7479eeb3
Loading
Loading
Loading
Loading

publish/message.php

deleted100644 → 0
+0 −12
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

return [
    'center' => [
        'ip' => env('MESSAGE_CENTER_IP', '127.0.0.1'),
        'domain' => env('MESSAGE_CENTER_DOMAIN', 'http://localhost'),
        'proxy' => env('MESSAGE_CENTER_PROXY'),
        'proxy_port' => env('MESSAGE_CENTER_PROXY_PORT', 80),
    ]
];
+77 −135

File changed.

Preview size limit exceeded, changes collapsed.

src/Command/RepositoryCommand.php

deleted100644 → 0
+0 −48
Original line number Diff line number Diff line
<?php

/**
 * Created by PhpStorm.
 * User: zero
 * Date: 2020/2/11
 * Time: 11:59
 */

namespace Meibuyu\Micro\Command;

use Hyperf\Command\Annotation\Command;
use Hyperf\Command\Command as HyperfCommand;
use Meibuyu\Micro\Generator\FileAlreadyExistsException;
use Meibuyu\Micro\Generator\RepositoryEloquentGenerator;
use Symfony\Component\Console\Input\InputArgument;

/**
 * @Command()
 */
class RepositoryCommand extends HyperfCommand
{

    protected $name = 'gen:repository';

    /**
     * Handle the current command.
     */
    public function handle()
    {
        try {
            $name = $this->input->getArgument('name');
            $createValidator = $this->output->confirm('同时创建验证器?', true);
            (new RepositoryEloquentGenerator([
                'name' => $name,
                'validator' => $createValidator,
            ]))->run();
            $this->info("Repository created successfully.");
        } catch (FileAlreadyExistsException $e) {
            $this->error($e->getMessage() . ' already exists!');
        }
    }

    public function getArguments()
    {
        return [['name', InputArgument::REQUIRED, '名称']];
    }
}
 No newline at end of file

src/Command/ValidatorCommand.php

deleted100644 → 0
+0 −45
Original line number Diff line number Diff line
<?php

/**
 * Created by PhpStorm.
 * User: wangy
 * Date: 2020/2/12
 * Time: 10:49
 */

namespace Meibuyu\Micro\Command;

use Hyperf\Command\Annotation\Command;
use Hyperf\Command\Command as HyperfCommand;
use Meibuyu\Micro\Generator\FileAlreadyExistsException;
use Meibuyu\Micro\Generator\ValidatorGenerator;
use Symfony\Component\Console\Input\InputArgument;

/**
 * @Command()
 */
class ValidatorCommand extends HyperfCommand
{

    protected $name = 'gen:validator';

    /**
     * Handle the current command.
     */
    public function handle()
    {
        try {
            $name = $this->input->getArgument('name');
            (new ValidatorGenerator(['name' => $name]))->run();
            $this->info("Validator created successfully.");
        } catch (FileAlreadyExistsException $e) {
            $this->error($e->getMessage() . ' already exists!');
        }
    }

    public function getArguments()
    {
        return [['name', InputArgument::REQUIRED, '名称']];
    }

}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ use Meibuyu\Micro\Annotation\Perm;
 */
class %ModelClass%Controller extends AbstractController
{

    /**
     * @Inject()
     * @var %ModelClass%Repository
Loading