diff --git a/src/config.php b/src/config.php index 8441b71..2ac26ba 100644 --- a/src/config.php +++ b/src/config.php @@ -8,14 +8,36 @@ class Config { + /** + * 请求地址 + * @var string + */ protected $baseUrl = 'https://sms.crmeb.net/api/v2'; + /** + * + * 缓存前缀 + * @var string + */ protected $baseCachePrefix = 'sms-crmeb-yihaotong-'; + /** + * 缓存超时时间 + * @var int + */ protected $baseCacheTimeout = 300; + + /** + * 缓存过期时间 + * @var int + */ protected $expires = 3600; + /** + * redis 配置 + * @var array + */ protected $redis = [ 'host' => '127.0.0.1', 'port' => '6379', @@ -27,30 +49,55 @@ class Config 'timeout' => 0 ]; + /** + * 设置基础请求地址 + * @param string $baseUrl + * @return $this + */ public function setBaseUrl(string $baseUrl) { $this->baseUrl = $baseUrl; return $this; } + /** + * 设置缓存前缀 + * @param string $baseCachePrefix + * @return $this + */ public function setBaseCachePrefix(string $baseCachePrefix) { $this->baseCachePrefix = $baseCachePrefix; return $this; } + /** + * 设置缓存超时时间 + * @param int $baseCacheTimeout + * @return $this + */ public function setBaseCacheTimeout(int $baseCacheTimeout) { $this->baseCacheTimeout = $baseCacheTimeout; return $this; } + /** + * 设置过期时间 + * @param int $expires + * @return $this + */ public function setExpires(int $expires) { $this->expires = $expires; return $this; } + /** + * 设置redis 配置 + * @param array $redis + * @return $this + */ public function setRedis(array $redis) { $this->redis = $redis; @@ -58,6 +105,7 @@ public function setRedis(array $redis) } /** + * 转数组 * @return array */ public function toArray()