增加基础配置
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-07-12 11:59:33 +08:00
parent fb50096e66
commit 8a3ab17b25
44 changed files with 1599 additions and 66 deletions

View File

@ -0,0 +1,54 @@
<?php
/**
* Author: ykxiao
* Date: 2025/7/11
* Time: 下午9:00
* Description:
*
* (c) ykxiao <yk_9001@hotmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
declare(strict_types=1);
namespace App\Context;
use Hyperf\Context\Context;
/**
* Author: ykxiao
* Date: 2025/7/11
* Time: 下午9:00
* Description: ApiUrlContext. 请求url上下文
*
* (c) ykxiao <yk_9001@hotmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
class ApiUrlContext
{
private const string API_URL_KEY = 'api_url';
public static function setApiUrl(string $apiUrl): void
{
Context::set(self::API_URL_KEY, $apiUrl);
}
public static function getApiUrl(): ?string
{
return Context::get(self::API_URL_KEY);
}
public static function clearApiUrl(): void
{
Context::set(self::API_URL_KEY, null);
}
public static function hasApiUrl(): bool
{
return Context::has(self::API_URL_KEY);
}
}