48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Amqp\Producer\AmqpDelayDirectProducer;
|
|
use App\Constants\HttpEnumCode;
|
|
use App\Request\OrderInquiryRequest;
|
|
use App\Request\UserPatientRequest;
|
|
use App\Services\OrderInquiryService;
|
|
use Hyperf\Amqp\Producer;
|
|
use Hyperf\Di\Annotation\Inject;
|
|
use Hyperf\Utils\ApplicationContext;
|
|
use Hyperf\Validation\Contract\ValidatorFactoryInterface;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
/**
|
|
* 问诊订单
|
|
*/
|
|
class OrderInquiryController extends AbstractController
|
|
{
|
|
/**
|
|
* 创建问诊订单
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function addInquiryOrder(): ResponseInterface
|
|
{
|
|
// $message = new AmqpDelayDirectProducer(10000);
|
|
// $message->setDelayMs(10000);
|
|
// $producer = ApplicationContext::getContainer()->get(Producer::class);
|
|
// $producer->produce($message);
|
|
//
|
|
// $message = new AmqpDelayDirectProducer(5000);
|
|
// $message->setDelayMs(5000);
|
|
// $producer = ApplicationContext::getContainer()->get(Producer::class);
|
|
// $producer->produce($message);
|
|
|
|
$request = $this->container->get(OrderInquiryRequest::class);
|
|
$request->scene('addInquiryOrder')->validateResolved();
|
|
|
|
$OrderInquiryService = new OrderInquiryService();
|
|
$data = $OrderInquiryService->addInquiryOrder();
|
|
return $this->response->json($data);
|
|
}
|
|
} |