Commit 5217c189 by feixiang

权限注解

parent b6d854aa
......@@ -11,26 +11,18 @@ use Doctrine\Common\Annotations\Annotation\Target;
/**
* @Annotation
* @Target("ALL")
* @Target({"ALL"})
* Class Auth
* @package App\Bean\Annotation
*/
class Auth
{
private $name='';
private $scope=0;
private $option='==';
public function __construct(array $values)
{
if (isset($values['value'])) {
$this->name = $values['value'];
}
if (isset($values['name'])) {
$this->name = $values['name'];
}
if (isset($values['scope'])) {
$this->scope = $values['scope'];
......@@ -41,25 +33,15 @@ class Auth
}
}
public function setName($name)
{
$this->name = $name;
}
public function setScope($scope)
{
$this->scope = $scope;
return $this->scope = $scope;
}
public function setOption($option)
{
$this->option = $option;
}
public function getName() : string
{
return $this->name;
return $this->option = $option;
}
public function getScope()
......
......@@ -33,9 +33,6 @@ class AuthCollector implements CollectorInterface
self::$auth[$className]['methods'][$methodName]['scope'] = $scope;
self::$auth[$className]['methods'][$methodName]['option'] = $option;
}
}
}
......
......@@ -24,13 +24,7 @@ class AuthParser extends AbstractParser
string $methodName = '',
$propertyValue = null)
{
$beanName = $className;
$scope = Scope::SINGLETON;
AuthCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue);
return [$beanName, $scope, ""];
}
}
\ No newline at end of file
......@@ -52,9 +52,12 @@ class Query
$query->selectInstance($entityCollector[$className]['instance']);
} elseif ( isset($map[$tableName]) ) { //非实体
} elseif ( isset($map[$tableName]) ) { //非实体且分表
$className = $map[$tableName];
$defaultTbleName = $tableName;
$tableName = $tableName.'_'.self::getDbNum($className);
//设置分表对应的className
EntityCollector::setCollector($tableName, $defaultTbleName);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment