chore: core 多模块骨架

This commit is contained in:
AndyChen1024
2026-09-14 21:10:44 +08:00
parent 295efac07c
commit 4fe0a26432
14 changed files with 294 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import Foundation
/// 一个打卡习惯(对应 Android 端 Habit)。
public struct Habit: Identifiable, Hashable, Sendable {
public let id: String
public let title: String
/// 备注 / 目标描述。
public let detail: String
/// 今日是否已打卡。
public let isCheckedInToday: Bool
/// 连续打卡天数。
public let streakDays: Int
public init(
id: String,
title: String,
detail: String,
isCheckedInToday: Bool,
streakDays: Int
) {
self.id = id
self.title = title
self.detail = detail
self.isCheckedInToday = isCheckedInToday
self.streakDays = streakDays
}
}

View File

@@ -0,0 +1,19 @@
import Foundation
/// Home 页面的聚合数据(对应 Android 端 HomeData)。
public struct HomeData: Identifiable, Hashable, Sendable {
public let id: String
/// 顶部问候语,例如「早上好,Andy」。
public let greeting: String
/// 今日打卡摘要,例如「已完成 2 / 4」。
public let summary: String
/// 今日待打卡的习惯列表。
public let habits: [Habit]
public init(id: String, greeting: String, summary: String, habits: [Habit]) {
self.id = id
self.greeting = greeting
self.summary = summary
self.habits = habits
}
}