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
2755624a
Commit
2755624a
authored
Feb 25, 2019
by
liwotian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge up
parent
93d398a7
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
383 additions
and
295 deletions
+383
-295
src/Cmq/Topic.php
+272
-248
src/Common/ClsLogger/ClsLog.php
+17
-14
src/Common/Config/CfgCenter.php
+2
-2
src/Common/Config/config.php
+22
-26
src/Common/Lib/Xcrypt.php
+3
-3
src/GroupBooking/Enum/RecordEnum.php
+2
-0
src/Order/Lib/SellerOrderInterface.php
+4
-0
src/Schedule/Lib/ScheduleInterface.php
+10
-0
src/SellerDistribution/Enum/SellerDistributionCmqEnum.php
+2
-0
src/Store/Enum/StoreCmqEnum.php
+11
-0
src/Store/Lib/EntrustedInterface.php
+32
-0
src/Store/Lib/StoreInterface.php
+2
-2
src/Vip/Lib/VipInterface.php
+4
-0
No files found.
src/Cmq/Topic.php
View file @
2755624a
...
@@ -2,245 +2,248 @@
...
@@ -2,245 +2,248 @@
namespace
Hdll\Services\Cmq
;
namespace
Hdll\Services\Cmq
;
use
Hdll\Services\Common\Config\CfgCenter
;
use
Swoft\App
;
use
Swoft\App
;
use
Hdll\Services\Common\Lib\Xcrypt
;
use
Hdll\Services\Common\Lib\Xcrypt
;
class
Topic
class
Topic
{
{
private
$topic_name
;
private
$topic_name
;
private
$cmq_client
;
private
$cmq_client
;
private
$encoding
;
private
$encoding
;
public
function
__construct
(
$topic_name
,
$cmq_client
,
$encoding
=
false
)
public
function
__construct
(
$topic_name
,
$cmq_client
,
$encoding
=
false
)
{
{
$this
->
topic_name
=
$topic_name
;
$this
->
topic_name
=
$topic_name
;
$this
->
cmq_client
=
$cmq_client
;
$this
->
cmq_client
=
$cmq_client
;
$this
->
encoding
=
$encoding
;
$this
->
encoding
=
$encoding
;
}
}
public
function
set_encoding
(
$encoding
)
public
function
set_encoding
(
$encoding
)
{
{
$this
->
encoding
=
$encoding
;
$this
->
encoding
=
$encoding
;
}
}
/*
/*
* create topic
* create topic
* @type topic_meta : TopicMeta
* @type topic_meta : TopicMeta
* @param topic_meta :
* @param topic_meta :
*/
*/
public
function
create
(
$topic_meta
)
public
function
create
(
$topic_meta
)
{
{
$params
=
array
(
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
'topicName'
=>
$this
->
topic_name
,
'filterType'
=>
$topic_meta
->
filterType
,
'filterType'
=>
$topic_meta
->
filterType
,
);
);
if
(
$topic_meta
->
maxMsgSize
>
0
)
{
if
(
$topic_meta
->
maxMsgSize
>
0
)
{
$params
[
'maxMsgSize'
]
=
$topic_meta
->
maxMsgSize
;
$params
[
'maxMsgSize'
]
=
$topic_meta
->
maxMsgSize
;
}
}
$this
->
cmq_client
->
create_topic
(
$params
);
$this
->
cmq_client
->
create_topic
(
$params
);
}
}
/*
* get attributes
/*
*
* get attributes
* @return topic_meta :TopicMeta
*
*
* @return topic_meta :TopicMeta
*/
*
public
function
get_attributes
()
*/
{
public
function
get_attributes
()
$params
=
array
(
{
'topicName'
=>
$this
->
topic_name
,
$params
=
array
(
);
'topicName'
=>
$this
->
topic_name
,
$resp
=
$this
->
cmq_client
->
get_topic_attributes
(
$params
);
);
$resp
=
$this
->
cmq_client
->
get_topic_attributes
(
$params
);
$topic_meta
=
new
TopicMeta
();
$this
->
__resp2meta
(
$topic_meta
,
$resp
);
$topic_meta
=
new
TopicMeta
();
$this
->
__resp2meta
(
$topic_meta
,
$resp
);
return
$topic_meta
;
}
return
$topic_meta
;
}
/*
* set attributes
/*
*
* set attributes
* @type topic_meta :TopicMeta
*
* @param topic_meta :
* @type topic_meta :TopicMeta
*/
* @param topic_meta :
public
function
set_attributes
(
$topic_meta
)
*/
{
public
function
set_attributes
(
$topic_meta
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
$params
=
array
(
'maxMsgSize'
=>
strval
(
$topic_meta
->
maxMsgSize
),
'topicName'
=>
$this
->
topic_name
,
);
'maxMsgSize'
=>
strval
(
$topic_meta
->
maxMsgSize
),
$this
->
cmq_client
->
set_topic_attributes
(
$params
);
);
}
$this
->
cmq_client
->
set_topic_attributes
(
$params
);
}
/*
* delete topic
/*
*/
* delete topic
public
function
delete
()
*/
{
public
function
delete
()
$params
=
array
(
{
'topicName'
=>
$this
->
topic_name
,
$params
=
array
(
);
'topicName'
=>
$this
->
topic_name
,
$this
->
cmq_client
->
delete_topic
(
$params
);
);
}
$this
->
cmq_client
->
delete_topic
(
$params
);
}
/*
* 推送消息 非批量
/*
* @type message :string
* 推送消息 非批量
* @param message
* @type message :string
*
* @param message
* @type vTagList :list
*
* @param vTagList 标签
* @type vTagList :list
*
* @param vTagList 标签
* @return message handle
*
*/
* @return message handle
*/
public
function
publish_message
(
$message
,
$vTagList
=
null
,
$routingKey
=
null
)
{
public
function
publish_message
(
$message
,
$vTagList
=
null
,
$routingKey
=
null
)
$params
=
array
(
{
'topicName'
=>
$this
->
topic_name
,
$params
=
array
(
'msgBody'
=>
$message
,
'topicName'
=>
$this
->
topic_name
,
);
'msgBody'
=>
$message
,
if
(
$routingKey
!=
null
)
{
);
$params
[
'routingKey'
]
=
$routingKey
;
if
(
$routingKey
!=
null
)
{
}
$params
[
'routingKey'
]
=
$routingKey
;
if
(
$vTagList
!=
null
&&
is_array
(
$vTagList
)
&&
!
empty
(
$vTagList
))
{
}
$n
=
1
;
if
(
$vTagList
!=
null
&&
is_array
(
$vTagList
)
&&
!
empty
(
$vTagList
))
{
foreach
(
$vTagList
as
$tag
)
{
$n
=
1
;
$key
=
'msgTag.'
.
$n
;
foreach
(
$vTagList
as
$tag
)
{
$params
[
$key
]
=
$tag
;
$key
=
'msgTag.'
.
$n
;
$n
+=
1
;
$params
[
$key
]
=
$tag
;
}
$n
+=
1
;
}
}
$msgId
=
$this
->
cmq_client
->
publish_message
(
$params
);
}
$msgId
=
$this
->
cmq_client
->
publish_message
(
$params
);
return
$msgId
;
}
return
$msgId
;
}
/*
* 批量推送消息
/*
* @type vmessageList :list
* 批量推送消息
* @param vmessageList:
* @type vmessageList :list
*
* @param vmessageList:
* @type vtagList :list
*
* @param vtagList
* @type vtagList :list
*
* @param vtagList
* @return : return message handle list
*
*/
* @return : return message handle list
*/
public
function
batch_publish_message
(
$vmessageList
,
$vtagList
=
null
,
$routingKey
=
null
)
{
public
function
batch_publish_message
(
$vmessageList
,
$vtagList
=
null
,
$routingKey
=
null
)
$params
=
array
(
{
'topicName'
=>
$this
->
topic_name
,
$params
=
array
(
);
'topicName'
=>
$this
->
topic_name
,
);
if
(
$routingKey
!=
null
)
{
$params
[
'routingKey'
]
=
$routingKey
;
if
(
$routingKey
!=
null
)
{
}
$params
[
'routingKey'
]
=
$routingKey
;
$n
=
1
;
}
if
(
is_array
(
$vmessageList
)
&&
!
empty
(
$vmessageList
))
{
$n
=
1
;
foreach
(
$vmessageList
as
$msg
)
{
if
(
is_array
(
$vmessageList
)
&&
!
empty
(
$vmessageList
))
{
$key
=
'msgBody.'
.
$n
;
foreach
(
$vmessageList
as
$msg
)
{
if
(
$this
->
encoding
)
{
$key
=
'msgBody.'
.
$n
;
$params
[
$key
]
=
base64_encode
(
$msg
);
if
(
$this
->
encoding
)
{
}
else
{
$params
[
$key
]
=
base64_encode
(
$msg
);
$params
[
$key
]
=
$msg
;
}
else
{
}
$params
[
$key
]
=
$msg
;
$n
+=
1
;
}
}
$n
+=
1
;
}
}
if
(
$vtagList
!=
null
&&
is_array
(
$vtagList
)
&&
!
empty
(
$vtagList
))
{
}
$n
=
1
;
if
(
$vtagList
!=
null
&&
is_array
(
$vtagList
)
&&
!
empty
(
$vtagList
))
{
foreach
(
$vtagList
as
$tag
)
{
$n
=
1
;
$key
=
'msgTag.'
.
$n
;
foreach
(
$vtagList
as
$tag
)
{
$params
[
$key
]
=
$tag
;
$key
=
'msgTag.'
.
$n
;
$n
+=
1
;
$params
[
$key
]
=
$tag
;
}
$n
+=
1
;
}
}
}
$msgList
=
$this
->
cmq_client
->
batch_publish_message
(
$params
);
$msgList
=
$this
->
cmq_client
->
batch_publish_message
(
$params
);
$retMessageList
=
array
();
foreach
(
$msgList
as
$msg
)
{
$retMessageList
=
array
();
if
(
isset
(
$msg
[
'msgId'
]))
{
foreach
(
$msgList
as
$msg
)
{
$retmsgId
=
$msg
[
'msgId'
];
if
(
isset
(
$msg
[
'msgId'
]))
{
$retMessageList
[]
=
$retmsgId
;
$retmsgId
=
$msg
[
'msgId'
];
}
$retMessageList
[]
=
$retmsgId
;
}
}
return
$retMessageList
;
}
return
$retMessageList
;
}
/* 列出Topic的Subscriptoin
}
@type topic_name :string
/* 列出Topic的Subscriptoin
@param topic_name:
@type topic_name :string
@type searchWord: string
@param topic_name:
@param searchWord: 订阅关键字
@type searchWord: string
@type limit: int
@param searchWord: 订阅关键字
@param limit: 最多返回的订阅数目
@type limit: int
@type offset: string
@param limit: 最多返回的订阅数目
@param offset: list_subscription的起始位置,上次list_subscription返回的next_offset
@type offset: string
@rtype: tuple
@param offset: list_subscription的起始位置,上次list_subscription返回的next_offset
@return: subscriptionURL的列表和下次list subscription的起始位置; 如果所有subscription都list出来,next_offset为"".
*/
@rtype: tuple
public
function
list_subscription
(
$searchWord
=
""
,
$limit
=
-
1
,
$offset
=
""
)
@return: subscriptionURL的列表和下次list subscription的起始位置; 如果所有subscription都list出来,next_offset为"".
{
*/
$params
=
array
(
'topicName'
=>
$this
->
topic_name
);
public
function
list_subscription
(
$searchWord
=
""
,
$limit
=
-
1
,
$offset
=
""
)
{
if
(
$searchWord
!=
""
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
);
$params
[
'searchWord'
]
=
$searchWord
;
}
if
(
$searchWord
!=
""
)
{
$params
[
'searchWord'
]
=
$searchWord
;
if
(
$limit
!=
-
1
)
{
}
$params
[
'limit'
]
=
$limit
;
}
if
(
$limit
!=
-
1
)
{
$params
[
'limit'
]
=
$limit
;
if
(
$offset
!=
""
)
{
}
$params
[
'offset'
]
=
$offset
;
}
if
(
$offset
!=
""
)
{
$params
[
'offset'
]
=
$offset
;
$resp
=
$this
->
cmq_client
->
list_subscription
(
$params
);
}
if
(
$offset
==
""
)
{
$resp
=
$this
->
cmq_client
->
list_subscription
(
$params
);
$next_offset
=
count
(
$resp
[
'subscriptionList'
]);
}
else
{
if
(
$offset
==
""
)
{
$next_offset
=
$offset
+
count
(
$resp
[
'subscriptionList'
]);
$next_offset
=
count
(
$resp
[
'subscriptionList'
]);
}
}
else
{
$next_offset
=
$offset
+
count
(
$resp
[
'subscriptionList'
]);
if
(
$next_offset
>=
$resp
[
'totalCount'
])
{
}
$next_offset
=
""
;
}
if
(
$next_offset
>=
$resp
[
'totalCount'
])
{
$next_offset
=
""
;
return
array
(
"totalCoult"
=>
$resp
[
'totalCount'
],
}
"subscriptionList"
=>
$resp
[
'subscriptionList'
],
"next_offset"
=>
$next_offset
);
return
array
(
"totalCoult"
=>
$resp
[
'totalCount'
],
}
"subscriptionList"
=>
$resp
[
'subscriptionList'
],
"next_offset"
=>
$next_offset
);
protected
function
__resp2meta
(
$topic_meta
,
$resp
)
}
{
if
(
isset
(
$resp
[
'maxMsgSize'
]))
{
protected
function
__resp2meta
(
$topic_meta
,
$resp
)
$topic_meta
->
maxMsgSize
=
$resp
[
'maxMsgSize'
];
{
}
if
(
isset
(
$resp
[
'maxMsgSize'
]))
{
if
(
isset
(
$resp
[
'msgRetentionSeconds'
]))
{
$topic_meta
->
maxMsgSize
=
$resp
[
'maxMsgSize'
];
$topic_meta
->
msgRetentionSeconds
=
$resp
[
'msgRetentionSeconds'
];
}
}
if
(
isset
(
$resp
[
'msgRetentionSeconds'
]))
{
if
(
isset
(
$resp
[
'createTime'
]))
{
$topic_meta
->
msgRetentionSeconds
=
$resp
[
'msgRetentionSeconds'
];
$topic_meta
->
createTime
=
$resp
[
'createTime'
];
}
}
if
(
isset
(
$resp
[
'createTime'
]))
{
if
(
isset
(
$resp
[
'lastModifyTime'
]))
{
$topic_meta
->
createTime
=
$resp
[
'createTime'
];
$topic_meta
->
lastModifyTime
=
$resp
[
'lastModifyTime'
];
}
}
if
(
isset
(
$resp
[
'lastModifyTime'
]))
{
if
(
isset
(
$resp
[
'filterType'
]))
{
$topic_meta
->
lastModifyTime
=
$resp
[
'lastModifyTime'
];
$topic_meta
->
filterType
=
$resp
[
'filterType'
];
}
}
if
(
isset
(
$resp
[
'filterType'
]))
{
$topic_meta
->
filterType
=
$resp
[
'filterType'
];
}
}
}
/**
/**
* 加密 发送主题消息
* 加密 发送主题消息
...
@@ -250,18 +253,39 @@ class Topic
...
@@ -250,18 +253,39 @@ class Topic
* @return mixed
* @return mixed
* @author work
* @author work
*/
*/
public
function
cryptPushMessage
(
string
$message
,
$vTagList
=
null
,
$routingKey
=
null
){
public
function
cryptPushMessage
(
string
$message
,
$vTagList
=
null
,
$routingKey
=
null
)
$cryptMessage
=
Xcrypt
::
encrypt
(
$message
);
{
$tryTimes
=
0
;
$cryptMessage
=
Xcrypt
::
encrypt
(
$message
);
$tryTimes
=
0
;
do
{
$res
=
$this
->
publish_message
(
$cryptMessage
,
$vTagList
,
$routingKey
);
do
{
$tryTimes
++
;
$res
=
$this
->
publish_message
(
$cryptMessage
,
$vTagList
,
$routingKey
);
}
while
(
$res
[
'code'
]
!=
0
&&
$tryTimes
<
3
);
$tryTimes
++
;
}
while
(
$res
[
'code'
]
!=
0
&&
$tryTimes
<
3
);
if
(
$tryTimes
>=
3
){
App
::
error
(
"[消息队列失败]:
$message
"
);
if
(
$tryTimes
>=
3
)
{
}
App
::
error
(
"[消息队列失败]:
$message
"
);
return
$res
;
}
}
$this
->
TopicLog
(
$message
,
$cryptMessage
,
$vTagList
,
$res
);
return
$res
;
}
protected
function
TopicLog
(
$message
,
$cryptMessage
,
$tagName
,
$response
)
{
$data
=
[
'tagName'
=>
$tagName
,
'topName'
=>
$this
->
topic_name
,
'message'
=>
$message
,
'cryptMessage'
=>
$cryptMessage
,
'createTime'
=>
time
(),
'response'
=>
json_encode
(
$response
),
];
try
{
$db
=
CfgCenter
::
dbConnect
();
$db
->
insert
(
'topic_log'
,
$data
);
}
catch
(
\Exception
$e
){
App
::
error
(
"消息主题日志记录失败:"
.
$e
->
getMessage
()
.
'---'
.
json_encode
(
$data
));
}
}
}
}
src/Common/ClsLogger/ClsLog.php
View file @
2755624a
...
@@ -50,21 +50,24 @@ class ClsLog
...
@@ -50,21 +50,24 @@ class ClsLog
private
static
function
uploadToCls
(
$topicId
,
$pbData
)
{
private
static
function
uploadToCls
(
$topicId
,
$pbData
)
{
$authorization
=
ClsSignature
::
create
();
$authorization
=
ClsSignature
::
create
();
$uri
=
'http://ap-beijing.cls.myqcloud.com/structuredlog?topic_id='
.
$topicId
;
$uri
=
'http://ap-beijing.cls.myqcloud.com/structuredlog?topic_id='
.
$topicId
;
$res
=
(
new
Client
)
->
post
(
$uri
,
[
for
(
$n
=
0
;
$n
<
3
;
$n
++
){
'headers'
=>
[
$res
=
(
new
Client
)
->
post
(
$uri
,
[
'Host'
=>
'ap-beijing.cls.myqcloud.com'
,
'headers'
=>
[
'Authorization'
=>
$authorization
,
'Host'
=>
'ap-beijing.cls.myqcloud.com'
,
'Content-Type'
=>
'application/x-protobuf'
,
'Authorization'
=>
$authorization
,
],
'Content-Type'
=>
'application/x-protobuf'
,
'body'
=>
$pbData
,
],
'timeout'
=>
20
,
'body'
=>
$pbData
,
]);
'timeout'
=>
30
,
if
(
$res
->
getResponse
()
->
getStatusCode
()
!=
200
)
{
]);
$msg
=
'上传腾讯云日志服务失败:'
.
$res
->
getResult
();
if
(
$res
->
getResponse
()
->
getStatusCode
()
==
200
)
{
self
::
writeClsErrors
(
$msg
);
return
true
;
return
false
;
}
Coroutine
::
sleep
(
1
);
}
}
return
true
;
$msg
=
'上传腾讯云日志服务失败:'
.
$res
->
getResult
();
self
::
writeClsErrors
(
$msg
);
return
false
;
}
}
/**
/**
...
...
src/Common/Config/CfgCenter.php
View file @
2755624a
...
@@ -54,7 +54,7 @@ class CfgCenter
...
@@ -54,7 +54,7 @@ class CfgCenter
}
}
$valObj
=
json_decode
(
$result
[
0
][
'value'
]);
$valObj
=
json_decode
(
$result
[
0
][
'value'
]);
if
(
!
is_object
(
$valObj
))
{
if
(
!
is_object
(
$valObj
))
{
return
;
return
[
$name
,
$result
[
0
][
'value'
]]
;
}
}
$keys
=
''
;
$keys
=
''
;
foreach
(
$keyArr
as
$key
)
{
foreach
(
$keyArr
as
$key
)
{
...
@@ -68,7 +68,7 @@ class CfgCenter
...
@@ -68,7 +68,7 @@ class CfgCenter
return
[
trim
(
$rkey
,
':'
),
$valObj
];
return
[
trim
(
$rkey
,
':'
),
$valObj
];
}
}
p
rotected
static
function
dbConnect
()
p
ublic
static
function
dbConnect
()
{
{
if
(
\env
(
'ENVIRONMENT'
,
''
)
==
''
)
{
if
(
\env
(
'ENVIRONMENT'
,
''
)
==
''
)
{
// 返回线上数据库连接
// 返回线上数据库连接
...
...
src/Common/Config/config.php
View file @
2755624a
<?php
<?php
return
[
namespace
Hdll\Services\Common\Config
;
'qCloud'
=>
[
'Bucket'
=>
'hdll-1257143824'
,
use
Swoft\Redis\Redis
;
'APPID'
=>
'1257143824'
,
use
Swoft\App
;
'SecretId'
=>
'AKIDseHj18kua0KTSJ4g9SadbVEnEUZVjvPj'
,
'SecretKey'
=>
'IPL5g5PaaSAzd6NSO8gEmLxcN4pTzJSQ'
,
const
CACHE_PREFIX
=
'CONFIG_CACHE:'
;
'Region'
=>
'ap-shanghai'
$redis
=
App
::
getBean
(
Redis
::
class
);
],
$data
=
$redis
->
get
(
CACHE_PREFIX
.
'all'
);
'alisms'
=>
[
'accessKeyId'
=>
'EjBn9zQxyEkKHyAA'
,
if
(
empty
(
$data
))
{
'accessKeySecret'
=>
'AN276rwCcqCkFUVt1GLCbAy8jnj52t'
,
$db
=
CfgCenter
::
dbConnect
();
],
$arr
=
$db
->
select
(
'config'
,
[
'name'
,
'value'
]);
'cls'
=>
[
foreach
(
$arr
as
$key
=>
$value
)
{
'appid'
=>
'1257143824 '
,
$v_arr
=
json_decode
(
$value
[
'value'
],
true
);
'secretId'
=>
'AKIDseHj18kua0KTSJ4g9SadbVEnEUZVjvPj'
,
$data
[
$value
[
'name'
]]
=
empty
(
$v_arr
)
?
$value
[
'value'
]
:
$v_arr
;
'secretKey'
=>
'IPL5g5PaaSAzd6NSO8gEmLxcN4pTzJSQ'
,
}
],
$redis
->
set
(
CACHE_PREFIX
.
'all'
,
json_encode
(
$data
));
'cmq'
=>
[
}
else
{
'intranet_host'
=>
'http://cmq-topic-bj.api.tencentyun.com'
,
//内网
$data
=
json_decode
(
$data
,
true
);
'internet_host'
=>
'https://cmq-topic-bj.api.qcloud.com'
,
//外网
}
'secretId'
=>
'AKIDYRW1cG2iVIg8dAoCe86vhNuA7A5oNknk'
,
return
$data
;
'secretKey'
=>
'z0ymS7xfLrP6Sk2EKHWaXN6d0EIxX0IQ'
,
\ No newline at end of file
],
'cryptKey'
=>
'ebf032f01aa2093be3ee2ee2c137hdll'
,
];
\ No newline at end of file
src/Common/Lib/Xcrypt.php
View file @
2755624a
<?php
<?php
namespace
Hdll\Services\Common\Lib
;
namespace
Hdll\Services\Common\Lib
;
use
Hdll\Services\Common\Config\CfgCenter
;
use
Swoft\App
;
use
Swoft\App
;
use
Swoft\Redis\Redis
;
use
Swoft\Redis\Redis
;
class
Xcrypt
class
Xcrypt
{
{
const
CRYPT
=
'crypt'
;
const
CRYPT
=
'crypt
Key
'
;
public
static
function
encrypt
(
string
$str
,
$key
=
''
)
public
static
function
encrypt
(
string
$str
,
$key
=
''
)
...
@@ -41,8 +42,7 @@ class Xcrypt
...
@@ -41,8 +42,7 @@ class Xcrypt
}
}
private
static
function
getKey
(){
private
static
function
getKey
(){
$redis
=
App
::
getBean
(
Redis
::
class
);
$key
=
CfgCenter
::
get
(
self
::
CRYPT
);
$key
=
$redis
->
get
(
self
::
CRYPT
);
if
(
empty
(
$key
)){
if
(
empty
(
$key
)){
throw
new
\Exception
(
'加密密钥获取失败!'
);
throw
new
\Exception
(
'加密密钥获取失败!'
);
}
}
...
...
src/GroupBooking/Enum/RecordEnum.php
View file @
2755624a
...
@@ -13,4 +13,5 @@ class RecordEnum
...
@@ -13,4 +13,5 @@ class RecordEnum
const
START_NOT_PAY
=
10
;
//未支付
const
START_NOT_PAY
=
10
;
//未支付
const
START_PAY
=
20
;
//已支付
const
START_PAY
=
20
;
//已支付
const
CLOSED
=
30
;
//已关闭
const
CLOSED
=
30
;
//已关闭
const
FINISH
=
40
;
//已完成
}
}
\ No newline at end of file
src/Order/Lib/SellerOrderInterface.php
View file @
2755624a
...
@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
...
@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferSellerCreateOrder(int $sellerId,int $storeId,int $itemId,int $selectedNum,int $orderType,float $total,float $goodsPrice,string $goodsName)
* @method ResultInterface deferSellerCreateOrder(int $sellerId,int $storeId,int $itemId,int $selectedNum,int $orderType,float $total,float $goodsPrice,string $goodsName)
* @method ResultInterface deferGetOrderInfoBySn(int $storeId, string $orderSn)
* @method ResultInterface deferGetOrderInfoBySn(int $storeId, string $orderSn)
* @method ResultInterface deferUpdateInfoById(int $storeId,int $orderId, array $updateInfo)
* @method ResultInterface deferUpdateInfoById(int $storeId,int $orderId, array $updateInfo)
* @method ResultInterface deferGetSellerOrderByStoreId(int $storeId, int $itemId)
* Interface SellerOrderInterface
* Interface SellerOrderInterface
* @package Hdll\Services\Order\Lib
* @package Hdll\Services\Order\Lib
*/
*/
...
@@ -36,4 +37,6 @@ interface SellerOrderInterface
...
@@ -36,4 +37,6 @@ interface SellerOrderInterface
public
function
updateInfoById
(
int
$storeId
,
int
$orderId
,
array
$updateInfo
);
public
function
updateInfoById
(
int
$storeId
,
int
$orderId
,
array
$updateInfo
);
public
function
getSellerOrderByStoreId
(
int
$storeId
,
int
$itemId
);
}
}
\ No newline at end of file
src/Schedule/Lib/ScheduleInterface.php
View file @
2755624a
...
@@ -18,6 +18,7 @@ use Swoft\Core\ResultInterface;
...
@@ -18,6 +18,7 @@ use Swoft\Core\ResultInterface;
*
*
* @method ResultInterface deferGetScheduleList(int $storeId, int $month, int $cmanId = 0)
* @method ResultInterface deferGetScheduleList(int $storeId, int $month, int $cmanId = 0)
* @method ResultInterface deferGetScheduleByDateId(int $storeId, int $dateId, int $cmanId = 0)
* @method ResultInterface deferGetScheduleByDateId(int $storeId, int $dateId, int $cmanId = 0)
* @method ResultInterface deferIsOffday(int $storeId, int $dateId, int $cmanId = 0)
* @method ResultInterface deferUpdateSchedule(int $storeId, int $cmanId, int $dateId, array $data)
* @method ResultInterface deferUpdateSchedule(int $storeId, int $cmanId, int $dateId, array $data)
* @method ResultInterface deferAddSchedule(int $storeId, int $cmanId, int $dateId, array $data)
* @method ResultInterface deferAddSchedule(int $storeId, int $cmanId, int $dateId, array $data)
*/
*/
...
@@ -43,6 +44,15 @@ interface ScheduleInterface
...
@@ -43,6 +44,15 @@ interface ScheduleInterface
public
function
getScheduleByDateId
(
int
$storeId
,
int
$dateId
,
int
$cmanId
=
0
);
public
function
getScheduleByDateId
(
int
$storeId
,
int
$dateId
,
int
$cmanId
=
0
);
/**
/**
* 判断某天是否是休息日
*
* @param integer $storeId
* @param integer $dateId 要查询的日期id,格式要求如:20180803
* @return bool 如是休息日,返回true
*/
public
function
isOffday
(
int
$storeId
,
int
$dateId
,
int
$cmanId
=
0
);
/**
* 根据dateId修改某个日程的信息
* 根据dateId修改某个日程的信息
*
*
* @param integer $storeId
* @param integer $storeId
...
...
src/SellerDistribution/Enum/SellerDistributionCmqEnum.php
View file @
2755624a
...
@@ -10,4 +10,5 @@ class SellerDistributionCmqEnum{
...
@@ -10,4 +10,5 @@ class SellerDistributionCmqEnum{
const
ADD_TOTAL
=
'addTotal'
;
const
ADD_TOTAL
=
'addTotal'
;
const
REFUND_ADD_BALANCE
=
'refundAddBalance'
;
const
REFUND_ADD_BALANCE
=
'refundAddBalance'
;
const
UPDATE_BILL
=
'updateBill'
;
const
UPDATE_BILL
=
'updateBill'
;
const
SAVE_BILL
=
'saveBill'
;
}
}
\ No newline at end of file
src/Store/Enum/StoreCmqEnum.php
0 → 100644
View file @
2755624a
<?php
namespace
Hdll\Services\Store\Enum
;
class
StoreCmqEnum
{
const
TOPIC
=
'store'
;
const
ADD_VIP_TIME
=
'addVipTime'
;
}
\ No newline at end of file
src/Store/Lib/EntrustedInterface.php
0 → 100644
View file @
2755624a
<?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\Store\Lib
;
use
Swoft\Core\ResultInterface
;
/**
* The interface of store service
*
* @method ResultInterface deferGetEntrustedData(int $storeId, array $fields = [])
*/
interface
EntrustedInterface
{
/**
* 根据店铺id获取对应的托管配置
*
* @param int $storeId
* @param array $fields 字段列表
* @return bool
*/
public
function
getEntrustedData
(
int
$storeId
,
array
$fields
=
[]);
}
\ No newline at end of file
src/Store/Lib/StoreInterface.php
View file @
2755624a
...
@@ -19,7 +19,7 @@ use Swoft\Core\ResultInterface;
...
@@ -19,7 +19,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferIsNormal(int $storeId)
* @method ResultInterface deferIsNormal(int $storeId)
* @method ResultInterface deferGetStoreByStoreId(int $storeId)
* @method ResultInterface deferGetStoreByStoreId(int $storeId)
* @method ResultInterface deferGetStoreBySellerId(int $sellerId)
* @method ResultInterface deferGetStoreBySellerId(int $sellerId)
* @method ResultInterface deferGetListBySellerIds(array $sellerIds)
* @method ResultInterface deferGetListBySellerIds(array $sellerIds
, array $fields = []
)
* @method ResultInterface deferGetStoreByMobile(int $mobile, array $fields = [])
* @method ResultInterface deferGetStoreByMobile(int $mobile, array $fields = [])
* @method ResultInterface deferUpdateStore(int $storeId, array $data)
* @method ResultInterface deferUpdateStore(int $storeId, array $data)
* @method ResultInterface deferAddVipTime(int $storeId, int $days)
* @method ResultInterface deferAddVipTime(int $storeId, int $days)
...
@@ -69,7 +69,7 @@ interface StoreInterface
...
@@ -69,7 +69,7 @@ interface StoreInterface
* mobile 注册手机号
* mobile 注册手机号
* edition 是否VIP 2 表示是VIP
* edition 是否VIP 2 表示是VIP
*/
*/
public
function
getListBySellerIds
(
array
$sellerIds
);
public
function
getListBySellerIds
(
array
$sellerIds
,
array
$fields
=
[]
);
/**
/**
* 根据注册手机号获取店铺信息
* 根据注册手机号获取店铺信息
...
...
src/Vip/Lib/VipInterface.php
View file @
2755624a
...
@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
...
@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
/**
/**
* @method ResultInterface deferOpenVip($storeId, $orderId, $money)
* @method ResultInterface deferOpenVip($storeId, $orderId, $money)
* @method ResultInterface deferGetVip($vipId)
* @method ResultInterface deferGetVip($vipId)
* @method ResultInterface deferTryVipCountByReferId(int $referId)
* Interface SellerInterface
* Interface SellerInterface
* @package App\Lib
* @package App\Lib
*/
*/
...
@@ -22,4 +23,6 @@ interface VipInterface
...
@@ -22,4 +23,6 @@ interface VipInterface
public
function
openVip
(
$storeId
,
$orderId
);
public
function
openVip
(
$storeId
,
$orderId
);
public
function
getVip
(
int
$vipId
);
public
function
getVip
(
int
$vipId
);
public
function
tryVipCountByReferId
(
int
$referId
);
}
}
\ 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