hyperf-chat/app/Controller/IndexController.php

35 lines
770 B
PHP
Raw Normal View History

2020-11-02 22:45:37 +08:00
<?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 Hyperf\HttpServer\Contract\ResponseInterface;
2020-11-03 14:07:54 +08:00
2020-11-02 22:45:37 +08:00
class IndexController extends AbstractController
{
public function index(ResponseInterface $response)
{
$user = $this->request->input('user', 'Hyperf');
$method = $this->request->getMethod();
return [
'method' => $method,
2020-11-03 14:07:54 +08:00
'message' => "Hello {$user}."
2020-11-02 22:45:37 +08:00
];
}
2020-11-03 17:12:57 +08:00
public function upload(ResponseInterface $response){
return [
'method' => 'upload',
];
}
2020-11-02 22:45:37 +08:00
}