feat : admin user finish

This commit is contained in:
2025-09-14 22:33:32 +08:00
parent cf5d5059d7
commit 1d01ecfdcb
10 changed files with 339 additions and 19 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace App\Annotation;
use Attribute;
use Hyperf\Di\Annotation\AbstractAnnotation;
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
class Permission extends AbstractAnnotation
{
public const string OPERATION_AND = 'and';
public const string OPERATION_OR = 'or';
/**
* @param array|string $code
* @param string $operation
*/
public function __construct(
protected array|string $code,
protected string $operation = self::OPERATION_AND
) {}
/**
* @return array
*/
public function getCode(): array
{
return (array) $this->code;
}
/**
* @return string
*/
public function getOperation(): string
{
return $this->operation;
}
}