mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 16:45:35 +08:00
add level for Init
This commit is contained in:
@@ -8,6 +8,7 @@ use Attribute;
|
|||||||
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
|
||||||
use Doctrine\Common\Annotations\Annotation\Target;
|
use Doctrine\Common\Annotations\Annotation\Target;
|
||||||
use ZM\Annotation\AnnotationBase;
|
use ZM\Annotation\AnnotationBase;
|
||||||
|
use ZM\Annotation\Interfaces\Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Init
|
* Class Init
|
||||||
@@ -17,9 +18,19 @@ use ZM\Annotation\AnnotationBase;
|
|||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
*/
|
*/
|
||||||
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)]
|
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)]
|
||||||
class Init extends AnnotationBase
|
class Init extends AnnotationBase implements Level
|
||||||
{
|
{
|
||||||
public function __construct(public int $worker = 0)
|
public function __construct(public int $worker = 0, public int $level = 20)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getLevel()
|
||||||
|
{
|
||||||
|
return $this->level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLevel($level)
|
||||||
|
{
|
||||||
|
$this->level = $level;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user