ReadKeep/readeck/Data/API/DTOs/BookmarkDto.swift
Ilyas Hallak da7bb1613c feat: Add bookmark creation functionality and WebView dark mode support
- Add CREATE API endpoint for new bookmarks with POST request
- Implement CreateBookmarkRequestDto and CreateBookmarkResponseDto
- Create AddBookmarkView with form validation and clipboard integration
- Add AddBookmarkViewModel with URL validation and label parsing
- Implement CreateBookmarkUseCase with convenience methods
- Extend BookmarksRepository with createBookmark method returning server message
- Add comprehensive error handling for bookmark creation scenarios
- Integrate WebView dark mode support with CSS variables and system color scheme
- Add dynamic theme switching based on iOS appearance settings
- Enhance WebView styling with iOS-native colors and typography
- Fix BookmarksView refresh after bookmark creation
- Add floating action button and sheet presentation for adding bookmarks
- Implement form validation with real-time feedback
- Add clipboard URL detection and paste functionality
2025-06-11 23:02:58 +02:00

67 lines
1.6 KiB
Swift

import Foundation
struct BookmarkDto: Codable {
let id: String
let title: String
let url: String
let href: String
let description: String
let authors: [String]
let created: String
let published: String?
let updated: String
let siteName: String
let site: String
let readingTime: Int?
let wordCount: Int?
let hasArticle: Bool
let isArchived: Bool
let isDeleted: Bool
let isMarked: Bool
let labels: [String]
let lang: String?
let loaded: Bool
let readProgress: Int
let documentType: String
let state: Int
let textDirection: String
let type: String
let resources: BookmarkResourcesDto
enum CodingKeys: String, CodingKey {
case id, title, url, href, description, authors, created, published, updated, site, labels, lang, loaded, state, type
case siteName = "site_name"
case readingTime = "reading_time"
case wordCount = "word_count"
case hasArticle = "has_article"
case isArchived = "is_archived"
case isDeleted = "is_deleted"
case isMarked = "is_marked"
case readProgress = "read_progress"
case documentType = "document_type"
case textDirection = "text_direction"
case resources
}
}
struct BookmarkResourcesDto: Codable {
let article: ResourceDto?
let icon: ImageResourceDto?
let image: ImageResourceDto?
let log: ResourceDto?
let props: ResourceDto?
let thumbnail: ImageResourceDto?
}
struct ResourceDto: Codable {
let src: String
}
struct ImageResourceDto: Codable {
let src: String
let height: Int
let width: Int
}