mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-22 03:32:47 +08:00
32 lines
460 B
PHP
32 lines
460 B
PHP
<?php
|
|
|
|
namespace App\Caches;
|
|
|
|
use App\Repos\App as AppRepo;
|
|
|
|
class App extends Cache
|
|
{
|
|
|
|
protected $lifetime = 365 * 86400;
|
|
|
|
public function getLifetime()
|
|
{
|
|
return $this->lifetime;
|
|
}
|
|
|
|
public function getKey($id = null)
|
|
{
|
|
return "app:{$id}";
|
|
}
|
|
|
|
public function getContent($id = null)
|
|
{
|
|
$appRepo = new AppRepo();
|
|
|
|
$result = $appRepo->findByAppKey($id);
|
|
|
|
return $result ?: null;
|
|
}
|
|
|
|
}
|