Skip to content

Commit e8a8641

Browse files
committed
fix(windows): move HourlyForecast out of the platform conditional
The struct is consumed by WindowsWeather and TokenUsage on Windows; placing it inside the #else branch hid it from that build.
1 parent 77544d4 commit e8a8641

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Sources/TokenClock/Services/WeatherService.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ import CoreLocation
66
import FoundationNetworking // swift-corelibs 在 Linux 把 URLSession 拆到独立模块
77
#endif
88

9+
/// 逐小时预报(3小时间隔)
10+
struct HourlyForecast: Sendable {
11+
let time: String
12+
let tempC: Int
13+
let emoji: String
14+
let description: String
15+
}
16+
917
#if os(Windows)
1018
/// Windows only needs the shared parser. Network I/O lives in WindowsWeather and WinHTTP, so
1119
/// no URLSession symbol (and therefore no FoundationNetworking.dll) enters the executable.
@@ -15,14 +23,6 @@ enum WeatherService {
1523
}
1624
}
1725
#else
18-
/// 逐小时预报(3小时间隔)
19-
struct HourlyForecast: Sendable {
20-
let time: String
21-
let tempC: Int
22-
let emoji: String
23-
let description: String
24-
}
25-
2626
/// 天气服务:自动定位统一使用公网 IP,不请求系统位置权限
2727
/// 使用 JSON 格式解析,支持 weatherCode 精确映射 + 逐小时预报
2828
@MainActor

0 commit comments

Comments
 (0)