ios_app/Shared/Models/Post.swift
2025-08-13 14:50:50 +03:00

47 lines
1.9 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Foundation
struct PostIDWrapper: Identifiable {
let id: UUID
}
struct Post: Identifiable, Codable {
let id: UUID // Уникальный идентификатор поста
let title: String? // Название поста
let description: String? // Описание поста
let media: [MediaItem] // Массив медиафайлов
let mediaOrder: [UUID]? // Порядок отображения медиа
let thumbnailID: UUID // Превью
let duration: Double? // Длительность видео/аудио
let createdAt: Date // Дата создания
let updatedAt: Date // Дата обновления
let views: Int // Просмотры
let likes: Int // Лайки
let saves: Int // В сохранённом
let commentsCount: Int // Кол-во комментариев
let isLikedByCurrentUser: Bool // Лайк текущим юзером
let isSavedByCurrentUser: Bool // Сохранено текущим юзером
let authorID: UUID // Автор
let authorUsername: String // Имя пользователя автора
let hashtags: [String]? // Хэштеги
let location: String? // Гео
let languageCode: [String]? // Язык
let accessLevel: AccessLevel // Доступ (публичный и т.п.)
}
enum MediaType: String, Codable {
case photo
case live
case video
}
struct MediaItem: Identifiable, Codable {
let id: UUID
let type: MediaType
}
enum AccessLevel: String, Codable {
case `public`
case friends
case archive
}