浏览代码

暗号化コマンドを追加

develop
sosuke.iwabuchi 3 个月前
父节点
当前提交
0148147fc0
共有 1 个文件被更改,包括 63 次插入0 次删除
  1. +63
    -0
      app/Console/Commands/QRCode/サービス券暗号化.php

+ 63
- 0
app/Console/Commands/QRCode/サービス券暗号化.php 查看文件

@@ -0,0 +1,63 @@
<?php

namespace App\Console\Commands\QRCode;

use App\Console\Commands\BaseCommand;
use App\Logics\QRService\QRCryptoLogic;

class サービス券暗号化 extends BaseCommand
{

const COMMAND = "qrcode:encrypto {input}";


/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = self::COMMAND;

/**
* The console command description.
*
* @var string
*/
protected $description = 'QRサービス券を暗号化する。';

static public function getCommand()
{
return self::COMMAND;
}



/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return int
*/
public function service(): int
{
$input = $this->argument("input");
if (!$input) {
$this->outputError("入力エラー");
return self::RESULTCODE_FAILED;
}

$result = QRCryptoLogic::encrypt($input);
$this->outputInfo(sprintf("暗号化:[%s]->[%s]", $input, $result));

return self::RESULTCODE_SUCCESS;
}
}

正在加载...
取消
保存