You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/app/Controller/Payment/AbstractController.php

39 lines
807 B
PHP

<?php
declare(strict_types=1);
namespace App\Controller\Payment;
use App\Constants\ResultCode;
use App\Helper\Result;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;
use Psr\Container\ContainerInterface;
abstract class AbstractController
{
/**
* @Inject
* @var ContainerInterface
*/
protected ContainerInterface $container;
/**
* @Inject
* @var RequestInterface
*/
protected RequestInterface $request;
/**
* @Inject
* @var ResponseInterface
*/
protected ResponseInterface $response;
protected function success(array $data = [], string $message = '成功'): Result
{
return new Result(ResultCode::SUCCESS, $message, $data);
}
}