Phase 1: data models and local storage service
- Add Models: Category, ToolItem (IsValid runtime-only, not stored), AppConfig - Add Services: IDataService + JsonDataService (JSON load/save) - Path validation on Load(): File.Exists check, logs warning for missing paths - Startup: auto-calls dataService.Load() to load config
This commit is contained in:
27
PersonalToolBox/Models/AppConfig.cs
Normal file
27
PersonalToolBox/Models/AppConfig.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace PersonalToolBox.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 应用全局配置,对应 config.json 的顶层结构
|
||||
/// </summary>
|
||||
public class AppConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 主题模式 (Dark / Light)
|
||||
/// </summary>
|
||||
public string Theme { get; set; } = "Dark";
|
||||
|
||||
/// <summary>
|
||||
/// 是否开机自启动
|
||||
/// </summary>
|
||||
public bool AutoStart { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 工具分类列表
|
||||
/// </summary>
|
||||
public List<Category> Categories { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 工具项列表
|
||||
/// </summary>
|
||||
public List<ToolItem> Tools { get; set; } = new();
|
||||
}
|
||||
Reference in New Issue
Block a user