-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIndexController.php
62 lines (51 loc) · 1.22 KB
/
IndexController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://doc.hyperf.io
* @contact [email protected]
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
*/
namespace App\Controller;
use App\App as GoTask;
use App\PHPTask;
use Hyperf\HttpServer\Annotation\AutoController;
/**
* Class IndexController.
* @AutoController
*/
class IndexController extends AbstractController
{
public function phpHi(PHPTask $task)
{
return $task->hi('Reasno');
}
public function goHi(GoTask $task)
{
return $task->hi('Reasno');
}
public function phpInsert(PHPTask $task)
{
return $task->insert(['random' => rand(1, 10000)]);
}
public function goInsert(GoTask $task)
{
return $task->insert(json_encode(['random' => rand(1, 10000)]));
}
public function phpFib(PHPTask $task)
{
return $task->fib(20);
}
public function goFib(GoTask $task)
{
return $task->fib(20);
}
public function phpBlocking(PHPTask $task){
return $task->blocking();
}
public function goBlocking(GoTask $task){
return $task->blocking( null);
}
}