forked from codesquad-members-2021/sidedish
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Category.swift | ||
// Side-dish | ||
// | ||
// Created by 조중윤 on 2021/04/19. | ||
// | ||
|
||
import Foundation | ||
|
||
struct Category: Codable { | ||
let categoryID, name: String | ||
let items: [Item] | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case categoryID = "category_id" | ||
case name, items | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Item.swift | ||
// Side-dish | ||
// | ||
// Created by 조중윤 on 2021/04/19. | ||
// | ||
|
||
import Foundation | ||
|
||
struct Item: Codable { | ||
let detailHash: String | ||
let image: String | ||
let alt: String | ||
let deliveryType: [DeliveryType] | ||
let title: String | ||
let description: String | ||
let nPrice: String? | ||
let sPrice: String | ||
let badge: [Badge]? | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case detailHash = "detail_hash" | ||
case image, alt | ||
case deliveryType = "delivery_type" | ||
case title, description | ||
case nPrice = "n_price" | ||
case sPrice = "s_price" | ||
case badge | ||
} | ||
} | ||
|
||
enum DeliveryType: String, Codable { | ||
case dawnDelivery = "새벽배송" | ||
case nationDelivery = "전국택배" | ||
} | ||
|
||
enum Badge: String, Codable { | ||
case eventPrice = "이벤트특가" | ||
case launchingPrice = "론칭특가" | ||
case bestPrice = "베스트" | ||
} |