Files
singlechat/ios/YpChat/Data/Models.swift
Torsten Schulz (local) bfe28a25fa
All checks were successful
Deploy SingleChat / deploy (push) Successful in 40s
android app, extension of stats
2026-08-10 14:03:34 +02:00

106 lines
2.4 KiB
Swift
Executable File

import Foundation
// MARK: - Session / User (RestApi.kt / Models.kt)
struct UserDto: Codable, Equatable, Sendable {
var sessionId: String?
var userName: String = ""
var gender: String = ""
var age: Int = 0
var country: String = ""
var isoCountryCode: String = ""
}
struct SessionResponse: Codable, Equatable, Sendable {
var loggedIn: Bool = false
var sessionId: String?
var user: UserDto?
}
struct LogoutResponse: Codable, Equatable, Sendable {
var success: Bool = false
}
// MARK: - Chat / Listen (Socket / Models.kt)
struct ChatMessageDto: Codable, Equatable, Sendable {
var from: String = ""
var to: String?
var message: String = ""
var messageId: String?
var timestamp: String = ""
var read: Bool = false
var isImage: Bool = false
var imageType: String?
var imageUrl: String?
var imageCode: String?
}
struct HistoryItemDto: Codable, Equatable, Sendable {
var userName: String = ""
var lastMessage: ChatMessageDto?
}
struct InboxItemDto: Codable, Equatable, Sendable {
var userName: String = ""
var unreadCount: Int = 0
}
// MARK: - REST (Models.kt)
struct CountryOption: Equatable, Sendable {
var englishName: String
var displayName: String
var isoCode: String
}
struct FeedbackItemDto: Codable, Equatable, Sendable {
var id: String = ""
var name: String?
var age: Int?
var country: String?
var gender: String?
var comment: String = ""
var createdAt: String = ""
}
struct FeedbackResponse: Codable, Equatable, Sendable {
var items: [FeedbackItemDto] = []
var admin: Bool = false
}
struct FeedbackAdminStatusResponse: Codable, Equatable, Sendable {
var authenticated: Bool = false
var username: String?
}
struct FeedbackRequest: Codable, Equatable, Sendable {
var name: String = ""
var age: Int?
var country: String = ""
var gender: String = ""
var comment: String = ""
}
struct FeedbackAdminLoginRequest: Codable, Equatable, Sendable {
var username: String = ""
var password: String = ""
}
struct PartnerLinkDto: Codable, Equatable, Sendable {
var pageName: String = ""
var url: String = ""
enum CodingKeys: String, CodingKey {
case pageName = "Page Name"
case url
}
}
struct ImageUploadResponse: Codable, Equatable, Sendable {
var success: Bool = false
var code: String?
var url: String?
var error: String?
}