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 @@
namespace
Hdll\Services\Cmq
;
use
Hdll\Services\Common\Config\CfgCenter
;
use
Swoft\App
;
use
Hdll\Services\Common\Lib\Xcrypt
;
class
Topic
{
private
$topic_name
;
private
$cmq_client
;
private
$encoding
;
public
function
__construct
(
$topic_name
,
$cmq_client
,
$encoding
=
false
)
{
$this
->
topic_name
=
$topic_name
;
$this
->
cmq_client
=
$cmq_client
;
$this
->
encoding
=
$encoding
;
}
public
function
set_encoding
(
$encoding
)
{
$this
->
encoding
=
$encoding
;
}
/*
* create topic
* @type topic_meta : TopicMeta
* @param topic_meta :
*/
public
function
create
(
$topic_meta
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
'filterType'
=>
$topic_meta
->
filterType
,
);
if
(
$topic_meta
->
maxMsgSize
>
0
)
{
$params
[
'maxMsgSize'
]
=
$topic_meta
->
maxMsgSize
;
}
$this
->
cmq_client
->
create_topic
(
$params
);
}
/*
* get attributes
*
* @return topic_meta :TopicMeta
*
*/
public
function
get_attributes
()
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
);
$resp
=
$this
->
cmq_client
->
get_topic_attributes
(
$params
);
$topic_meta
=
new
TopicMeta
();
$this
->
__resp2meta
(
$topic_meta
,
$resp
);
return
$topic_meta
;
}
/*
* set attributes
*
* @type topic_meta :TopicMeta
* @param topic_meta :
*/
public
function
set_attributes
(
$topic_meta
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
'maxMsgSize'
=>
strval
(
$topic_meta
->
maxMsgSize
),
);
$this
->
cmq_client
->
set_topic_attributes
(
$params
);
}
/*
* delete topic
*/
public
function
delete
()
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
);
$this
->
cmq_client
->
delete_topic
(
$params
);
}
/*
* 推送消息 非批量
* @type message :string
* @param message
*
* @type vTagList :list
* @param vTagList 标签
*
* @return message handle
*/
public
function
publish_message
(
$message
,
$vTagList
=
null
,
$routingKey
=
null
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
'msgBody'
=>
$message
,
);
if
(
$routingKey
!=
null
)
{
$params
[
'routingKey'
]
=
$routingKey
;
}
if
(
$vTagList
!=
null
&&
is_array
(
$vTagList
)
&&
!
empty
(
$vTagList
))
{
$n
=
1
;
foreach
(
$vTagList
as
$tag
)
{
$key
=
'msgTag.'
.
$n
;
$params
[
$key
]
=
$tag
;
$n
+=
1
;
}
}
$msgId
=
$this
->
cmq_client
->
publish_message
(
$params
);
return
$msgId
;
}
/*
* 批量推送消息
* @type vmessageList :list
* @param vmessageList:
*
* @type vtagList :list
* @param vtagList
*
* @return : return message handle list
*/
public
function
batch_publish_message
(
$vmessageList
,
$vtagList
=
null
,
$routingKey
=
null
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
);
if
(
$routingKey
!=
null
)
{
$params
[
'routingKey'
]
=
$routingKey
;
}
$n
=
1
;
if
(
is_array
(
$vmessageList
)
&&
!
empty
(
$vmessageList
))
{
foreach
(
$vmessageList
as
$msg
)
{
$key
=
'msgBody.'
.
$n
;
if
(
$this
->
encoding
)
{
$params
[
$key
]
=
base64_encode
(
$msg
);
}
else
{
$params
[
$key
]
=
$msg
;
}
$n
+=
1
;
}
}
if
(
$vtagList
!=
null
&&
is_array
(
$vtagList
)
&&
!
empty
(
$vtagList
))
{
$n
=
1
;
foreach
(
$vtagList
as
$tag
)
{
$key
=
'msgTag.'
.
$n
;
$params
[
$key
]
=
$tag
;
$n
+=
1
;
}
}
$msgList
=
$this
->
cmq_client
->
batch_publish_message
(
$params
);
$retMessageList
=
array
();
foreach
(
$msgList
as
$msg
)
{
if
(
isset
(
$msg
[
'msgId'
]))
{
$retmsgId
=
$msg
[
'msgId'
];
$retMessageList
[]
=
$retmsgId
;
}
}
return
$retMessageList
;
}
/* 列出Topic的Subscriptoin
@type topic_name :string
@param topic_name:
@type searchWord: string
@param searchWord: 订阅关键字
@type limit: int
@param limit: 最多返回的订阅数目
@type offset: string
@param offset: list_subscription的起始位置,上次list_subscription返回的next_offset
@rtype: tuple
@return: subscriptionURL的列表和下次list subscription的起始位置; 如果所有subscription都list出来,next_offset为"".
*/
public
function
list_subscription
(
$searchWord
=
""
,
$limit
=
-
1
,
$offset
=
""
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
);
if
(
$searchWord
!=
""
)
{
$params
[
'searchWord'
]
=
$searchWord
;
}
if
(
$limit
!=
-
1
)
{
$params
[
'limit'
]
=
$limit
;
}
if
(
$offset
!=
""
)
{
$params
[
'offset'
]
=
$offset
;
}
$resp
=
$this
->
cmq_client
->
list_subscription
(
$params
);
if
(
$offset
==
""
)
{
$next_offset
=
count
(
$resp
[
'subscriptionList'
]);
}
else
{
$next_offset
=
$offset
+
count
(
$resp
[
'subscriptionList'
]);
}
if
(
$next_offset
>=
$resp
[
'totalCount'
])
{
$next_offset
=
""
;
}
return
array
(
"totalCoult"
=>
$resp
[
'totalCount'
],
"subscriptionList"
=>
$resp
[
'subscriptionList'
],
"next_offset"
=>
$next_offset
);
}
protected
function
__resp2meta
(
$topic_meta
,
$resp
)
{
if
(
isset
(
$resp
[
'maxMsgSize'
]))
{
$topic_meta
->
maxMsgSize
=
$resp
[
'maxMsgSize'
];
}
if
(
isset
(
$resp
[
'msgRetentionSeconds'
]))
{
$topic_meta
->
msgRetentionSeconds
=
$resp
[
'msgRetentionSeconds'
];
}
if
(
isset
(
$resp
[
'createTime'
]))
{
$topic_meta
->
createTime
=
$resp
[
'createTime'
];
}
if
(
isset
(
$resp
[
'lastModifyTime'
]))
{
$topic_meta
->
lastModifyTime
=
$resp
[
'lastModifyTime'
];
}
if
(
isset
(
$resp
[
'filterType'
]))
{
$topic_meta
->
filterType
=
$resp
[
'filterType'
];
}
}
private
$topic_name
;
private
$cmq_client
;
private
$encoding
;
public
function
__construct
(
$topic_name
,
$cmq_client
,
$encoding
=
false
)
{
$this
->
topic_name
=
$topic_name
;
$this
->
cmq_client
=
$cmq_client
;
$this
->
encoding
=
$encoding
;
}
public
function
set_encoding
(
$encoding
)
{
$this
->
encoding
=
$encoding
;
}
/*
* create topic
* @type topic_meta : TopicMeta
* @param topic_meta :
*/
public
function
create
(
$topic_meta
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
'filterType'
=>
$topic_meta
->
filterType
,
);
if
(
$topic_meta
->
maxMsgSize
>
0
)
{
$params
[
'maxMsgSize'
]
=
$topic_meta
->
maxMsgSize
;
}
$this
->
cmq_client
->
create_topic
(
$params
);
}
/*
* get attributes
*
* @return topic_meta :TopicMeta
*
*/
public
function
get_attributes
()
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
);
$resp
=
$this
->
cmq_client
->
get_topic_attributes
(
$params
);
$topic_meta
=
new
TopicMeta
();
$this
->
__resp2meta
(
$topic_meta
,
$resp
);
return
$topic_meta
;
}
/*
* set attributes
*
* @type topic_meta :TopicMeta
* @param topic_meta :
*/
public
function
set_attributes
(
$topic_meta
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
'maxMsgSize'
=>
strval
(
$topic_meta
->
maxMsgSize
),
);
$this
->
cmq_client
->
set_topic_attributes
(
$params
);
}
/*
* delete topic
*/
public
function
delete
()
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
);
$this
->
cmq_client
->
delete_topic
(
$params
);
}
/*
* 推送消息 非批量
* @type message :string
* @param message
*
* @type vTagList :list
* @param vTagList 标签
*
* @return message handle
*/
public
function
publish_message
(
$message
,
$vTagList
=
null
,
$routingKey
=
null
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
'msgBody'
=>
$message
,
);
if
(
$routingKey
!=
null
)
{
$params
[
'routingKey'
]
=
$routingKey
;
}
if
(
$vTagList
!=
null
&&
is_array
(
$vTagList
)
&&
!
empty
(
$vTagList
))
{
$n
=
1
;
foreach
(
$vTagList
as
$tag
)
{
$key
=
'msgTag.'
.
$n
;
$params
[
$key
]
=
$tag
;
$n
+=
1
;
}
}
$msgId
=
$this
->
cmq_client
->
publish_message
(
$params
);
return
$msgId
;
}
/*
* 批量推送消息
* @type vmessageList :list
* @param vmessageList:
*
* @type vtagList :list
* @param vtagList
*
* @return : return message handle list
*/
public
function
batch_publish_message
(
$vmessageList
,
$vtagList
=
null
,
$routingKey
=
null
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
,
);
if
(
$routingKey
!=
null
)
{
$params
[
'routingKey'
]
=
$routingKey
;
}
$n
=
1
;
if
(
is_array
(
$vmessageList
)
&&
!
empty
(
$vmessageList
))
{
foreach
(
$vmessageList
as
$msg
)
{
$key
=
'msgBody.'
.
$n
;
if
(
$this
->
encoding
)
{
$params
[
$key
]
=
base64_encode
(
$msg
);
}
else
{
$params
[
$key
]
=
$msg
;
}
$n
+=
1
;
}
}
if
(
$vtagList
!=
null
&&
is_array
(
$vtagList
)
&&
!
empty
(
$vtagList
))
{
$n
=
1
;
foreach
(
$vtagList
as
$tag
)
{
$key
=
'msgTag.'
.
$n
;
$params
[
$key
]
=
$tag
;
$n
+=
1
;
}
}
$msgList
=
$this
->
cmq_client
->
batch_publish_message
(
$params
);
$retMessageList
=
array
();
foreach
(
$msgList
as
$msg
)
{
if
(
isset
(
$msg
[
'msgId'
]))
{
$retmsgId
=
$msg
[
'msgId'
];
$retMessageList
[]
=
$retmsgId
;
}
}
return
$retMessageList
;
}
/* 列出Topic的Subscriptoin
@type topic_name :string
@param topic_name:
@type searchWord: string
@param searchWord: 订阅关键字
@type limit: int
@param limit: 最多返回的订阅数目
@type offset: string
@param offset: list_subscription的起始位置,上次list_subscription返回的next_offset
@rtype: tuple
@return: subscriptionURL的列表和下次list subscription的起始位置; 如果所有subscription都list出来,next_offset为"".
*/
public
function
list_subscription
(
$searchWord
=
""
,
$limit
=
-
1
,
$offset
=
""
)
{
$params
=
array
(
'topicName'
=>
$this
->
topic_name
);
if
(
$searchWord
!=
""
)
{
$params
[
'searchWord'
]
=
$searchWord
;
}
if
(
$limit
!=
-
1
)
{
$params
[
'limit'
]
=
$limit
;
}
if
(
$offset
!=
""
)
{
$params
[
'offset'
]
=
$offset
;
}
$resp
=
$this
->
cmq_client
->
list_subscription
(
$params
);
if
(
$offset
==
""
)
{
$next_offset
=
count
(
$resp
[
'subscriptionList'
]);
}
else
{
$next_offset
=
$offset
+
count
(
$resp
[
'subscriptionList'
]);
}
if
(
$next_offset
>=
$resp
[
'totalCount'
])
{
$next_offset
=
""
;
}
return
array
(
"totalCoult"
=>
$resp
[
'totalCount'
],
"subscriptionList"
=>
$resp
[
'subscriptionList'
],
"next_offset"
=>
$next_offset
);
}
protected
function
__resp2meta
(
$topic_meta
,
$resp
)
{
if
(
isset
(
$resp
[
'maxMsgSize'
]))
{
$topic_meta
->
maxMsgSize
=
$resp
[
'maxMsgSize'
];
}
if
(
isset
(
$resp
[
'msgRetentionSeconds'
]))
{
$topic_meta
->
msgRetentionSeconds
=
$resp
[
'msgRetentionSeconds'
];
}
if
(
isset
(
$resp
[
'createTime'
]))
{
$topic_meta
->
createTime
=
$resp
[
'createTime'
];
}
if
(
isset
(
$resp
[
'lastModifyTime'
]))
{
$topic_meta
->
lastModifyTime
=
$resp
[
'lastModifyTime'
];
}
if
(
isset
(
$resp
[
'filterType'
]))
{
$topic_meta
->
filterType
=
$resp
[
'filterType'
];
}
}
/**
* 加密 发送主题消息
...
...
@@ -250,18 +253,39 @@ class Topic
* @return mixed
* @author work
*/
public
function
cryptPushMessage
(
string
$message
,
$vTagList
=
null
,
$routingKey
=
null
){
$cryptMessage
=
Xcrypt
::
encrypt
(
$message
);
$tryTimes
=
0
;
do
{
$res
=
$this
->
publish_message
(
$cryptMessage
,
$vTagList
,
$routingKey
);
$tryTimes
++
;
}
while
(
$res
[
'code'
]
!=
0
&&
$tryTimes
<
3
);
if
(
$tryTimes
>=
3
){
App
::
error
(
"[消息队列失败]:
$message
"
);
}
return
$res
;
}
public
function
cryptPushMessage
(
string
$message
,
$vTagList
=
null
,
$routingKey
=
null
)
{
$cryptMessage
=
Xcrypt
::
encrypt
(
$message
);
$tryTimes
=
0
;
do
{
$res
=
$this
->
publish_message
(
$cryptMessage
,
$vTagList
,
$routingKey
);
$tryTimes
++
;
}
while
(
$res
[
'code'
]
!=
0
&&
$tryTimes
<
3
);
if
(
$tryTimes
>=
3
)
{
App
::
error
(
"[消息队列失败]:
$message
"
);
}
$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
private
static
function
uploadToCls
(
$topicId
,
$pbData
)
{
$authorization
=
ClsSignature
::
create
();
$uri
=
'http://ap-beijing.cls.myqcloud.com/structuredlog?topic_id='
.
$topicId
;
$res
=
(
new
Client
)
->
post
(
$uri
,
[
'headers'
=>
[
'Host'
=>
'ap-beijing.cls.myqcloud.com'
,
'Authorization'
=>
$authorization
,
'Content-Type'
=>
'application/x-protobuf'
,
],
'body'
=>
$pbData
,
'timeout'
=>
20
,
]);
if
(
$res
->
getResponse
()
->
getStatusCode
()
!=
200
)
{
$msg
=
'上传腾讯云日志服务失败:'
.
$res
->
getResult
();
self
::
writeClsErrors
(
$msg
);
return
false
;
for
(
$n
=
0
;
$n
<
3
;
$n
++
){
$res
=
(
new
Client
)
->
post
(
$uri
,
[
'headers'
=>
[
'Host'
=>
'ap-beijing.cls.myqcloud.com'
,
'Authorization'
=>
$authorization
,
'Content-Type'
=>
'application/x-protobuf'
,
],
'body'
=>
$pbData
,
'timeout'
=>
30
,
]);
if
(
$res
->
getResponse
()
->
getStatusCode
()
==
200
)
{
return
true
;
}
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
}
$valObj
=
json_decode
(
$result
[
0
][
'value'
]);
if
(
!
is_object
(
$valObj
))
{
return
;
return
[
$name
,
$result
[
0
][
'value'
]]
;
}
$keys
=
''
;
foreach
(
$keyArr
as
$key
)
{
...
...
@@ -68,7 +68,7 @@ class CfgCenter
return
[
trim
(
$rkey
,
':'
),
$valObj
];
}
p
rotected
static
function
dbConnect
()
p
ublic
static
function
dbConnect
()
{
if
(
\env
(
'ENVIRONMENT'
,
''
)
==
''
)
{
// 返回线上数据库连接
...
...
src/Common/Config/config.php
View file @
2755624a
<?php
return
[
'qCloud'
=>
[
'Bucket'
=>
'hdll-1257143824'
,
'APPID'
=>
'1257143824'
,
'SecretId'
=>
'AKIDseHj18kua0KTSJ4g9SadbVEnEUZVjvPj'
,
'SecretKey'
=>
'IPL5g5PaaSAzd6NSO8gEmLxcN4pTzJSQ'
,
'Region'
=>
'ap-shanghai'
],
'alisms'
=>
[
'accessKeyId'
=>
'EjBn9zQxyEkKHyAA'
,
'accessKeySecret'
=>
'AN276rwCcqCkFUVt1GLCbAy8jnj52t'
,
],
'cls'
=>
[
'appid'
=>
'1257143824 '
,
'secretId'
=>
'AKIDseHj18kua0KTSJ4g9SadbVEnEUZVjvPj'
,
'secretKey'
=>
'IPL5g5PaaSAzd6NSO8gEmLxcN4pTzJSQ'
,
],
'cmq'
=>
[
'intranet_host'
=>
'http://cmq-topic-bj.api.tencentyun.com'
,
//内网
'internet_host'
=>
'https://cmq-topic-bj.api.qcloud.com'
,
//外网
'secretId'
=>
'AKIDYRW1cG2iVIg8dAoCe86vhNuA7A5oNknk'
,
'secretKey'
=>
'z0ymS7xfLrP6Sk2EKHWaXN6d0EIxX0IQ'
,
],
'cryptKey'
=>
'ebf032f01aa2093be3ee2ee2c137hdll'
,
];
\ No newline at end of file
namespace
Hdll\Services\Common\Config
;
use
Swoft\Redis\Redis
;
use
Swoft\App
;
const
CACHE_PREFIX
=
'CONFIG_CACHE:'
;
$redis
=
App
::
getBean
(
Redis
::
class
);
$data
=
$redis
->
get
(
CACHE_PREFIX
.
'all'
);
if
(
empty
(
$data
))
{
$db
=
CfgCenter
::
dbConnect
();
$arr
=
$db
->
select
(
'config'
,
[
'name'
,
'value'
]);
foreach
(
$arr
as
$key
=>
$value
)
{
$v_arr
=
json_decode
(
$value
[
'value'
],
true
);
$data
[
$value
[
'name'
]]
=
empty
(
$v_arr
)
?
$value
[
'value'
]
:
$v_arr
;
}
$redis
->
set
(
CACHE_PREFIX
.
'all'
,
json_encode
(
$data
));
}
else
{
$data
=
json_decode
(
$data
,
true
);
}
return
$data
;
\ No newline at end of file
src/Common/Lib/Xcrypt.php
View file @
2755624a
<?php
namespace
Hdll\Services\Common\Lib
;
use
Hdll\Services\Common\Config\CfgCenter
;
use
Swoft\App
;
use
Swoft\Redis\Redis
;
class
Xcrypt
{
const
CRYPT
=
'crypt'
;
const
CRYPT
=
'crypt
Key
'
;
public
static
function
encrypt
(
string
$str
,
$key
=
''
)
...
...
@@ -41,8 +42,7 @@ class Xcrypt
}
private
static
function
getKey
(){
$redis
=
App
::
getBean
(
Redis
::
class
);
$key
=
$redis
->
get
(
self
::
CRYPT
);
$key
=
CfgCenter
::
get
(
self
::
CRYPT
);
if
(
empty
(
$key
)){
throw
new
\Exception
(
'加密密钥获取失败!'
);
}
...
...
src/GroupBooking/Enum/RecordEnum.php
View file @
2755624a
...
...
@@ -13,4 +13,5 @@ class RecordEnum
const
START_NOT_PAY
=
10
;
//未支付
const
START_PAY
=
20
;
//已支付
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;
* @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 deferUpdateInfoById(int $storeId,int $orderId, array $updateInfo)
* @method ResultInterface deferGetSellerOrderByStoreId(int $storeId, int $itemId)
* Interface SellerOrderInterface
* @package Hdll\Services\Order\Lib
*/
...
...
@@ -36,4 +37,6 @@ interface SellerOrderInterface
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;
*
* @method ResultInterface deferGetScheduleList(int $storeId, int $month, 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 deferAddSchedule(int $storeId, int $cmanId, int $dateId, array $data)
*/
...
...
@@ -43,6 +44,15 @@ interface ScheduleInterface
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修改某个日程的信息
*
* @param integer $storeId
...
...
src/SellerDistribution/Enum/SellerDistributionCmqEnum.php
View file @
2755624a
...
...
@@ -10,4 +10,5 @@ class SellerDistributionCmqEnum{
const
ADD_TOTAL
=
'addTotal'
;
const
REFUND_ADD_BALANCE
=
'refundAddBalance'
;
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;
* @method ResultInterface deferIsNormal(int $storeId)
* @method ResultInterface deferGetStoreByStoreId(int $storeId)
* @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 deferUpdateStore(int $storeId, array $data)
* @method ResultInterface deferAddVipTime(int $storeId, int $days)
...
...
@@ -69,7 +69,7 @@ interface StoreInterface
* mobile 注册手机号
* 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;
/**
* @method ResultInterface deferOpenVip($storeId, $orderId, $money)
* @method ResultInterface deferGetVip($vipId)
* @method ResultInterface deferTryVipCountByReferId(int $referId)
* Interface SellerInterface
* @package App\Lib
*/
...
...
@@ -22,4 +23,6 @@ interface VipInterface
public
function
openVip
(
$storeId
,
$orderId
);
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