27 lines
1.2 KiB
C#
27 lines
1.2 KiB
C#
namespace Common.Notify
|
||
{
|
||
/// <summary>
|
||
/// 飞书自建应用配置(用于"手机号 → open_id"转换)
|
||
/// 飞书群机器人 webhook 只能发文本、无法用手机号 @ 人,必须借助自建应用凭证调通讯录接口换取 open_id。
|
||
/// 由 Program.cs 启动时从 appsettings.json 的 Feishu 节读入;未配置时相关功能自动降级。
|
||
/// </summary>
|
||
public static class FeishuConfig
|
||
{
|
||
/// <summary>飞书自建应用 App ID(cli_ 开头)</summary>
|
||
public static string AppId { get; private set; } = string.Empty;
|
||
|
||
/// <summary>飞书自建应用 App Secret</summary>
|
||
public static string AppSecret { get; private set; } = string.Empty;
|
||
|
||
/// <summary>是否已配置(未配置时手机号无法转 open_id,降级为仅支持直接填 open_id / all)</summary>
|
||
public static bool IsConfigured => !string.IsNullOrWhiteSpace(AppId) && !string.IsNullOrWhiteSpace(AppSecret);
|
||
|
||
/// <summary>初始化飞书应用配置</summary>
|
||
public static void Init(string appId, string appSecret)
|
||
{
|
||
AppId = appId ?? string.Empty;
|
||
AppSecret = appSecret ?? string.Empty;
|
||
}
|
||
}
|
||
}
|