123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?php
- /**
- * Created by PhpStorm.
- * User: JZ
- * Date: 2019/7/18
- * Time: 20:58
- */
- class HttpHeader{
- private $accessToken;
- private $agentToken;
- private $timestamp;
- private $signature;
- private $version;
- private $nonce;
- private $agentSignautre;
- public function __construct() {
- $count = func_num_args();
- $args=func_get_args();
- if (method_exists($this,$f='__construct'.$count)) {
- call_user_func_array(array($this,$f),$args);
- }
- }
- public function __construct5($accessToken, $timestamp, $signature, $version, $nonce) {
- $this->accessToken = $accessToken;
- $this->timestamp = $timestamp;
- $this->signature = $signature;
- $this->version = $version;
- $this->nonce = $nonce;
- }
- /**
- * HttpHeader constructor.
- * @param $timestamp
- * @param $accessToken
- * @param $signature
- * @param $version
- */
- public function __construct7($accessToken, $agentToken, $timestamp, $signature, $agentSignautre, $version, $nonce) {
- $this->accessToken = $accessToken;
- $this->agentToken = $agentToken;
- $this->timestamp = $timestamp;
- $this->signature = $signature;
- $this->agentSignautre = $agentSignautre;
- $this->version = $version;
- $this->nonce = $nonce;
- }
- public function getArray(){
- $headers = array(
- 'x-qys-open-accesstoken:'.$this->accessToken,
- 'x-qys-open-signature:'.$this->signature,
- 'x-qys-open-timestamp:'.$this->timestamp,
- 'User-Agent:'.'qiyuesuo-php-sdk',
- 'version:'.SDKClient::SDK_VERSION,
- 'x-qys-open-nonce:'.$this->nonce
- );
- return $headers;
- }
- public function getAgentArray(){
- $headers = array(
- 'x-qys-open-accesstoken:'.$this->accessToken,
- 'x-qys-open-signature:'.$this->signature,
- 'x-qys-open-agentaccesstoken:'.$this->agentToken,
- 'x-qys-open-agentsignature:'.$this->agentSignautre,
- 'x-qys-open-timestamp:'.$this->timestamp,
- 'User-Agent:'.'qiyuesuo-php-sdk',
- 'version:'.SDKClient::SDK_VERSION,
- 'x-qys-open-nonce:'.$this->nonce
- );
- return $headers;
- }
- /**
- * @return mixed
- */
- public function getTimestamp()
- {
- return $this->timestamp;
- }
- /**
- * @return mixed
- */
- public function getAccessToken()
- {
- return $this->accessToken;
- }
- /**
- * @return mixed
- */
- public function getSignature()
- {
- return $this->signature;
- }
- /**
- * @return mixed
- */
- public function getVersion()
- {
- return $this->version;
- }
- /**
- * @return mixed
- */
- public function getNonce()
- {
- return $this->nonce;
- }
- }
|