ReadKeep/URLShare/SimpleAPIDTOs.swift
Ilyas Hallak ef8ebd6f00 refactor: Optimize server connectivity with Clean Architecture
- Replace ServerConnectivity with CheckServerReachabilityUseCase
- Add InfoApiClient for /api/info endpoint
- Implement ServerInfoRepository with 30s cache TTL and 5s rate limiting
- Update ShareBookmarkViewModel to use ShareExtensionServerCheck manager
- Add server reachability check in AppViewModel on app start
- Update OfflineSyncManager to use new UseCase
- Extend SimpleAPI with checkServerReachability for Share Extension
2025-10-19 09:43:47 +02:00

48 lines
1.1 KiB
Swift

import Foundation
public struct ServerInfoDto: Codable {
public let version: String
public let buildDate: String?
public let userAgent: String?
public enum CodingKeys: String, CodingKey {
case version
case buildDate = "build_date"
case userAgent = "user_agent"
}
}
public struct CreateBookmarkRequestDto: Codable {
public let labels: [String]?
public let title: String?
public let url: String
public init(url: String, title: String? = nil, labels: [String]? = nil) {
self.url = url
self.title = title
self.labels = labels
}
}
public struct CreateBookmarkResponseDto: Codable {
public let message: String
public let status: Int
}
public struct BookmarkLabelDto: Codable, Identifiable {
public var id: String { href }
public let name: String
public let count: Int
public let href: String
public enum CodingKeys: String, CodingKey {
case name, count, href
}
public init(name: String, count: Int, href: String) {
self.name = name
self.count = count
self.href = href
}
}