Skip to content

Commit

Permalink
增加version与locale传入AbstractApi对象中
Browse files Browse the repository at this point in the history
  • Loading branch information
Donny committed Apr 12, 2018
1 parent 7981d5c commit a01e0ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Core/Api/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ abstract class AbstractApi extends AbstractService

protected $_accessToken;
protected $_version;
protected $_locale;

/**
* 对accessToken的等级要求
Expand Down Expand Up @@ -99,6 +100,12 @@ public function getVersion(){
public function setVersion($v){
$this->_version = $v;
}
public function getLocale(){
return $this->_locale;
}
public function setLocale($v){
$this->_locale = $v;
}

/**
* 设置AccessToken
Expand Down
4 changes: 4 additions & 0 deletions src/Core/Api/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ static public function invoke($req)
$params = $req->getParams();
$appKey = $req->getAppKey();
$accessToken = $req->getAccessToken();
$version = $req->getVersion();
$locale = $req->getLocale();
//读取可用方法
self::_fetchValidMethod();
$apiConfigData = self::_parseRequestApiMethod($method);
Expand Down Expand Up @@ -405,6 +407,8 @@ static public function invoke($req)
$modObj->setAccessTokenRequiredLevel($level);
$modObj->initParams($validParams, $method);
$modObj->setAppKey($appKey);
$modObj->setVersion($version);
$modObj->setLocale($locale);
self::$apiLoggerService->setAccessMemberId(
self::$invokeId, $modObj->getUserMemberId()
);
Expand Down

0 comments on commit a01e0ef

Please sign in to comment.