-
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.
[ FEATURE ] 홈 화면 레이아웃 및 기능 구현
- Loading branch information
Showing
41 changed files
with
1,650 additions
and
10 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
21 changes: 21 additions & 0 deletions
21
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_banner.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "dbcdc6be1ee94fcb8996bcbab2f3bb8a.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+115 KB
...OS-FE/Assets.xcassets/home_banner.imageset/dbcdc6be1ee94fcb8996bcbab2f3bb8a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_book_sample.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "f776735287f493e66ca5ffbed348e5ae.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+578 KB
.../Assets.xcassets/home_book_sample.imageset/f776735287f493e66ca5ffbed348e5ae.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_bell.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Group 27.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.53 KB
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_bell.imageset/Group 27.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_down.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Vector-4.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.38 KB
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_down.imageset/Vector-4.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_menu.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Group 9.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+960 Bytes
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_menu.imageset/Group 9.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_pen.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Group 29.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.16 KB
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_pen.imageset/Group 29.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_search.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Group 10.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.11 KB
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_search.imageset/Group 10.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_star.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Vector-2.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.25 KB
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_icon_star.imageset/Vector-2.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
UMC-7th-TEAM-IOS-FE/Assets.xcassets/home_logo.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Frame 18.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file not shown.
21 changes: 21 additions & 0 deletions
21
UMC-7th-TEAM-IOS-FE/Assets.xcassets/placeholder.imageset/Contents.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "e8368380-f79c-47c5-8679-fde01743aaf5.jpeg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+58.1 KB
.../Assets.xcassets/placeholder.imageset/e8368380-f79c-47c5-8679-fde01743aaf5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,50 @@ | ||
// | ||
// HomeCellModel.swift | ||
// UMC-7th-TEAM-IOS-FE | ||
// | ||
// Created by 선가연 on 12/2/24. | ||
// | ||
|
||
import Foundation | ||
|
||
struct BannerModel: RequiredCellProtocol { | ||
var imageView: String | ||
} | ||
|
||
struct BookResponse: Codable { | ||
let isSuccess: Bool | ||
let code: String | ||
let message: String | ||
let result: BookResult | ||
} | ||
|
||
struct BookResult: Codable { | ||
let isLast: Bool | ||
let totalPage: Int | ||
let totalElement: Int | ||
let books: [BookModel] | ||
} | ||
|
||
struct BookModel: Codable { | ||
let id: Int | ||
let imgUrl: String | ||
let title: String | ||
let author: String | ||
let publisher: String | ||
let rating: Double? | ||
let reviewCount: Int | ||
let description: String | ||
} | ||
|
||
final class HomeCellModel { | ||
static let bannerData: [BannerModel] = [ | ||
BannerModel(imageView: "home_banner") | ||
] | ||
|
||
// 인기 도서 더미 데이터 | ||
static let bestSellerData: [BookModel] = [ | ||
BookModel(id: 1, imgUrl: "https://shopping-phinf.pstatic.net/main_3244161/32441616160.20220518182757.jpg?type=w300", title: "작별하지 않는다", author: "한강", publisher: "문학동네", rating: 4.9, reviewCount: 2, description: "작가의 성숙한 의식과 단정하고 묵직하면서도 정갈한 문체로 쓰인 작품이다. 현실의 대비와 비교에 의한 의식이 돋"), | ||
BookModel(id: 2, imgUrl: "https://shopping-phinf.pstatic.net/main_3244161/32441616160.20220518182757.jpg?type=w300", title: "작별하지 않는다", author: "한강", publisher: "문학동네", rating: 4.3, reviewCount: 5, description: "작가의 성숙한 의식과 단정하고 묵직하면서도 정갈한 문체로 쓰인 작품이다. 현실의 대비와 비교에 의한 의식이 돋"), | ||
BookModel(id: 3, imgUrl: "https://shopping-phinf.pstatic.net/main_3244161/32441616160.20220518182757.jpg?type=w300", title: "작별하지 않는다", author: "한강", publisher: "문학동네", rating: 4.1, reviewCount: 3, description: "작가의 성숙한 의식과 단정하고 묵직하면서도 정갈한 문체로 쓰인 작품이다. 현실의 대비와 비교에 의한 의식이 돋"), | ||
] | ||
} |
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,36 @@ | ||
// | ||
// HomeService.swift | ||
// UMC-7th-TEAM-IOS-FE | ||
// | ||
// Created by 선가연 on 12/2/24. | ||
// | ||
|
||
import Foundation | ||
import Alamofire | ||
|
||
final class HomeService { | ||
|
||
static let shared = HomeService() | ||
private init() {} | ||
|
||
// 추천 도서 | ||
func fetchBooks(sortedBy: String, page: Int, size: Int, completion: @escaping (Result<[BookModel], Error>) -> Void) { | ||
let baseURL = "http://ec2-3-39-137-120.ap-northeast-2.compute.amazonaws.com:8080/books" | ||
let parameters: [String: Any] = [ | ||
"sortedBy": sortedBy, | ||
"page": page, | ||
"size": size | ||
] | ||
|
||
AF.request(baseURL, method: .get, parameters: parameters) | ||
.validate() | ||
.responseDecodable(of: BookResponse.self) { response in | ||
switch response.result { | ||
case .success(let data): | ||
completion(.success(data.result.books)) | ||
case .failure(let error): | ||
completion(.failure(error)) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.