-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
163 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using DsNext.Infrastructure.Options; | ||
|
||
namespace XinjingdailyBot.Infrastructure.Options; | ||
public sealed record ChannelOption : IXjbConfig | ||
{ | ||
static string? IXjbConfig.SectionName => "Channel"; | ||
|
||
/// <summary> | ||
/// 审核群组 | ||
/// </summary> | ||
public string ReviewGroup { get; set; } = ""; | ||
/// <summary> | ||
/// 日志频道 | ||
/// </summary> | ||
public string LogChannel { get; set; } = ""; | ||
/// <summary> | ||
/// 是否使用审核日志模式 | ||
/// 启用: 审核后在审核群直接删除消息, 审核记录发送至审核日志频道 | ||
/// 禁用: 审核后再审核群保留消息记录, 审核日志频道不使用 | ||
/// </summary> | ||
public bool UseReviewLogMode { get; set; } | ||
/// <summary> | ||
/// 频道评论区群组 | ||
/// </summary> | ||
public string CommentGroup { get; set; } = ""; | ||
/// <summary> | ||
/// 闲聊区群组 | ||
/// </summary> | ||
public string SubGroup { get; set; } = ""; | ||
/// <summary> | ||
/// 通过频道 | ||
/// </summary> | ||
public string AcceptChannel { get; set; } = ""; | ||
/// <summary> | ||
/// 第二频道 | ||
/// </summary> | ||
public string SecondChannel { get; set; } = ""; | ||
/// <summary> | ||
/// 第二频道评论区 | ||
/// </summary> | ||
public string SecondCommentGroup { get; set; } = ""; | ||
/// <summary> | ||
/// 拒稿频道 | ||
/// </summary> | ||
public string RejectChannel { get; set; } = ""; | ||
/// <summary> | ||
/// 管理日志频道 | ||
/// 用于存储封禁/解封日志 | ||
/// </summary> | ||
public string AdminLogChannel { get; set; } = ""; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using DsNext.Infrastructure.Options; | ||
|
||
namespace XinjingdailyBot.Infrastructure.Options; | ||
public sealed record DatabaseConfig : IXjbConfig | ||
{ | ||
static string? IXjbConfig.SectionName => "Database"; | ||
|
||
/// <summary> | ||
/// 是否生成数据库字段(数据库结构变动时需要打开), 默认 false | ||
/// </summary> | ||
public bool Generate { get; set; } | ||
/// <summary> | ||
/// 打印SQL日志 | ||
/// </summary> | ||
public bool LogSQL { get; set; } | ||
/// <summary> | ||
/// 是否使用MySQL数据库, true:MySQL, false:SQLite | ||
/// </summary> | ||
[Obsolete("使用DbType代替")] | ||
public bool UseMySQL { get; set; } | ||
/// <summary> | ||
/// 数据库类型 | ||
/// </summary> | ||
public string? DbType { get; set; } | ||
/// <summary> | ||
/// 数据库连接字符串(DbType选Custom时生效) | ||
/// </summary> | ||
public string? DbConnectionString { get; set; } | ||
/// <summary> | ||
/// MySQL主机IP | ||
/// </summary> | ||
public string? DbHost { get; set; } | ||
/// <summary> | ||
/// MySQL主机端口 | ||
/// </summary> | ||
public uint DbPort { get; set; } | ||
/// <summary> | ||
/// MySQL数据库名称 | ||
/// </summary> | ||
public string? DbName { get; set; } | ||
/// <summary> | ||
/// MySQL用户名 | ||
/// </summary> | ||
public string? DbUser { get; set; } | ||
/// <summary> | ||
/// MySQL密码 | ||
/// </summary> | ||
public string? DbPassword { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
namespace DsNext.Infrastructure.Options; | ||
public interface IXjbConfig | ||
{ | ||
/// <summary> | ||
/// 节名称, 留空使用根节点 | ||
/// </summary> | ||
abstract static string? SectionName { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters