<?php

declare(strict_types=1);

namespace App\Amqp\Consumer;

use App\JsonRpc\CollectorService;
use Hyperf\Amqp\Result;
use Hyperf\Amqp\Annotation\Consumer;
use Hyperf\Amqp\Message\ConsumerMessage;
use PhpAmqpLib\Message\AMQPMessage;

#[Consumer(exchange: 'import', routingKey: 'import', queue: 'import', name: "ImportConsumer", nums: 1, enable: true)]
class ImportConsumer extends ConsumerMessage
{
    public function consumeMessage($data, AMQPMessage $message): Result
    {

        $collector = new CollectorService();
        var_dump('文章---------------------',$data);
        $result = $collector->goAddArt($data);
        

        return Result::ACK;
    }
    public function isEnable(): bool
    {
        return parent::isEnable();
    }
}
