ChandanAppdesk

Character Model

Sep 25th, 2023 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 2.69 KB | Software | 0 0
  1. // MARK: - Character
  2. struct Character: Codable {
  3.     let charID: Int
  4.     let charName: String
  5.     let charThumbnail: String
  6.     let charThumbnailCropped: String
  7.     let dateAdded: String
  8.     let follow: Bool
  9.     let entertainmentName: String?
  10.     let entertainmentID, addedBy: Int?
  11.     let products: [ProductElement]?
  12.     let posts: [Post]?
  13.  
  14.     enum CodingKeys: String, CodingKey {
  15.         case charID = "Char_id"
  16.         case charName = "Char_name"
  17.         case charThumbnail = "Char_thumbnail"
  18.         case dateAdded = "Date_Added"
  19.         case entertainmentName = "entertainment_name"
  20.         case entertainmentID = "Entertainment_id"
  21.         case addedBy = "Added_by"
  22.         case follow
  23.         case charThumbnailCropped = "Char_thumbnail_cropped"
  24.         case products, posts
  25.     }
  26. }
  27.  
  28. // MARK: - Post
  29. struct Post: Codable {
  30.     let postID: Int
  31.     let postDescription: String
  32.     let postThumbnail: String
  33.     let postThumbnailCropped: String?
  34.     let entertainmentID, characterID: Int
  35.  
  36.     enum CodingKeys: String, CodingKey {
  37.         case postID = "Post_id"
  38.         case postDescription = "Post_description"
  39.         case postThumbnail = "Post_thumbnail"
  40.         case entertainmentID = "Entertainment_id"
  41.         case characterID = "Character_id"
  42.         case postThumbnailCropped = "Post_thumbnail_cropped"
  43.     }
  44. }
  45.  
  46. // MARK: - Product
  47. struct ProductElement: Codable {
  48.     let prodID: Int
  49.     let prodThumbnail: String
  50.     let imageURL: String?
  51.     let customProdID: String?
  52.     let  brand, prodName, productDescription: String?
  53.     let color, category, subCategory: String?
  54.     let detailCategory: String?
  55.     let dateAdded, episodeName: String?
  56.     let exactMatch, saved: Bool
  57.     let pStatus: Bool?
  58.     let entertainmentCategory: String?
  59.     let prodEntertainment: Int?
  60.     let prodCharacter, addedBy: Int?
  61.  
  62.     enum CodingKeys: String, CodingKey {
  63.         case prodID = "Prod_id"
  64.         case prodThumbnail = "Prod_thumbnail"
  65.         case imageURL = "Image_url"
  66.         case customProdID = "Custom_prod_id"
  67.         case brand = "Brand"
  68.         case prodName = "Prod_name"
  69.         case productDescription = "Description"
  70.         case color = "Color"
  71.         case category = "Category"
  72.         case subCategory = "Sub_Category"
  73.         case detailCategory = "Detail_Category"
  74.         case dateAdded = "Date_Added"
  75.         case episodeName = "Episode_name"
  76.         case pStatus = "P_status"
  77.         case exactMatch = "Exact_match"
  78.         case entertainmentCategory = "Entertainment_category"
  79.         case prodEntertainment = "Prod_Entertainment"
  80.         case prodCharacter = "Prod_Character"
  81.         case addedBy = "Added_by"
  82.         case saved = "saved"
  83.     }
  84. }
  85.  
  86.  
Advertisement
Add Comment
Please, Sign In to add comment