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
dc8b932f
Commit
dc8b932f
authored
Jan 21, 2019
by
feixiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.dev.2b3.cn/tencent/services
parents
1b0f52b7
5402d3fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
4 deletions
+82
-4
UPGRADE.md
+6
-1
src/Common/Config/log-php.prod
+41
-0
src/Common/Entity/CommonEntity.php
+30
-0
src/Vip/Lib/VipInterface.php
+5
-3
No files found.
UPGRADE.md
View file @
dc8b932f
# 1.0.56
-
添加腾讯云日志公共配置文件
# 1.0.55
-
重写Model里的toArray()
# 1.0.54
-
添加续费vip的RPC接口
# 1.0.53
-
vip试用类型
# 1.0.52
...
...
src/Common/Config/log-php.prod
0 → 100644
View file @
dc8b932f
<?php
/*
* This file is part of Swoft.
* (c) Swoft <group@swoft.org>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'clsErrorLogHandler' => [
'class' => \Hdll\Services\Common\ClsLogger\LogHandler::class,
'topicId' => \Hdll\Services\Common\ClsLogger\ClsLog::TOPICID_ERROR,
'formatter' => '${lineFormatter}',
'levels' => [
\Swoft\Log\Logger::ERROR,
\Swoft\Log\Logger::WARNING,
\Swoft\Log\Logger::CRITICAL,
],
],
'clsNoticeLogHandler' => [
'class' => \Hdll\Services\Common\ClsLogger\LogHandler::class,
'topicId' => \Hdll\Services\Common\ClsLogger\ClsLog::TOPICID_NOTICE,
'formatter' => '${lineFormatter}',
'levels' => [
\Swoft\Log\Logger::NOTICE,
\Swoft\Log\Logger::INFO,
\Swoft\Log\Logger::DEBUG,
\Swoft\Log\Logger::TRACE,
],
],
'logger' => [
'name' => APP_NAME,
'enable' => true,
'flushInterval' => 100,
'flushRequest' => true,
'handlers' => [
'${clsErrorLogHandler}',
'${clsNoticeLogHandler}',
],
],
];
src/Common/Entity/CommonEntity.php
View file @
dc8b932f
...
...
@@ -14,6 +14,7 @@ use Swoft\Db\Bean\Collector\EntityCollector;
use
Swoft\Db\Model
;
use
Swoft\Exception\Exception
;
use
Swoole\Http\Request
;
use
Swoft\Helper\StringHelper
;
class
CommonEntity
extends
Model
{
...
...
@@ -183,4 +184,32 @@ class CommonEntity extends Model
preg_match
(
'/(?<=Table\(name=").*(?="\))/'
,
$commentString
,
$matches
);
return
$tableName
=
isset
(
$matches
[
0
])
?
$matches
[
0
]
:
''
;
}
/**
* @return array
*/
public
function
toArray
()
:
array
{
$entities
=
EntityCollector
::
getCollector
();
$columns
=
$entities
[
static
::
class
][
'field'
];
$data
=
[];
foreach
(
$columns
as
$propertyName
=>
$column
)
{
if
(
!
isset
(
$column
[
'column'
]))
{
continue
;
}
$methodName
=
StringHelper
::
camel
(
'get'
.
$propertyName
);
if
(
!
\method_exists
(
$this
,
$methodName
))
{
continue
;
}
$value
=
$this
->
$methodName
();
if
(
$value
===
null
){
continue
;
}
$data
[
$propertyName
]
=
$value
;
}
return
$data
;
}
}
\ No newline at end of file
src/Vip/Lib/VipInterface.php
View file @
dc8b932f
...
...
@@ -11,14 +11,15 @@ namespace Hdll\Services\Vip\Lib;
use
Swoft\Core\ResultInterface
;
/**
* @method ResultInterface deferOpenVip($storeId,$orderId,$money)
* @method ResultInterface deferOpenVip($storeId, $orderId, $money)
* @method ResultInterface deferGetVip($vipId)
* Interface SellerInterface
* @package App\Lib
*/
interface
VipInterface
{
public
function
openVip
(
$storeId
,
$orderId
);
public
function
openVip
(
$storeId
,
$orderId
);
public
function
getVip
(
int
$vipId
);
}
\ No newline at end of file
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