-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 Update data models due to API changes
- Adjusted data models to align with the updated api structure.
- Loading branch information
Showing
8 changed files
with
122 additions
and
106 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
128 changes: 36 additions & 92 deletions
128
APIService/Sources/HomeAPISupport/Mocks/HomeProductResponse.json
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 |
---|---|---|
@@ -1,92 +1,36 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8809288634967_001.jpg", | ||
"price": 2500, | ||
"name": "BR)레인보우샤베트과즙워터500ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 2, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8809288635315_003.jpg", | ||
"price": 2500, | ||
"name": "BR)망고탱고과즙워터500ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 3, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8809288634974_001.jpg", | ||
"price": 2500, | ||
"name": "BR)피치요거트과즙워터500ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 4, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8806002010861_865.jpg", | ||
"price": 5000, | ||
"name": "광동)헛개파워100ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 5, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8806011416005_001.JPG", | ||
"price": 5000, | ||
"name": "동아)모닝케어D100ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 6, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8806011415992_001.JPG", | ||
"price": 5000, | ||
"name": "동아)모닝케어H100ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 7, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8809556566891_001.jpg", | ||
"price": 5000, | ||
"name": "서영)모닝이즈백100ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 8, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8809125061857_002.jpg", | ||
"price": 5000, | ||
"name": "종근당)헛개땡큐골드100ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 9, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8809329050015_018.jpg", | ||
"price": 5000, | ||
"name": "천지개벽)숙취해소음료100ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
}, | ||
{ | ||
"id": 10, | ||
"date": "2024:01", | ||
"image_url": "https://image.woodongs.com/imgsvr/item/GD_8801013777260_001.jpg", | ||
"price": 5000, | ||
"name": "큐원)상쾌환부스터100ML", | ||
"promotion": "1+1", | ||
"convenienceStore": "GS25" | ||
} | ||
] | ||
{ | ||
"count": 3, | ||
"has_more": true, | ||
"results": [ | ||
{ | ||
"name": "MDS)베이컨까르보나라파스타", | ||
"img": "https://www.7-eleven.co.kr/upload/product/8805684/009026.1.jpg", | ||
"price": 4100, | ||
"store": "7-ELEVEn", | ||
"tag": "2+1", | ||
"proinfo": 0, | ||
"date": "2024-02-01T10:11:47Z", | ||
"id": 84683 | ||
}, | ||
{ | ||
"name": "MDS)투움바파스타230g", | ||
"img": "https://www.7-eleven.co.kr/upload/product/8805684/003307.1.jpg", | ||
"price": 4100, | ||
"store": "7-ELEVEn", | ||
"tag": "2+1", | ||
"proinfo": 0, | ||
"date": "2024-02-01T10:11:47Z", | ||
"id": 84684 | ||
}, | ||
{ | ||
"name": "MDS)미트파스타230g", | ||
"img": "https://www.7-eleven.co.kr/upload/product/8805684/005813.1.jpg", | ||
"price": 4100, | ||
"store": "7-ELEVEn", | ||
"tag": "2+1", | ||
"proinfo": 0, | ||
"date": "2024-02-01T10:11:47Z", | ||
"id": 84685 | ||
} | ||
] | ||
} |
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,14 @@ | ||
// | ||
// Paginatable.swift | ||
// | ||
// | ||
// Created by 홍승현 on 2/23/24. | ||
// | ||
|
||
public protocol Paginatable { | ||
associatedtype Model | ||
var count: Int { get } | ||
var hasMore: Bool { get } | ||
|
||
var results: [Model] { get } | ||
} |
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,19 @@ | ||
// | ||
// Paginated.swift | ||
// | ||
// | ||
// Created by 홍승현 on 2/23/24. | ||
// | ||
|
||
/// 페이징 처리가 들어가는 모델의 경우 해당 모델을 사용합니다. | ||
public struct Paginated<Model>: Paginatable { | ||
public let count: Int | ||
public let hasMore: Bool | ||
public let results: [Model] | ||
|
||
public init(count: Int, hasMore: Bool, results: [Model]) { | ||
self.count = count | ||
self.hasMore = hasMore | ||
self.results = results | ||
} | ||
} |
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
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