|
|
|
@ -13,9 +13,18 @@ namespace App\Controller; |
|
|
|
|
|
|
|
use Hyperf\HttpServer\Contract\ResponseInterface; |
|
|
|
use Psr\Http\Message\ResponseInterface as Psr7ResponseInterface; |
|
|
|
use Hyperf\HttpMessage\Stream\SwooleStream; |
|
|
|
|
|
|
|
class BaseController extends AbstractController |
|
|
|
{ |
|
|
|
|
|
|
|
public function w7result($statusCode,$data = ''){ |
|
|
|
return $this->response |
|
|
|
->withHeader('Content-Type', 'application/text') |
|
|
|
->withStatus($statusCode) |
|
|
|
->withBody(new SwooleStream($data)); |
|
|
|
} |
|
|
|
|
|
|
|
public function result($code, $data, $message = '成功'):Psr7ResponseInterface |
|
|
|
{ |
|
|
|
$status = 'ok'; |
|
|
|
|