54 lines
1.3 KiB
Swift
54 lines
1.3 KiB
Swift
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
|
|
}
|
|
}
|