Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
7651af98
Commit
7651af98
authored
Feb 01, 2023
by
Liu lu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.2.2-t' of
http://git.huaperfect.com/without_auth/meibuyu-micro
into v2.1.191-t
parents
b4752b98
893f68a9
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
290 additions
and
14 deletions
+290
-14
LogTraceHandler.php
src/Handler/LogTrace/LogTraceHandler.php
+1
-1
RedisQueueBatchHandler.php
src/Handler/RedisQueueBatchHandler.php
+4
-4
AuthorizeMiddleware.php
src/Middleware/AuthorizeMiddleware.php
+97
-0
BaseService.php
src/Service/BaseService.php
+3
-0
AppServiceInterface.php
src/Service/Interfaces/AppServiceInterface.php
+4
-0
BaseInfoServiceInterface.php
src/Service/Interfaces/BaseInfoServiceInterface.php
+4
-0
DatacenterServiceInterface.php
src/Service/Interfaces/DatacenterServiceInterface.php
+4
-0
DingDepartmentServiceInterface.php
...ce/Interfaces/DingTalk/DingDepartmentServiceInterface.php
+4
-0
DingMessageServiceInterface.php
...rvice/Interfaces/DingTalk/DingMessageServiceInterface.php
+4
-0
DingUserServiceInterface.php
src/Service/Interfaces/DingTalk/DingUserServiceInterface.php
+4
-0
DispatchPlanServiceInterface.php
src/Service/Interfaces/DispatchPlanServiceInterface.php
+4
-0
FileServiceInterface.php
src/Service/Interfaces/File/FileServiceInterface.php
+4
-2
GetConnectModuleServiceInterface.php
...vice/Interfaces/Flow/GetConnectModuleServiceInterface.php
+4
-1
ProcessFormServiceInterface.php
src/Service/Interfaces/Flow/ProcessFormServiceInterface.php
+4
-1
LogisticsServiceInterface.php
...ervice/Interfaces/Logistics/LogisticsServiceInterface.php
+4
-1
OperationServiceInterface.php
...ervice/Interfaces/Operation/OperationServiceInterface.php
+4
-0
ShopifyOrderServiceInterface.php
...Service/Interfaces/Order/ShopifyOrderServiceInterface.php
+4
-0
StockUpServiceInterface.php
src/Service/Interfaces/Order/StockUpServiceInterface.php
+18
-0
SubOrderServiceInterface.php
src/Service/Interfaces/Order/SubOrderServiceInterface.php
+4
-0
MaterialServiceInterface.php
src/Service/Interfaces/Product/MaterialServiceInterface.php
+4
-0
PlatformProductChildServiceInterface.php
...terfaces/Product/PlatformProductChildServiceInterface.php
+4
-0
PlatformProductServiceInterface.php
...ce/Interfaces/Product/PlatformProductServiceInterface.php
+4
-0
ProductChildServiceInterface.php
...rvice/Interfaces/Product/ProductChildServiceInterface.php
+4
-0
ProductServiceInterface.php
src/Service/Interfaces/Product/ProductServiceInterface.php
+4
-0
ShopifyProductServiceInterface.php
...ice/Interfaces/Product/ShopifyProductServiceInterface.php
+4
-0
ShopifyServiceInterface.php
src/Service/Interfaces/Product/ShopifyServiceInterface.php
+4
-0
ProductChildServiceInterface.php
src/Service/Interfaces/ProductChildServiceInterface.php
+4
-0
ProductionServiceInterface.php
...vice/Interfaces/Production/ProductionServiceInterface.php
+4
-0
PurchaseDoneServiceInterface.php
...vice/Interfaces/Purchase/PurchaseDoneServiceInterface.php
+4
-0
PurchaseTaskServiceInterface.php
...vice/Interfaces/Purchase/PurchaseTaskServiceInterface.php
+4
-0
StoreMaterialServiceInterface.php
...ervice/Interfaces/Store/StoreMaterialServiceInterface.php
+4
-0
StoreServiceInterface.php
src/Service/Interfaces/StoreServiceInterface.php
+4
-0
AccessServiceInterface.php
src/Service/Interfaces/User/AccessServiceInterface.php
+4
-0
AuthenticationServiceInterface.php
...ervice/Interfaces/User/AuthenticationServiceInterface.php
+42
-0
AbstractShopify.php
src/Shopify/lib/AbstractShopify.php
+13
-4
No files found.
src/Handler/LogTrace/LogTraceHandler.php
View file @
7651af98
...
@@ -106,7 +106,7 @@ class LogTraceHandler
...
@@ -106,7 +106,7 @@ class LogTraceHandler
}
else
if
(
is_string
(
$track
)
||
is_numeric
(
$track
))
{
}
else
if
(
is_string
(
$track
)
||
is_numeric
(
$track
))
{
$logInfo
=
$track
;
$logInfo
=
$track
;
}
else
{
}
else
{
$logInfo
=
print_r
(
$track
,
true
);
$logInfo
=
json_encode
(
$track
,
JSON_PRETTY_PRINT
);
;
//
print_r($track, true);
}
}
$logInfo
.=
"
\n\n
"
;
$logInfo
.=
"
\n\n
"
;
...
...
src/Handler/RedisQueueBatchHandler.php
View file @
7651af98
...
@@ -72,8 +72,6 @@ abstract class RedisQueueBatchHandler
...
@@ -72,8 +72,6 @@ abstract class RedisQueueBatchHandler
//每次从列表取100
//每次从列表取100
$arr
=
$this
->
redis
->
lRange
(
$this
->
queue_name
,
0
,
self
::
BATCH_DEAL_NUM
-
1
);
$arr
=
$this
->
redis
->
lRange
(
$this
->
queue_name
,
0
,
self
::
BATCH_DEAL_NUM
-
1
);
//取完 从队列删掉
$this
->
redis
->
lTrim
(
$this
->
queue_name
,
count
(
$arr
),
-
1
);
//数据格式化
//数据格式化
$formatArr
=
array_map
(
function
(
$item
){
$formatArr
=
array_map
(
function
(
$item
){
return
json_decode
(
$item
,
true
);
return
json_decode
(
$item
,
true
);
...
@@ -81,15 +79,17 @@ abstract class RedisQueueBatchHandler
...
@@ -81,15 +79,17 @@ abstract class RedisQueueBatchHandler
try
{
try
{
//具体批处理逻辑
//具体批处理逻辑
$this
->
batchDeal
(
$formatArr
);
$this
->
batchDeal
(
$formatArr
);
//取完 从队列删掉
$this
->
redis
->
lTrim
(
$this
->
queue_name
,
count
(
$arr
),
-
1
);
}
catch
(
\Throwable
$exception
){
}
catch
(
\Throwable
$exception
){
//错误码为100 重新推到队列
//错误码为100 重新推到队列
if
(
$exception
->
getCode
()
==
self
::
ERROR_RETRY_CODE
){
if
(
$exception
->
getCode
()
==
self
::
ERROR_RETRY_CODE
){
if
(
$this
->
retry
<
self
::
MAX_RETRY_TIMES
){
//重试次数不超过3次
if
(
$this
->
retry
<
self
::
MAX_RETRY_TIMES
){
//重试次数不超过3次
$this
->
backToQueue
(
$arr
);
//
$this->backToQueue($arr);
$this
->
retry
++
;
$this
->
retry
++
;
}
else
{
}
else
{
$this
->
redis
->
lTrim
(
$this
->
queue_name
,
count
(
$arr
),
-
1
);
$this
->
retry
=
0
;
//重置当前次数
$this
->
retry
=
0
;
//重置当前次数
$this
->
errorWriteToFile
(
$formatArr
,
$exception
);
$this
->
errorWriteToFile
(
$formatArr
,
$exception
);
}
}
...
...
src/Middleware/AuthorizeMiddleware.php
0 → 100644
View file @
7651af98
<?php
namespace
Meibuyu\Micro\Middleware
;
use
FastRoute\Dispatcher
;
use
Hyperf\HttpServer\Router\DispatcherFactory
;
use
Hyperf\Utils\ApplicationContext
;
use
Meibuyu\Micro\Model\Auth
;
use
Meibuyu\Micro\Service\Interfaces\User\AuthenticationServiceInterface
;
use
Psr\Http\Message\ResponseInterface
;
use
Psr\Http\Message\ServerRequestInterface
;
use
Psr\Http\Server\MiddlewareInterface
;
use
Psr\Http\Server\RequestHandlerInterface
;
use
Hyperf\Di\Annotation\Inject
;
class
AuthorizeMiddleware
implements
MiddlewareInterface
{
/**
* @Inject()
* @var AuthenticationServiceInterface
*/
private
$authorizationService
;
public
function
process
(
ServerRequestInterface
$request
,
RequestHandlerInterface
$handler
)
:
ResponseInterface
{
$path
=
$request
->
getUri
()
->
getPath
();
$token
=
token
();
$applicationName
=
env
(
'APP_NAME'
);
$method
=
$request
->
getMethod
();
if
(
empty
(
$path
))
return
$handler
->
handle
(
$request
);
//获取对应的 path 对应的权限,如果 path 是不需要登录鉴权,直接返回
$passed
=
$this
->
authRouter
(
$applicationName
,
$path
,
$method
,
$token
);
if
(
$passed
)
{
return
$handler
->
handle
(
$request
);
}
return
response
()
->
withStatus
(
403
)
->
json
(
[
'code'
=>
403
,
'msg'
=>
"您没有访问接口的权限,请检查后再操作"
]);
//鉴权失败,错误码 403 forbidden
//path 是需要登录鉴权的,判断当前用户是佛有对应 path 的权限
}
/**
* 获取对应路由的权限,调用 RPC 服务
* @param $applicationName
* @param $route
* @param $token
* @return bool
*/
protected
function
authRouter
(
$applicationName
,
$path
,
$method
,
$token
)
:
bool
{
$userId
=
$this
->
getUserIdByToken
(
$token
);
$route
=
$this
->
getRouterByPath
(
$path
,
$method
);
if
(
empty
(
$route
))
return
true
;
//说明没有匹配到路由,直接 pass,后续执行一定会返回 404, 这里也可以直接 返回 404
return
$this
->
authorizationService
->
authByRouter
(
$applicationName
,
$route
,
$method
,
$userId
);
}
/**
* 根据 path 和 method 获取对应的 router
* @param string $path
* @param string $method
* @return array|string
*/
private
function
getRouterByPath
(
string
$path
,
string
$method
)
:
string
{
$factory
=
ApplicationContext
::
getContainer
()
->
get
(
DispatcherFactory
::
class
);
$dispatcher
=
$factory
->
getDispatcher
(
'http'
);
$routerMatched
=
$dispatcher
->
dispatch
(
$method
,
$path
);
$founded
=
$routerMatched
[
0
];
if
(
$founded
!=
Dispatcher
::
FOUND
)
return
''
;
//说明没有匹配上路由,可以直接 return 404 not found
$handler
=
$routerMatched
[
1
];
return
$handler
->
route
;
}
/**
* 根据 token 获取对应的 user_id
* @param $token
* @return int|mixed
*/
protected
function
getUserIdByToken
(
$token
)
{
if
(
empty
(
$token
))
return
0
;
$user
=
redis
()
->
get
(
$token
);
if
(
!
$user
)
return
0
;
$userArr
=
\json_decode
(
$user
,
true
);
return
!
empty
(
$userArr
[
'id'
])
?
$userArr
[
'id'
]
:
0
;
}
}
\ No newline at end of file
src/Service/BaseService.php
View file @
7651af98
...
@@ -12,6 +12,9 @@ use Exception;
...
@@ -12,6 +12,9 @@ use Exception;
use
Hyperf\DbConnection\Model\Model
;
use
Hyperf\DbConnection\Model\Model
;
use
Meibuyu\Micro\Helper
;
use
Meibuyu\Micro\Helper
;
/**
* @deprecated 此类废弃,在之后的版本会被删除
*/
class
BaseService
class
BaseService
{
{
/**
/**
...
...
src/Service/Interfaces/AppServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces
;
namespace
Meibuyu\Micro\Service\Interfaces
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\App\AppServiceInterface
*/
interface
AppServiceInterface
interface
AppServiceInterface
{
{
...
...
src/Service/Interfaces/BaseInfoServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces
;
namespace
Meibuyu\Micro\Service\Interfaces
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\User\BaseInfoServiceInterface
*/
interface
BaseInfoServiceInterface
interface
BaseInfoServiceInterface
{
{
...
...
src/Service/Interfaces/DatacenterServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces
;
namespace
Meibuyu\Micro\Service\Interfaces
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Datacenter\DatacenterServiceInterface
*/
interface
DatacenterServiceInterface
interface
DatacenterServiceInterface
{
{
...
...
src/Service/Interfaces/DingTalk/DingDepartmentServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\DingTalk
;
namespace
Meibuyu\Micro\Service\Interfaces\DingTalk
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Message\DingTalk\DingDepartmentServiceInterface
*/
interface
DingDepartmentServiceInterface
interface
DingDepartmentServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/DingTalk/DingMessageServiceInterface.php
View file @
7651af98
...
@@ -10,6 +10,10 @@ namespace Meibuyu\Micro\Service\Interfaces\DingTalk;
...
@@ -10,6 +10,10 @@ namespace Meibuyu\Micro\Service\Interfaces\DingTalk;
use
phpDocumentor\Reflection\Types\Mixed_
;
use
phpDocumentor\Reflection\Types\Mixed_
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Message\DingTalk\DingMessageServiceInterface
*/
interface
DingMessageServiceInterface
interface
DingMessageServiceInterface
{
{
...
...
src/Service/Interfaces/DingTalk/DingUserServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\DingTalk
;
namespace
Meibuyu\Micro\Service\Interfaces\DingTalk
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Message\DingTalk\DingUserServiceInterface
*/
interface
DingUserServiceInterface
interface
DingUserServiceInterface
{
{
/** 通过用户id获取单个用户信息
/** 通过用户id获取单个用户信息
...
...
src/Service/Interfaces/DispatchPlanServiceInterface.php
View file @
7651af98
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
namespace
Meibuyu\Micro\Service\Interfaces
;
namespace
Meibuyu\Micro\Service\Interfaces
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Store\DispatchPlanServiceInterface
*/
interface
DispatchPlanServiceInterface
interface
DispatchPlanServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/File/FileServiceInterface.php
View file @
7651af98
<?php
<?php
namespace
Meibuyu\Micro\Service\Interfaces\File
;
namespace
Meibuyu\Micro\Service\Interfaces\File
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\File\FileServiceInterface
*/
interface
FileServiceInterface
interface
FileServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/Flow/GetConnectModuleServiceInterface.php
View file @
7651af98
...
@@ -3,7 +3,10 @@
...
@@ -3,7 +3,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Flow
;
namespace
Meibuyu\Micro\Service\Interfaces\Flow
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Flow\GetConnectModuleServiceInterface
*/
interface
GetConnectModuleServiceInterface
interface
GetConnectModuleServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/Flow/ProcessFormServiceInterface.php
View file @
7651af98
...
@@ -3,7 +3,10 @@
...
@@ -3,7 +3,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Flow
;
namespace
Meibuyu\Micro\Service\Interfaces\Flow
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Flow\ProcessFormServiceInterface
*/
interface
ProcessFormServiceInterface
interface
ProcessFormServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/Logistics/LogisticsServiceInterface.php
View file @
7651af98
...
@@ -3,7 +3,10 @@
...
@@ -3,7 +3,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Logistics
;
namespace
Meibuyu\Micro\Service\Interfaces\Logistics
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Logistics\LogisticsServiceInterface
*/
interface
LogisticsServiceInterface
interface
LogisticsServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/Operation/OperationServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Operation
;
namespace
Meibuyu\Micro\Service\Interfaces\Operation
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Operation\OperationServiceInterface
*/
interface
OperationServiceInterface
interface
OperationServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/Order/ShopifyOrderServiceInterface.php
View file @
7651af98
...
@@ -10,6 +10,10 @@ namespace Meibuyu\Micro\Service\Interfaces\Order;
...
@@ -10,6 +10,10 @@ namespace Meibuyu\Micro\Service\Interfaces\Order;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Order\ShopifyOrderServiceInterface
*/
interface
ShopifyOrderServiceInterface
interface
ShopifyOrderServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/Order/StockUpServiceInterface.php
View file @
7651af98
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Order
;
namespace
Meibuyu\Micro\Service\Interfaces\Order
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Order\StockUpServiceInterface
*/
interface
StockUpServiceInterface
interface
StockUpServiceInterface
{
{
/**
/**
...
@@ -10,4 +14,18 @@ interface StockUpServiceInterface
...
@@ -10,4 +14,18 @@ interface StockUpServiceInterface
* @return mixed
* @return mixed
*/
*/
public
function
stockIntoUpdateStatus
(
$stockNo
)
:
bool
;
public
function
stockIntoUpdateStatus
(
$stockNo
)
:
bool
;
/**
* 跟进物流单号
* @param $logisticsNo
* @return array
*/
public
function
getStockUpInfoByLogisticsNo
(
$logisticsNo
)
:
array
;
/**
*
* @param $sourceNo
* @return array
*/
public
function
getStockUpInfoByOrderNo
(
$sourceNo
)
:
array
;
}
}
src/Service/Interfaces/Order/SubOrderServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Order
;
namespace
Meibuyu\Micro\Service\Interfaces\Order
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Order\SubOrderServiceInterface
*/
interface
SubOrderServiceInterface
interface
SubOrderServiceInterface
{
{
...
...
src/Service/Interfaces/Product/MaterialServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\MaterialServiceInterface
*/
interface
MaterialServiceInterface
interface
MaterialServiceInterface
{
{
...
...
src/Service/Interfaces/Product/PlatformProductChildServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\PlatformProductChildServiceInterface
*/
interface
PlatformProductChildServiceInterface
interface
PlatformProductChildServiceInterface
{
{
...
...
src/Service/Interfaces/Product/PlatformProductServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\PlatformProductServiceInterface
*/
interface
PlatformProductServiceInterface
interface
PlatformProductServiceInterface
{
{
...
...
src/Service/Interfaces/Product/ProductChildServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\ProductChildServiceInterface
*/
interface
ProductChildServiceInterface
interface
ProductChildServiceInterface
{
{
...
...
src/Service/Interfaces/Product/ProductServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\ProductServiceInterface
*/
interface
ProductServiceInterface
interface
ProductServiceInterface
{
{
...
...
src/Service/Interfaces/Product/ShopifyProductServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
namespace
Meibuyu\Micro\Service\Interfaces\Product
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\ShopifyProductServiceInterface
*/
interface
ShopifyProductServiceInterface
interface
ShopifyProductServiceInterface
{
{
...
...
src/Service/Interfaces/Product/ShopifyServiceInterface.php
View file @
7651af98
...
@@ -11,6 +11,10 @@ namespace Meibuyu\Micro\Service\Interfaces\Product;
...
@@ -11,6 +11,10 @@ namespace Meibuyu\Micro\Service\Interfaces\Product;
use
Exception
;
use
Exception
;
use
Meibuyu\Micro\Exceptions\RpcException
;
use
Meibuyu\Micro\Exceptions\RpcException
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\ShopifyServiceInterface
*/
interface
ShopifyServiceInterface
interface
ShopifyServiceInterface
{
{
...
...
src/Service/Interfaces/ProductChildServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces
;
namespace
Meibuyu\Micro\Service\Interfaces
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Product\ProductChildServiceInterface
*/
interface
ProductChildServiceInterface
interface
ProductChildServiceInterface
{
{
...
...
src/Service/Interfaces/Production/ProductionServiceInterface.php
View file @
7651af98
...
@@ -4,6 +4,10 @@ namespace Meibuyu\Micro\Service\Interfaces\Production;
...
@@ -4,6 +4,10 @@ namespace Meibuyu\Micro\Service\Interfaces\Production;
use
Meibuyu\Micro\Exceptions\HttpResponseException
;
use
Meibuyu\Micro\Exceptions\HttpResponseException
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Production\ProductionServiceInterface
*/
interface
ProductionServiceInterface
interface
ProductionServiceInterface
{
{
...
...
src/Service/Interfaces/Purchase/PurchaseDoneServiceInterface.php
View file @
7651af98
...
@@ -4,6 +4,10 @@
...
@@ -4,6 +4,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Purchase
;
namespace
Meibuyu\Micro\Service\Interfaces\Purchase
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Purchase\PurchaseDoneServiceInterface
*/
interface
PurchaseDoneServiceInterface
interface
PurchaseDoneServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/Purchase/PurchaseTaskServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Purchase
;
namespace
Meibuyu\Micro\Service\Interfaces\Purchase
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Purchase\PurchaseTaskServiceInterface
*/
interface
PurchaseTaskServiceInterface
interface
PurchaseTaskServiceInterface
{
{
...
...
src/Service/Interfaces/Store/StoreMaterialServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\Store
;
namespace
Meibuyu\Micro\Service\Interfaces\Store
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Store\StoreMaterialServiceInterface
*/
interface
StoreMaterialServiceInterface
interface
StoreMaterialServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/StoreServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces
;
namespace
Meibuyu\Micro\Service\Interfaces
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\Store\StoreServiceInterface
*/
interface
StoreServiceInterface
interface
StoreServiceInterface
{
{
/**
/**
...
...
src/Service/Interfaces/User/AccessServiceInterface.php
View file @
7651af98
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
namespace
Meibuyu\Micro\Service\Interfaces\User
;
namespace
Meibuyu\Micro\Service\Interfaces\User
;
/**
* @deprecated 此接口废弃,在之后的版本会被删除
* 请引入meibuyu/rpc组件,使用Meibuyu\Rpc\Service\Interfaces\User\AccessServiceInterface
*/
interface
AccessServiceInterface
interface
AccessServiceInterface
{
{
...
...
src/Service/Interfaces/User/AuthenticationServiceInterface.php
0 → 100644
View file @
7651af98
<?php
/**
* Created by PhpStorm.
* User: zero
* Date: 2020/5/26
* Time: 15:17
*/
namespace
Meibuyu\Micro\Service\Interfaces\User
;
interface
AuthenticationServiceInterface
{
/**
* 获取对应用户能够看到的菜单
* @param string $applicationName
* @param integer $userId
* @return array
*/
public
function
getMenus
(
$applicationName
,
$userId
)
:
array
;
/**
* 获取对应用户的菜单权限
* @param string $applicationName 应用名称
* @param integer $userId 用户 ID
* @return array
*/
public
function
getButtons
(
$applicationName
,
$userId
)
:
array
;
/**
* 获取对应路由的接口权限结果
* @param $route string 路由名字
* @param $applicationName string 应用名字
* @param $method string 请求方法
* @param $userId integer 用户 ID
* @return bool
*/
public
function
authByRouter
(
$applicationName
,
$route
,
$method
,
$userId
)
:
bool
;
}
src/Shopify/lib/AbstractShopify.php
View file @
7651af98
...
@@ -64,10 +64,19 @@ abstract class AbstractShopify
...
@@ -64,10 +64,19 @@ abstract class AbstractShopify
$this
->
pluralizeKey
=
$this
->
pluralizeKey
?:
$this
->
resourceKey
.
's'
;
$this
->
pluralizeKey
=
$this
->
pluralizeKey
?:
$this
->
resourceKey
.
's'
;
$this
->
resourceUrl
=
(
$parentResourceUrl
?
"
$parentResourceUrl
/"
:
$config
[
'api_url'
])
.
$this
->
pluralizeKey
.
(
$this
->
id
?
"/
{
$this
->
id
}
"
:
''
);
$this
->
resourceUrl
=
(
$parentResourceUrl
?
"
$parentResourceUrl
/"
:
$config
[
'api_url'
])
.
$this
->
pluralizeKey
.
(
$this
->
id
?
"/
{
$this
->
id
}
"
:
''
);
$this
->
httpRequestJson
=
make
(
CurlHttpRequestJson
::
class
);
$this
->
httpRequestJson
=
make
(
CurlHttpRequestJson
::
class
);
if
(
isset
(
$config
[
'api_password'
]))
{
if
(
isset
(
$config
[
'is_private_app'
])
&&
$config
[
'is_private_app'
]
==
false
)
{
$this
->
httpHeaders
[
'X-Shopify-Access-Token'
]
=
$config
[
'api_password'
];
// 如果不是私人应用,则使用访问令牌
}
elseif
(
!
isset
(
$config
[
'api_password'
]))
{
if
(
isset
(
$config
[
'access_token'
]))
{
throw
new
Exception
(
"请设置api_password值"
);
$this
->
httpHeaders
[
'X-Shopify-Access-Token'
]
=
$config
[
'access_token'
];
}
elseif
(
!
isset
(
$config
[
'access_token'
]))
{
throw
new
Exception
(
"请设置access_token值"
);
}
}
else
{
if
(
isset
(
$config
[
'api_password'
]))
{
$this
->
httpHeaders
[
'X-Shopify-Access-Token'
]
=
$config
[
'api_password'
];
}
elseif
(
!
isset
(
$config
[
'api_password'
]))
{
throw
new
Exception
(
"请设置api_password值"
);
}
}
}
}
}
...
...
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