| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- declare(strict_types=1);
- /**
- * This file is part of Hyperf.
- *
- * @link https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact group@hyperf.io
- * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
- */
- namespace App\Controller;
- use App\Crontab\SckwChgrobotCrontab;
- use Hyperf\Di\Annotation\Inject;
- class IndexController extends AbstractController
- {
- #[Inject]
- public SckwChgrobotCrontab $sckwChgrobotCrontab;
- public function index()
- {
- $user = $this->request->input('user', 'Hyperf');
- $method = $this->request->getMethod();
- return [
- 'method' => $method,
- 'message' => "Hello {$user}.",
- ];
- }
- public function test()
- {
- $this->sckwChgrobotCrontab->execute();
- }
- }
|