Files
Woka_Native_iOS/WOKA/Home/Model/FavouriteListingDM.swift
BilalKhanWDI 1d6add0322 - Added DropDown
- Added api for show listing , made data model, updated the dropdown
- Added api for category, made data model
- Made the dynamic height tableview to show all the shows
- On fav add remove , will refresh the mylist screen
- Added default load on hindi
- On category selection change, updating the show list data
- Handled the fav category id as int, string , string seeprated with “,”
- Modifying my list with bookmark id with above
2024-06-19 20:07:47 +05:30

125 lines
4.6 KiB
Swift

//
// FavouriteListingDM.swift
// WOKA
//
// Created by MacBook Pro on 13/06/24.
//
import Foundation
// MARK: - FavouriteListingDM
struct FavouriteListingDM: Codable {
let result: ResultData?
// MARK: - Result
struct ResultData: Codable {
var showData: [ShowDatum]?
var videoData: [Datum]?
var gameData, audioData, singKaraokeData: [Datum]?
enum CodingKeys: String, CodingKey {
case showData = "show_data"
case videoData = "video_data"
case gameData = "game_data"
case audioData = "audio_data"
case singKaraokeData = "sing_karaoke_data"
}
// MARK: - Datum
struct Datum: Codable {
let id: Int?
let title, description: String?
let thumbnailPath: String?
let audioURL: String?
let categoryMasterID, ageRangeMasterID, tagsKeyword, releaseDate: String?
let languageMasterID: Int?
let genderMasterID, audioDuration, mediaID: String?
let contentMoreDetails: [ContentMoreDetail]?
var markAsFavourite, isLiked: Bool?
var viewsCount, likesCount, bookmarkCount: Int?
let bookmarkCategoryIDS: String?
let gameURL: String?
let screenOrientation: String?
let videoURL: String?
let duration: String?
enum CodingKeys: String, CodingKey {
case id, title, description
case thumbnailPath = "thumbnail_path"
case audioURL = "audio_url"
case categoryMasterID = "category_master_id"
case ageRangeMasterID = "age_range_master_id"
case tagsKeyword = "tags_keyword"
case releaseDate = "release_date"
case languageMasterID = "language_master_id"
case genderMasterID = "gender_master_id"
case audioDuration = "audio_duration"
case mediaID = "media_id"
case contentMoreDetails = "content_more_details"
case markAsFavourite = "mark_as_favourite"
case isLiked = "is_liked"
case viewsCount = "views_count"
case likesCount = "likes_count"
case bookmarkCount = "bookmark_count"
case bookmarkCategoryIDS = "bookmark_category_ids"
case gameURL = "game_url"
case screenOrientation = "screen_orientation"
case videoURL = "video_url"
case duration
}
}
// MARK: - ContentMoreDetail
struct ContentMoreDetail: Codable {
let id, contentID, postType, languageMasterID: Int?
let title, description: String?
let url: String?
let tagsKeywords: String?
enum CodingKeys: String, CodingKey {
case id
case contentID = "content_id"
case postType = "post_type"
case languageMasterID = "language_master_id"
case title, description, url
case tagsKeywords = "tags_keywords"
}
}
// MARK: - ShowDatum
struct ShowDatum: Codable {
let id: Int?
let title, description: String?
let thumbnailPath: String?
let showType: String?
let totalSeasons, totalEpisodes: Int?
let categoryMasterID, ageRangeMasterID, genderMasterID: String?
let contentMoreDetails: [ContentMoreDetail]?
var markAsFavourite, isLiked: Bool?
var likesCount : Int?
let viewsCount, bookmarkCount: Int?
var bookmarkCategoryIDS: String?
enum CodingKeys: String, CodingKey {
case id, title, description
case thumbnailPath = "thumbnail_path"
case showType = "show_type"
case totalSeasons = "total_seasons"
case totalEpisodes = "total_episodes"
case categoryMasterID = "category_master_id"
case ageRangeMasterID = "age_range_master_id"
case genderMasterID = "gender_master_id"
case contentMoreDetails = "content_more_details"
case markAsFavourite = "mark_as_favourite"
case isLiked = "is_liked"
case viewsCount = "views_count"
case likesCount = "likes_count"
case bookmarkCount = "bookmark_count"
case bookmarkCategoryIDS = "bookmark_category_ids"
}
}
}
}