feat: 重造领域模型并对齐 android(home/checkin/plan/profile/session)
This commit is contained in:
53
IosClientKit/Sources/CoreModel/Profile.swift
Normal file
53
IosClientKit/Sources/CoreModel/Profile.swift
Normal file
@@ -0,0 +1,53 @@
|
||||
import Foundation
|
||||
|
||||
/// 用户所在的小组分组。
|
||||
public struct ClassGroup: Identifiable, Hashable, Sendable {
|
||||
public let period: String
|
||||
public let group: String
|
||||
public let role: String
|
||||
|
||||
public var id: String { period }
|
||||
|
||||
public init(period: String, group: String, role: String) {
|
||||
self.period = period
|
||||
self.group = group
|
||||
self.role = role
|
||||
}
|
||||
}
|
||||
|
||||
/// 个人资料。
|
||||
public struct UserProfile: Identifiable, Hashable, Sendable {
|
||||
public let displayName: String
|
||||
public let name: String
|
||||
public let studentId: String
|
||||
public let phone: String?
|
||||
public let role: String
|
||||
public let group: String?
|
||||
public let loginType: String
|
||||
public let avatarUrl: String?
|
||||
public let classGroups: [ClassGroup]
|
||||
|
||||
public var id: String { studentId }
|
||||
|
||||
public init(
|
||||
displayName: String,
|
||||
name: String,
|
||||
studentId: String,
|
||||
phone: String?,
|
||||
role: String,
|
||||
group: String?,
|
||||
loginType: String,
|
||||
avatarUrl: String?,
|
||||
classGroups: [ClassGroup]
|
||||
) {
|
||||
self.displayName = displayName
|
||||
self.name = name
|
||||
self.studentId = studentId
|
||||
self.phone = phone
|
||||
self.role = role
|
||||
self.group = group
|
||||
self.loginType = loginType
|
||||
self.avatarUrl = avatarUrl
|
||||
self.classGroups = classGroups
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user