课表组件、天气组件全面升级。
This commit is contained in:
lincube
2026-03-03 15:09:49 +08:00
parent 2d09c1aca2
commit 478ed115a1
47 changed files with 4876 additions and 771 deletions

View File

@@ -38,6 +38,12 @@ public sealed class AppSettingsSnapshot
public string WeatherLocationQuery { get; set; } = string.Empty;
public string WeatherExcludedAlerts { get; set; } = string.Empty;
public string WeatherIconPackId { get; set; } = "FluentRegular";
public bool WeatherNoTlsRequests { get; set; }
public List<string> TopStatusComponentIds { get; set; } = [];
public List<string> PinnedTaskbarActions { get; set; } =
@@ -61,4 +67,8 @@ public sealed class AppSettingsSnapshot
public int CurrentDesktopSurfaceIndex { get; set; } = 0;
public List<DesktopComponentPlacementSnapshot> DesktopComponentPlacements { get; set; } = [];
public List<ImportedClassScheduleSnapshot> ImportedClassSchedules { get; set; } = [];
public string ActiveImportedClassScheduleId { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
namespace LanMontainDesktop.Models;
public sealed record ClassIslandScheduleReadResult(
bool Success,
ClassIslandScheduleSnapshot? Snapshot,
string? ErrorCode = null,
string? ErrorMessage = null,
IReadOnlyList<string>? Warnings = null)
{
public static ClassIslandScheduleReadResult Ok(
ClassIslandScheduleSnapshot snapshot,
IReadOnlyList<string>? warnings = null)
{
return new ClassIslandScheduleReadResult(true, snapshot, Warnings: warnings);
}
public static ClassIslandScheduleReadResult Fail(
string errorCode,
string errorMessage,
IReadOnlyList<string>? warnings = null)
{
return new ClassIslandScheduleReadResult(false, null, errorCode, errorMessage, warnings);
}
}
public sealed record ClassIslandScheduleSnapshot(
string SourceRootPath,
string ProfilePath,
string ProfileFileName,
DateTimeOffset LoadedAt,
ClassIslandScheduleCycleRule CycleRule,
Guid? SelectedClassPlanGroupId,
Guid? TempClassPlanGroupId,
bool IsTempClassPlanGroupEnabled,
DateOnly? TempClassPlanGroupExpireDate,
int TempClassPlanGroupType,
Guid? TempClassPlanId,
DateOnly? TempClassPlanSetupDate,
bool IsOverlayClassPlanEnabled,
Guid? OverlayClassPlanId,
IReadOnlyDictionary<Guid, ClassIslandSubject> Subjects,
IReadOnlyDictionary<Guid, ClassIslandTimeLayout> TimeLayouts,
IReadOnlyDictionary<Guid, ClassIslandClassPlan> ClassPlans,
IReadOnlyDictionary<DateOnly, Guid> OrderedSchedules,
IReadOnlyDictionary<Guid, ClassIslandClassPlanGroup> ClassPlanGroups);
public sealed record ClassIslandScheduleCycleRule(
DateOnly? SingleWeekStartDate,
int MultiWeekRotationMaxCycle,
IReadOnlyList<int> MultiWeekRotationOffset);
public sealed record ClassIslandSubject(
Guid Id,
string Name,
string? Initial,
string? TeacherName,
bool? IsOutDoor);
public sealed record ClassIslandTimeLayout(
Guid Id,
string Name,
IReadOnlyList<ClassIslandTimeLayoutItem> Items);
public sealed record ClassIslandTimeLayoutItem(
TimeSpan StartTime,
TimeSpan EndTime,
int TimeType,
bool IsHiddenByDefault,
Guid? DefaultSubjectId,
string? BreakName);
public sealed record ClassIslandClassPlan(
Guid Id,
string Name,
Guid TimeLayoutId,
ClassIslandTimeRule Rule,
IReadOnlyList<ClassIslandClassInfo> Classes,
bool IsEnabled,
bool IsOverlay,
Guid? OverlaySourceId,
DateOnly? OverlaySetupDate,
Guid? AssociatedGroupId);
public sealed record ClassIslandClassInfo(
Guid? SubjectId,
bool IsEnabled);
public sealed record ClassIslandTimeRule(
int WeekDay,
int WeekCountDiv,
int WeekCountDivTotal);
public sealed record ClassIslandClassPlanGroup(
Guid Id,
string Name,
bool IsGlobal);
public sealed record ClassIslandResolvedClassPlan(
Guid ClassPlanId,
ClassIslandClassPlan ClassPlan,
string Source);

View File

@@ -0,0 +1,10 @@
namespace LanMontainDesktop.Models;
public sealed class ImportedClassScheduleSnapshot
{
public string Id { get; set; } = string.Empty;
public string DisplayName { get; set; } = string.Empty;
public string FilePath { get; set; } = string.Empty;
}

View File

@@ -18,6 +18,7 @@ public sealed record WeatherCurrentCondition(
double? WindSpeedKph,
double? WindDirectionDegree,
int? WeatherCode,
bool? IsDaylight,
string? WeatherText);
public sealed record WeatherDailyForecast(