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
1c3e1c9e
Commit
1c3e1c9e
authored
Jul 16, 2018
by
王召彬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.0x00day.com:10080/hdll/hdll-services
parents
ab76cf57
483776c9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
28 deletions
+53
-28
src/Common/Config/Bean/PathConfig.php
+22
-0
src/Common/Config/Bean/ScanPath.php
+11
-12
src/Common/Entity/User.php
+20
-16
No files found.
src/Common/Config/Bean/PathConfig.php
0 → 100644
View file @
1c3e1c9e
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/16
* Time: 11:09
*/
$basePath
=
dirname
(
__DIR__
,
3
);
/**
* 用于自建组件扫描路径配置(键值是方便开发人员理解,代码中无意义)
* [
* 'commonPath' => $basePath.'/Common',
* 'orderEnum' => $basePath.'/Order/Enum',
*
* ];
*/
return
[
'commonPath'
=>
$basePath
.
'/Common'
,
];
\ No newline at end of file
src/Common/Config/Bean/ScanPath.php
View file @
1c3e1c9e
...
...
@@ -5,19 +5,19 @@
* Date: 2018/7/16
* Time: 9:32
*/
$
basePath
=
dirname
(
__DIR__
,
3
)
;
$
scanPaths
=
include
__DIR__
.
'/PathConfig.php'
;
$data
=
[];
$files
=
\Swoft\Helper\DirHelper
::
glob
(
$basePath
,
'*.php'
);
foreach
(
$scanPaths
as
$basePath
)
{
$files
=
\Swoft\Helper\DirHelper
::
glob
(
$basePath
,
'*.php'
);
$baseNamespace
=
"Hdll\Services
\\
"
;
$baseNamespace
=
"Hdll\Services"
;
$data
=
[];
foreach
(
$files
as
$file
)
{
$path
=
dirname
(
$file
);
$suffixNamespace
=
str_replace
(
$basePath
,
""
,
$path
);
$suffixNamespace
=
str_replace
(
"/"
,
"
\\
"
,
$suffixNamespace
);
foreach
(
$files
as
$file
)
{
$pathSpace
=
str_replace
(
"/var/www/swoft/vendor/hdll/services/src/"
,
""
,
$file
);
$pathSpace
=
dirname
(
$pathSpace
);
$pathSpace
=
str_replace
(
"/"
,
"
\\
"
,
$pathSpace
);
$namespace
=
$baseNamespace
.
$suffixNames
pace
;
$namespace
=
$baseNamespace
.
$pathS
pace
;
$fileName
=
basename
(
$file
,
'.php'
);
...
...
@@ -43,8 +43,7 @@ foreach ( $files as $file ) {
}
}
}
...
...
src/Common/Entity/User.php
View file @
1c3e1c9e
...
...
@@ -11,13 +11,6 @@
namespace
Hdll\Services\Common\Entity
;
use
Swoft\Bean\Annotation\Bean
;
use
Swoft\Db\Bean\Annotation\Id
;
use
Swoft\Db\Bean\Annotation\Required
;
use
Swoft\Db\Bean\Annotation\Table
;
use
Swoft\Db\Bean\Annotation\Column
;
use
Swoft\Db\Bean\Annotation\Entity
;
use
Swoft\Db\Model
;
use
Swoft\Db\Types
;
/**
* 用户实体
...
...
@@ -32,14 +25,16 @@ class User
{
private
$id
;
private
$nick
_n
ame
;
private
$nick
N
ame
;
private
$store
_i
d
;
private
$store
I
d
;
private
$head
_i
mg
;
private
$head
I
mg
;
private
$token
;
private
$cmId
;
public
function
__construct
(
$token
=
''
)
...
...
@@ -59,17 +54,17 @@ class User
public
function
getNickName
()
{
return
$this
->
nick
_n
ame
;
return
$this
->
nick
N
ame
;
}
public
function
getStoreId
()
{
return
$this
->
store
_i
d
;
return
$this
->
store
I
d
;
}
public
function
getHeadImg
()
{
return
$this
->
head
_i
mg
;
return
$this
->
head
I
mg
;
}
public
function
getToken
()
...
...
@@ -84,17 +79,17 @@ class User
public
function
setNickName
(
$value
)
{
return
$this
->
nick
_n
ame
=
$value
;
return
$this
->
nick
N
ame
=
$value
;
}
public
function
setStoreId
(
$value
)
{
return
$this
->
store
_i
d
=
$value
;
return
$this
->
store
I
d
=
$value
;
}
public
function
setHeadImg
(
$value
)
{
return
$this
->
head
_i
mg
=
$value
;
return
$this
->
head
I
mg
=
$value
;
}
public
function
setToken
(
$value
)
...
...
@@ -102,5 +97,14 @@ class User
return
$this
->
token
=
$value
;
}
public
function
setCmId
(
$value
)
{
$this
->
cmId
=
$value
;
}
public
function
getCmId
()
{
return
$this
->
cmId
;
}
}
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