模块化 AppStore 并完善素材管理与个人空间设置。
将会话、权限、位置、收款与排队存储拆分为独立模块,同步更新各 ViewModel 与单元测试,并补充素材管理 UI 与个人空间设置交互。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -213,9 +213,9 @@ final class StatisticsViewModel {
|
||||
let storeId = try resolveStoreId()
|
||||
return try await api.storeSummary(storeId: storeId, range: range)
|
||||
case .scenicAdmin:
|
||||
return try await api.scenicAdminSummary(scenicId: AppStore.shared.currentScenicId, range: range)
|
||||
return try await api.scenicAdminSummary(scenicId: AppStore.shared.session.currentScenicId, range: range)
|
||||
default:
|
||||
return try await api.photographerSummary(scenicId: AppStore.shared.currentScenicId, range: range)
|
||||
return try await api.photographerSummary(scenicId: AppStore.shared.session.currentScenicId, range: range)
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,14 +231,14 @@ final class StatisticsViewModel {
|
||||
)
|
||||
case .scenicAdmin:
|
||||
return try await api.scenicAdminDaily(
|
||||
scenicId: AppStore.shared.currentScenicId,
|
||||
scenicId: AppStore.shared.session.currentScenicId,
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
page: currentPage
|
||||
)
|
||||
default:
|
||||
return try await api.photographerDaily(
|
||||
scenicId: AppStore.shared.currentScenicId,
|
||||
scenicId: AppStore.shared.session.currentScenicId,
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
page: currentPage
|
||||
@ -247,11 +247,11 @@ final class StatisticsViewModel {
|
||||
}
|
||||
|
||||
private var currentRole: AppRoleCode {
|
||||
AppStore.shared.currentAppRole ?? .photographer
|
||||
AppStore.shared.session.currentAppRole ?? .photographer
|
||||
}
|
||||
|
||||
private func resolveStoreId() throws -> Int {
|
||||
let storeId = AppStore.shared.currentStoreId
|
||||
let storeId = AppStore.shared.session.currentStoreId
|
||||
guard storeId > 0 else {
|
||||
throw StatisticsFlowError.missingStore
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user