Commit 5217c189 by feixiang

权限注解

parent b6d854aa
...@@ -11,26 +11,18 @@ use Doctrine\Common\Annotations\Annotation\Target; ...@@ -11,26 +11,18 @@ use Doctrine\Common\Annotations\Annotation\Target;
/** /**
* @Annotation * @Annotation
* @Target("ALL") * @Target({"ALL"})
* Class Auth * Class Auth
* @package App\Bean\Annotation * @package App\Bean\Annotation
*/ */
class Auth class Auth
{ {
private $name='';
private $scope=0; private $scope=0;
private $option='=='; private $option='==';
public function __construct(array $values) 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'])) { if (isset($values['scope'])) {
$this->scope = $values['scope']; $this->scope = $values['scope'];
...@@ -41,25 +33,15 @@ class Auth ...@@ -41,25 +33,15 @@ class Auth
} }
} }
public function setName($name)
{
$this->name = $name;
}
public function setScope($scope) public function setScope($scope)
{ {
$this->scope = $scope; return $this->scope = $scope;
} }
public function setOption($option) public function setOption($option)
{ {
$this->option = $option; return $this->option = $option;
}
public function getName() : string
{
return $this->name;
} }
public function getScope() public function getScope()
......
...@@ -33,9 +33,6 @@ class AuthCollector implements CollectorInterface ...@@ -33,9 +33,6 @@ class AuthCollector implements CollectorInterface
self::$auth[$className]['methods'][$methodName]['scope'] = $scope; self::$auth[$className]['methods'][$methodName]['scope'] = $scope;
self::$auth[$className]['methods'][$methodName]['option'] = $option; self::$auth[$className]['methods'][$methodName]['option'] = $option;
} }
} }
} }
......
...@@ -24,13 +24,7 @@ class AuthParser extends AbstractParser ...@@ -24,13 +24,7 @@ class AuthParser extends AbstractParser
string $methodName = '', string $methodName = '',
$propertyValue = null) $propertyValue = null)
{ {
$beanName = $className;
$scope = Scope::SINGLETON;
AuthCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue); AuthCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue);
return [$beanName, $scope, ""];
} }
} }
\ No newline at end of file
...@@ -52,9 +52,12 @@ class Query ...@@ -52,9 +52,12 @@ class Query
$query->selectInstance($entityCollector[$className]['instance']); $query->selectInstance($entityCollector[$className]['instance']);
} elseif ( isset($map[$tableName]) ) { //非实体 } elseif ( isset($map[$tableName]) ) { //非实体且分表
$className = $map[$tableName]; $className = $map[$tableName];
$defaultTbleName = $tableName;
$tableName = $tableName.'_'.self::getDbNum($className); $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