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
0242d795
Commit
0242d795
authored
Apr 16, 2019
by
zhangsong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流量统计中添加访客统计
parent
5a736b65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
207 additions
and
0 deletions
+207
-0
src/Common/Pool/Config/FlowCountPoolConfig.php
+110
-0
src/FlowCount/Lib/VisitorInterface.php
+97
-0
No files found.
src/Common/Pool/Config/FlowCountPoolConfig.php
0 → 100644
View file @
0242d795
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace
Hdll\Services\Common\Pool\Config
;
use
Swoft\Bean\Annotation\Bean
;
use
Swoft\Pool\PoolProperties
;
/**
* the config of service user
*
* @Bean()
*/
class
SellerPoolConfig
extends
PoolProperties
{
public
function
__construct
()
{
// 区别本地和线上的RPC服务地址
$this
->
uri
=
explode
(
','
,
env
(
'RPC_SELLER_URI'
,
'seller:8099'
));
}
protected
$name
=
'seller'
;
/**
* Minimum active number of connections
*
* @var int
*/
protected
$minActive
=
5
;
/**
* the maximum number of active connections
*
* @var int
*/
protected
$maxActive
=
400
;
/**
* the maximum number of wait connections
*
* @var int
*/
protected
$maxWait
=
500
;
/**
* Maximum waiting time
*
* @var int
*/
protected
$maxWaitTime
=
3
;
/**
* Maximum idle time
*
* @var int
*/
protected
$maxIdleTime
=
60
;
/**
* the time of connect timeout
*
* @var int
*/
protected
$timeout
=
200
;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
* @var array
*/
protected
$uri
=
[
'192.168.3.39:8099'
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
* @var bool
*/
protected
$useProvider
=
false
;
/**
* the default balancer is random balancer
*
* @var string
*/
protected
$balancer
=
''
;
/**
* the default provider is consul provider
*
* @var string
*/
protected
$provider
=
''
;
}
src/FlowCount/Lib/VisitorInterface.php
0 → 100644
View file @
0242d795
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/27
* Time: 16:28
*/
namespace
Hdll\Services\Seller\Lib
;
use
Swoft\Core\ResultInterface
;
/**
* @method ResultInterface deferSave($referId, $unionId, $openId, $nickName, $headImgUrl)
* @method ResultInterface deferGet($id, $fields = ['*'])
* @method ResultInterface deferGetByUnionId($unionId, $fields = ['*'])
* @method ResultInterface deferGetByStoreId($storeId, $fields = ['*'])
* @method ResultInterface deferUpdate($id, $data)
* @method ResultInterface deferCountDistributionNum($sellerId)
* @method ResultInterface deferGetByIds(array $ids, $fields = ['*'])
* @method ResultInterface deferGetAndUpdateOpenId($unionId, $openId)
* @method ResultInterface deferSaveRelation($sellerId)
* @method ResultInterface deferUpdateRelationVip($sellerId, $isVip)
* @method ResultInterface deferCountVip($sellerId, $isVip)
* Interface SellerInterface
* @package App\Lib
*/
interface
VisitorInterface
{
/**
* @param $referId
* @param $unionId
* @param $openId
* @param $nickName
* @param $headImgUrl
* @param string $realName
* @param string $phoneNumber
* @return mixed
* @author Administrator
*/
public
function
save
(
$referId
,
$unionId
,
$openId
,
$nickName
,
$headImgUrl
);
/**
* @param $id
* @param array $fields
* @return mixed
* @author Administrator
*/
public
function
get
(
$id
,
$fields
=
[
'*'
]);
/**
* @param $unionId
* @param array $fields
* @return mixed
* @author Administrator
*/
public
function
getByUnionId
(
$unionId
,
$fields
=
[
'*'
]);
/**
* @param $condition
* @param $data
* $data['referId']=>'来源ID'
* $data['unionId']=>'unionId'
* $data['openId']=>'openId'
* $data['nickName']=>'昵称'
* $data['headImgUrl']=>'头像URL'
* $data['realName']=>'真实姓名'
* $data['phoneNumber']=>'手机号'
* @return mixed
* @author Administrator
*/
public
function
update
(
$condition
,
$data
);
/**
* @param $storeId
* @param array $fields
* @return mixed
* @author Administrator
*/
public
function
getByStoreId
(
$storeId
,
$fields
=
[
'*'
]);
public
function
countDistributionNum
(
$sellerId
);
public
function
getByIds
(
array
$ids
,
$fields
=
[
'*'
]);
public
function
getAndUpdateOpenId
(
$unionId
,
$openId
);
public
function
saveRelation
(
$sellerId
);
public
function
updateRelationVip
(
$sellerId
,
$isVip
);
public
function
countVip
(
$sellerId
);
}
\ 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