-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
박스오피스 [STEP 2] hoon, MINT #110
base: ic_9_mint09
Are you sure you want to change the base?
Changes from 9 commits
ce294eb
7abc867
5976231
6ecdc10
9844b5a
c6ab997
e649324
40b7983
bb46ae0
8c8af63
bed67b1
02c528f
35eeb4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
.DS_Store | ||
|
||
# Created by https://www.toptal.com/developers/gitignore/api/xcode | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=xcode | ||
|
||
### Xcode ### | ||
## User settings | ||
xcuserdata/ | ||
|
||
## Xcode 8 and earlier | ||
*.xcscmblueprint | ||
*.xccheckout | ||
|
||
### Xcode Patch ### | ||
*.xcodeproj/* | ||
!*.xcodeproj/project.pbxproj | ||
!*.xcodeproj/xcshareddata/ | ||
!*.xcodeproj/project.xcworkspace/ | ||
!*.xcworkspace/contents.xcworkspacedata | ||
/*.gcno | ||
**/xcshareddata/WorkspaceSettings.xcsettings | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/xcode |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// NetworkError.swift | ||
// BoxOffice | ||
// | ||
// Created by 훈민트 on 2023/08/15. | ||
// | ||
|
||
enum NetworkError: Error { | ||
case dataTaskFail | ||
case responseCasting | ||
case invalidStatus | ||
case noData | ||
case invalidURL | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// Decodable+.swift | ||
// BoxOffice | ||
// | ||
// Created by 훈민트 on 2023/08/16. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Decodable { | ||
static func decode(data: Data) -> Self? { | ||
var result: Self? | ||
|
||
do { | ||
result = try JSONDecoder().decode(Self.self, from: data) | ||
} catch { | ||
print(error.localizedDescription) | ||
} | ||
|
||
return result | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 함수의 존재의 이유를 잘 모르겠어요! |
||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,143 @@ | ||||||
// | ||||||
// MovieInformation.swift | ||||||
// BoxOffice | ||||||
// | ||||||
// Created by 훈민트 on 2023/08/15. | ||||||
// | ||||||
|
||||||
struct MovieInformation: Decodable { | ||||||
let movieInformationResult: MovieInformationResult | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 접근 제어를 사용하여 외부에서 접근하지 못하도록 수정하였습니다. 관련 커밋: |
||||||
case movieInformationResult = "movieInfoResult" | ||||||
} | ||||||
} | ||||||
|
||||||
struct MovieInformationResult: Decodable { | ||||||
let detailMovieInformation: DetailMovieInformation | ||||||
let source: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case detailMovieInformation = "movieInfo" | ||||||
case source | ||||||
} | ||||||
} | ||||||
|
||||||
struct DetailMovieInformation: Decodable { | ||||||
let movieCode: String | ||||||
let movieName: String | ||||||
let movieEnglishName: String | ||||||
let movieOriginalName: String | ||||||
let showTime: String | ||||||
let productYear: String | ||||||
let openDate: String | ||||||
let productStatus: String | ||||||
let typeName: String | ||||||
let nations: [Nation] | ||||||
let genres: [Genre] | ||||||
let directors: [Director] | ||||||
let actors: [Actor] | ||||||
let showTypes: [ShowType] | ||||||
let companys: [Company] | ||||||
let audits: [Audit] | ||||||
let staffs: [Staff] | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case movieCode = "movieCd" | ||||||
case movieName = "movieNm" | ||||||
case movieEnglishName = "movieNmEn" | ||||||
case movieOriginalName = "movieNmOg" | ||||||
case showTime = "showTm" | ||||||
case productYear = "prdtYear" | ||||||
case openDate = "openDt" | ||||||
case productStatus = "prdtStatNm" | ||||||
case typeName = "typeNm" | ||||||
case nations, genres, directors, actors, showTypes, companys, audits, staffs | ||||||
} | ||||||
} | ||||||
|
||||||
struct Actor: Decodable { | ||||||
let name: String | ||||||
let englishName: String | ||||||
let cast: String | ||||||
let englishCast: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case name = "peopleNm" | ||||||
case englishName = "peopleNmEn" | ||||||
case cast | ||||||
case englishCast = "castEn" | ||||||
} | ||||||
} | ||||||
|
||||||
struct Audit: Decodable { | ||||||
let auditNumber: String | ||||||
let watchGrade: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case auditNumber = "auditNo" | ||||||
case watchGrade = "watchGradeNm" | ||||||
} | ||||||
} | ||||||
|
||||||
struct Company: Decodable { | ||||||
let code: String | ||||||
let name: String | ||||||
let englishName: String | ||||||
let partName: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case code = "companyCd" | ||||||
case name = "companyNm" | ||||||
case englishName = "companyNmEn" | ||||||
case partName = "companyPartNm" | ||||||
} | ||||||
} | ||||||
|
||||||
struct Director: Decodable { | ||||||
let name: String | ||||||
let englishName: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case name = "peopleNm" | ||||||
case englishName = "peopleNmEn" | ||||||
} | ||||||
} | ||||||
|
||||||
struct Genre: Decodable { | ||||||
let name: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case name = "genreNm" | ||||||
} | ||||||
} | ||||||
|
||||||
struct Nation: Decodable { | ||||||
let name: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case name = "nationNm" | ||||||
} | ||||||
} | ||||||
|
||||||
struct ShowType: Decodable { | ||||||
let groupName: String | ||||||
let name: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case groupName = "showTypeGroupNm" | ||||||
case name = "showTypeNm" | ||||||
} | ||||||
} | ||||||
|
||||||
struct Staff: Decodable { | ||||||
let name: String | ||||||
let englishName: String | ||||||
let roleName: String | ||||||
|
||||||
enum CodingKeys: String, CodingKey { | ||||||
case name = "peopleNm" | ||||||
case englishName = "peopleNmEn" | ||||||
case roleName = "staffRoleNm" | ||||||
} | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dsstore가 올라와 있네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정하였습니다.😊