Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
5217c189
Commit
5217c189
authored
Sep 18, 2018
by
feixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限注解
parent
b6d854aa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
32 deletions
+7
-32
src/Common/Bean/Annotation/Auth.php
+3
-21
src/Common/Bean/Collector/AuthCollector.php
+0
-3
src/Common/Bean/Parser/AuthParser.php
+0
-7
src/Common/Entity/Query.php
+4
-1
No files found.
src/Common/Bean/Annotation/Auth.php
View file @
5217c189
...
...
@@ -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
()
...
...
src/Common/Bean/Collector/AuthCollector.php
View file @
5217c189
...
...
@@ -33,9 +33,6 @@ class AuthCollector implements CollectorInterface
self
::
$auth
[
$className
][
'methods'
][
$methodName
][
'scope'
]
=
$scope
;
self
::
$auth
[
$className
][
'methods'
][
$methodName
][
'option'
]
=
$option
;
}
}
}
...
...
src/Common/Bean/Parser/AuthParser.php
View file @
5217c189
...
...
@@ -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
src/Common/Entity/Query.php
View file @
5217c189
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment