mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-08 09:15:37 +08:00
53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace ZM\Annotation\CQ;
|
|
|
|
use Attribute;
|
|
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
|
use Doctrine\Common\Annotations\Annotation\Required;
|
|
use Doctrine\Common\Annotations\Annotation\Target;
|
|
use ZM\Annotation\AnnotationBase;
|
|
use ZM\Annotation\Interfaces\Level;
|
|
|
|
/**
|
|
* Class CQBefore
|
|
* @Annotation
|
|
* @NamedArgumentConstructor()
|
|
* @Target("METHOD")
|
|
*/
|
|
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)]
|
|
class CQBefore extends AnnotationBase implements Level
|
|
{
|
|
/**
|
|
* @var string
|
|
* @Required()
|
|
*/
|
|
public $cq_event;
|
|
|
|
public $level = 20;
|
|
|
|
public function __construct($cq_event, $level = 20)
|
|
{
|
|
$this->cq_event = $cq_event;
|
|
$this->level = $level;
|
|
}
|
|
|
|
/**
|
|
* @return int 返回等级
|
|
*/
|
|
public function getLevel(): int
|
|
{
|
|
return $this->level;
|
|
}
|
|
|
|
/**
|
|
* @param mixed $level
|
|
*/
|
|
public function setLevel($level)
|
|
{
|
|
$this->level = $level;
|
|
}
|
|
}
|