Showing
1 changed file
with
381 additions
and
0 deletions
... | @@ -1105,6 +1105,7 @@ public class swiftApi { | ... | @@ -1105,6 +1105,7 @@ public class swiftApi { |
1105 | private var category_title: String? | 1105 | private var category_title: String? |
1106 | private var banner_img: String? | 1106 | private var banner_img: String? |
1107 | private var banner_title: String? | 1107 | private var banner_title: String? |
1108 | + private var unifiedCampaign: UnifiedCampaignModel? | ||
1108 | 1109 | ||
1109 | public init() { | 1110 | public init() { |
1110 | self.index_url = "" | 1111 | self.index_url = "" |
... | @@ -1131,6 +1132,7 @@ public class swiftApi { | ... | @@ -1131,6 +1132,7 @@ public class swiftApi { |
1131 | self.category_title = "" | 1132 | self.category_title = "" |
1132 | self.banner_img = "" | 1133 | self.banner_img = "" |
1133 | self.banner_title = "" | 1134 | self.banner_title = "" |
1135 | + self.unifiedCampaign = swiftApi.UnifiedCampaignModel() | ||
1134 | } | 1136 | } |
1135 | 1137 | ||
1136 | public init(dictionary: [String: Any]) { | 1138 | public init(dictionary: [String: Any]) { |
... | @@ -1146,6 +1148,7 @@ public class swiftApi { | ... | @@ -1146,6 +1148,7 @@ public class swiftApi { |
1146 | self.campaign_type = dictionary["campaign_type"] as? String? ?? "" | 1148 | self.campaign_type = dictionary["campaign_type"] as? String? ?? "" |
1147 | self.sorting = dictionary["sorting"] as? Int? ?? 0 | 1149 | self.sorting = dictionary["sorting"] as? Int? ?? 0 |
1148 | self.ccms = nil | 1150 | self.ccms = nil |
1151 | + self.unifiedCampaign = swiftApi.UnifiedCampaignModel() | ||
1149 | 1152 | ||
1150 | // let extra_fields = dictionary["extra_fields"] as? [String: Any]? ?? ["":""] | 1153 | // let extra_fields = dictionary["extra_fields"] as? [String: Any]? ?? ["":""] |
1151 | if let extra_fields = dictionary["extra_fields"] as? [String: Any] { | 1154 | if let extra_fields = dictionary["extra_fields"] as? [String: Any] { |
... | @@ -1388,6 +1391,15 @@ public class swiftApi { | ... | @@ -1388,6 +1391,15 @@ public class swiftApi { |
1388 | self.banner_title = newValue | 1391 | self.banner_title = newValue |
1389 | } | 1392 | } |
1390 | } | 1393 | } |
1394 | + | ||
1395 | + public var _unifiedCampaign: UnifiedCampaignModel? { | ||
1396 | + get { // getter | ||
1397 | + return self.unifiedCampaign | ||
1398 | + } | ||
1399 | + set(newValue) { //setter | ||
1400 | + self.unifiedCampaign = newValue | ||
1401 | + } | ||
1402 | + } | ||
1391 | } | 1403 | } |
1392 | 1404 | ||
1393 | public class CampaignDataModel { | 1405 | public class CampaignDataModel { |
... | @@ -2106,6 +2118,375 @@ public class swiftApi { | ... | @@ -2106,6 +2118,375 @@ public class swiftApi { |
2106 | 2118 | ||
2107 | } | 2119 | } |
2108 | 2120 | ||
2121 | + | ||
2122 | + public class UnifiedCampaignModel: Codable { | ||
2123 | + private var id: String? | ||
2124 | + private var title: String? | ||
2125 | + private var position: Int? | ||
2126 | + private var affiliatedId: String? | ||
2127 | + private var shortDescription: String? | ||
2128 | + private var longDescription: String? | ||
2129 | + private var isHot: Bool? | ||
2130 | + private var logoImagePath: String? | ||
2131 | + private var bigLogoImagePath: String? | ||
2132 | + private var days: Int? | ||
2133 | + private var dayText: String? | ||
2134 | + private var imagePath: String? | ||
2135 | + private var bigImagePath: String? | ||
2136 | + private var markerImagePath: String? | ||
2137 | + private var details: String? | ||
2138 | + private var locations: Array<UnifiedCampaignLocation>? | ||
2139 | + | ||
2140 | + public init() { | ||
2141 | + self.id = "" | ||
2142 | + self.title = "" | ||
2143 | + self.position = 0 | ||
2144 | + self.affiliatedId = "" | ||
2145 | + self.shortDescription = "" | ||
2146 | + self.longDescription = "" | ||
2147 | + self.isHot = false | ||
2148 | + self.logoImagePath = "" | ||
2149 | + self.bigLogoImagePath = "" | ||
2150 | + self.days = 0 | ||
2151 | + self.dayText = "" | ||
2152 | + self.imagePath = "" | ||
2153 | + self.bigImagePath = "" | ||
2154 | + self.markerImagePath = "" | ||
2155 | + self.details = "" | ||
2156 | + self.locations = [] | ||
2157 | + } | ||
2158 | + | ||
2159 | + public init(dictionary: [String: Any]) { | ||
2160 | + self.id = dictionary["id"] as? String? ?? "" | ||
2161 | + self.title = dictionary["title"] as? String? ?? "" | ||
2162 | + self.position = dictionary["position"] as? Int? ?? 0 | ||
2163 | + self.affiliatedId = dictionary["affiliatedId"] as? String? ?? "" | ||
2164 | + self.shortDescription = dictionary["shortDescription"] as? String? ?? "" | ||
2165 | + self.longDescription = dictionary["longDescription"] as? String? ?? "" | ||
2166 | + self.isHot = dictionary["isHot"] as? Bool? ?? false | ||
2167 | + self.logoImagePath = dictionary["logoImagePath"] as? String? ?? "" | ||
2168 | + self.bigLogoImagePath = dictionary["bigLogoImagePath"] as? String? ?? "" | ||
2169 | + self.days = dictionary["days"] as? Int? ?? 0 | ||
2170 | + self.dayText = dictionary["dayText"] as? String? ?? "" | ||
2171 | + self.imagePath = dictionary["imagePath"] as? String? ?? "" | ||
2172 | + self.bigImagePath = dictionary["bigImagePath"] as? String? ?? "" | ||
2173 | + self.markerImagePath = dictionary["markerImagePath"] as? String? ?? "" | ||
2174 | + self.details = dictionary["details"] as? String? ?? "" | ||
2175 | + | ||
2176 | + if let locationsData = dictionary["locations"] as? [[String : Any]?] { | ||
2177 | + var locationsArray:Array<UnifiedCampaignLocation> = [] | ||
2178 | + for item in locationsData { | ||
2179 | + if let itemDictionary = item { | ||
2180 | + let tempLocation = UnifiedCampaignLocation(dictionary: itemDictionary) | ||
2181 | + locationsArray.append(tempLocation) | ||
2182 | + } | ||
2183 | + } | ||
2184 | + self.locations = locationsArray | ||
2185 | + } else { | ||
2186 | + self.locations = [] | ||
2187 | + } | ||
2188 | + } | ||
2189 | + | ||
2190 | + public var _id: String { | ||
2191 | + get { // getter | ||
2192 | + return self.id ?? "" | ||
2193 | + } | ||
2194 | + set(newValue) { //setter | ||
2195 | + self.id = newValue | ||
2196 | + } | ||
2197 | + } | ||
2198 | + | ||
2199 | + public var _title: String { | ||
2200 | + get { // getter | ||
2201 | + return self.title ?? "" | ||
2202 | + } | ||
2203 | + set(newValue) { //setter | ||
2204 | + self.title = newValue | ||
2205 | + } | ||
2206 | + } | ||
2207 | + | ||
2208 | + public var _position: Int { | ||
2209 | + get { // getter | ||
2210 | + return self.position ?? 0 | ||
2211 | + } | ||
2212 | + set(newValue) { //setter | ||
2213 | + self.position = newValue | ||
2214 | + } | ||
2215 | + } | ||
2216 | + | ||
2217 | + public var _affiliatedId: String { | ||
2218 | + get { // getter | ||
2219 | + return self.affiliatedId ?? "" | ||
2220 | + } | ||
2221 | + set(newValue) { //setter | ||
2222 | + self.affiliatedId = newValue | ||
2223 | + } | ||
2224 | + } | ||
2225 | + | ||
2226 | + public var _shortDescription: String { | ||
2227 | + get { // getter | ||
2228 | + return self.shortDescription ?? "" | ||
2229 | + } | ||
2230 | + set(newValue) { //setter | ||
2231 | + self.shortDescription = newValue | ||
2232 | + } | ||
2233 | + } | ||
2234 | + | ||
2235 | + public var _longDescription: String { | ||
2236 | + get { // getter | ||
2237 | + return self.longDescription ?? "" | ||
2238 | + } | ||
2239 | + set(newValue) { //setter | ||
2240 | + self.longDescription = newValue | ||
2241 | + } | ||
2242 | + } | ||
2243 | + | ||
2244 | + public var _isHot: Bool { | ||
2245 | + get { // getter | ||
2246 | + return self.isHot ?? false | ||
2247 | + } | ||
2248 | + set(newValue) { //setter | ||
2249 | + self.isHot = newValue | ||
2250 | + } | ||
2251 | + } | ||
2252 | + | ||
2253 | + public var _logoImagePath: String { | ||
2254 | + get { // getter | ||
2255 | + return self.logoImagePath ?? "" | ||
2256 | + } | ||
2257 | + set(newValue) { //setter | ||
2258 | + self.logoImagePath = newValue | ||
2259 | + } | ||
2260 | + } | ||
2261 | + | ||
2262 | + public var _bigLogoImagePath: String { | ||
2263 | + get { // getter | ||
2264 | + return self.bigLogoImagePath ?? "" | ||
2265 | + } | ||
2266 | + set(newValue) { //setter | ||
2267 | + self.bigLogoImagePath = newValue | ||
2268 | + } | ||
2269 | + } | ||
2270 | + | ||
2271 | + public var _days: Int { | ||
2272 | + get { // getter | ||
2273 | + return self.days ?? 0 | ||
2274 | + } | ||
2275 | + set(newValue) { //setter | ||
2276 | + self.days = newValue | ||
2277 | + } | ||
2278 | + } | ||
2279 | + | ||
2280 | + public var _dayText: String { | ||
2281 | + get { // getter | ||
2282 | + return self.dayText ?? "" | ||
2283 | + } | ||
2284 | + set(newValue) { //setter | ||
2285 | + self.dayText = newValue | ||
2286 | + } | ||
2287 | + } | ||
2288 | + | ||
2289 | + public var _imagePath: String { | ||
2290 | + get { // getter | ||
2291 | + return self.imagePath ?? "" | ||
2292 | + } | ||
2293 | + set(newValue) { //setter | ||
2294 | + self.imagePath = newValue | ||
2295 | + } | ||
2296 | + } | ||
2297 | + | ||
2298 | + public var _bigImagePath: String { | ||
2299 | + get { // getter | ||
2300 | + return self.bigImagePath ?? "" | ||
2301 | + } | ||
2302 | + set(newValue) { //setter | ||
2303 | + self.bigImagePath = newValue | ||
2304 | + } | ||
2305 | + } | ||
2306 | + | ||
2307 | + public var _markerImagePath: String { | ||
2308 | + get { // getter | ||
2309 | + return self.markerImagePath ?? "" | ||
2310 | + } | ||
2311 | + set(newValue) { //setter | ||
2312 | + self.markerImagePath = newValue | ||
2313 | + } | ||
2314 | + } | ||
2315 | + | ||
2316 | + public var _details: String { | ||
2317 | + get { // getter | ||
2318 | + return self.details ?? "" | ||
2319 | + } | ||
2320 | + set(newValue) { //setter | ||
2321 | + self.details = newValue | ||
2322 | + } | ||
2323 | + } | ||
2324 | + | ||
2325 | + public var _locations: Array<UnifiedCampaignLocation> { | ||
2326 | + get { // getter | ||
2327 | + return self.locations ?? [] | ||
2328 | + } | ||
2329 | + set(newValue) { //setter | ||
2330 | + self.locations = newValue | ||
2331 | + } | ||
2332 | + } | ||
2333 | + | ||
2334 | + } | ||
2335 | + | ||
2336 | + public class UnifiedCampaignLocation: Codable { | ||
2337 | + private var id: String? | ||
2338 | + private var title: String? | ||
2339 | + private var address: String? | ||
2340 | + private var roadNumber: Int? | ||
2341 | + private var municipality: String? | ||
2342 | + private var telephone: String? | ||
2343 | + private var latitude: Double? | ||
2344 | + private var longitude: Double? | ||
2345 | + private var afiliateId: String? | ||
2346 | + private var url: String? | ||
2347 | + private var logoImage: String? | ||
2348 | + private var pinLogoImage: String? | ||
2349 | + | ||
2350 | + public init() { | ||
2351 | + self.id = "" | ||
2352 | + self.title = "" | ||
2353 | + self.address = "" | ||
2354 | + self.roadNumber = 0 | ||
2355 | + self.municipality = "" | ||
2356 | + self.telephone = "" | ||
2357 | + self.latitude = 0.0 | ||
2358 | + self.longitude = 0.0 | ||
2359 | + self.afiliateId = "" | ||
2360 | + self.url = "" | ||
2361 | + self.logoImage = "" | ||
2362 | + self.pinLogoImage = "" | ||
2363 | + } | ||
2364 | + | ||
2365 | + public init(dictionary: [String: Any]) { | ||
2366 | + self.id = dictionary["id"] as? String? ?? "" | ||
2367 | + self.title = dictionary["title"] as? String? ?? "" | ||
2368 | + self.address = dictionary["address"] as? String? ?? "" | ||
2369 | + self.roadNumber = dictionary["roadNumber"] as? Int? ?? 0 | ||
2370 | + self.municipality = dictionary["municipality"] as? String? ?? "" | ||
2371 | + self.telephone = dictionary["telephone"] as? String? ?? "" | ||
2372 | + self.latitude = dictionary["latitude"] as? Double? ?? 0.0 | ||
2373 | + self.longitude = dictionary["longitude"] as? Double? ?? 0.0 | ||
2374 | + self.afiliateId = dictionary["afiliateId"] as? String? ?? "" | ||
2375 | + self.url = dictionary["url"] as? String? ?? "" | ||
2376 | + self.logoImage = dictionary["logoImage"] as? String? ?? "" | ||
2377 | + self.pinLogoImage = dictionary["pinLogoImage"] as? String? ?? "" | ||
2378 | + } | ||
2379 | + | ||
2380 | + public var _id: String { | ||
2381 | + get { // getter | ||
2382 | + return self.id ?? "" | ||
2383 | + } | ||
2384 | + set(newValue) { //setter | ||
2385 | + self.id = newValue | ||
2386 | + } | ||
2387 | + } | ||
2388 | + | ||
2389 | + public var _title: String { | ||
2390 | + get { // getter | ||
2391 | + return self.title ?? "" | ||
2392 | + } | ||
2393 | + set(newValue) { //setter | ||
2394 | + self.title = newValue | ||
2395 | + } | ||
2396 | + } | ||
2397 | + | ||
2398 | + public var _address: String { | ||
2399 | + get { // getter | ||
2400 | + return self.address ?? "" | ||
2401 | + } | ||
2402 | + set(newValue) { //setter | ||
2403 | + self.address = newValue | ||
2404 | + } | ||
2405 | + } | ||
2406 | + | ||
2407 | + public var _roadNumber: Int { | ||
2408 | + get { // getter | ||
2409 | + return self.roadNumber ?? 0 | ||
2410 | + } | ||
2411 | + set(newValue) { //setter | ||
2412 | + self.roadNumber = newValue | ||
2413 | + } | ||
2414 | + } | ||
2415 | + | ||
2416 | + public var _municipality: String { | ||
2417 | + get { // getter | ||
2418 | + return self.municipality ?? "" | ||
2419 | + } | ||
2420 | + set(newValue) { //setter | ||
2421 | + self.municipality = newValue | ||
2422 | + } | ||
2423 | + } | ||
2424 | + | ||
2425 | + public var _telephone: String { | ||
2426 | + get { // getter | ||
2427 | + return self.telephone ?? "" | ||
2428 | + } | ||
2429 | + set(newValue) { //setter | ||
2430 | + self.telephone = newValue | ||
2431 | + } | ||
2432 | + } | ||
2433 | + | ||
2434 | + public var _latitude: Double { | ||
2435 | + get { // getter | ||
2436 | + return self.latitude ?? 0.0 | ||
2437 | + } | ||
2438 | + set(newValue) { //setter | ||
2439 | + self.latitude = newValue | ||
2440 | + } | ||
2441 | + } | ||
2442 | + | ||
2443 | + public var _longitude: Double { | ||
2444 | + get { // getter | ||
2445 | + return self.longitude ?? 0.0 | ||
2446 | + } | ||
2447 | + set(newValue) { //setter | ||
2448 | + self.longitude = newValue | ||
2449 | + } | ||
2450 | + } | ||
2451 | + | ||
2452 | + public var _afiliateId: String { | ||
2453 | + get { // getter | ||
2454 | + return self.afiliateId ?? "" | ||
2455 | + } | ||
2456 | + set(newValue) { //setter | ||
2457 | + self.afiliateId = newValue | ||
2458 | + } | ||
2459 | + } | ||
2460 | + | ||
2461 | + public var _url: String { | ||
2462 | + get { // getter | ||
2463 | + return self.url ?? "" | ||
2464 | + } | ||
2465 | + set(newValue) { //setter | ||
2466 | + self.url = newValue | ||
2467 | + } | ||
2468 | + } | ||
2469 | + | ||
2470 | + public var _logoImage: String { | ||
2471 | + get { // getter | ||
2472 | + return self.logoImage ?? "" | ||
2473 | + } | ||
2474 | + set(newValue) { //setter | ||
2475 | + self.logoImage = newValue | ||
2476 | + } | ||
2477 | + } | ||
2478 | + | ||
2479 | + public var _pinLogoImage: String { | ||
2480 | + get { // getter | ||
2481 | + return self.pinLogoImage ?? "" | ||
2482 | + } | ||
2483 | + set(newValue) { //setter | ||
2484 | + self.pinLogoImage = newValue | ||
2485 | + } | ||
2486 | + } | ||
2487 | + | ||
2488 | + } | ||
2489 | + | ||
2109 | // public func openCoupon(parent: UIView, coupon: CouponSetItemModel) -> UIViewController { | 2490 | // public func openCoupon(parent: UIView, coupon: CouponSetItemModel) -> UIViewController { |
2110 | // return UIHostingController(rootView: CouponView(parentView: parent, coupon: coupon)) | 2491 | // return UIHostingController(rootView: CouponView(parentView: parent, coupon: coupon)) |
2111 | // } | 2492 | // } | ... | ... |
-
Please register or login to post a comment