-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] AppStore에 올라간 정보를 받는 Endpoint 정의
- 린트에 맞춰 수정 - 싱글톤 형태로 변경
- Loading branch information
Showing
3 changed files
with
82 additions
and
27 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
45 changes: 45 additions & 0 deletions
45
Projects/NetworkService/Sources/EndPoint/AppStoreEndPoint.swift
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,45 @@ | ||
// | ||
// AppStoreEndPoint.swift | ||
// NetworkService | ||
// | ||
// Created by Jisoo HAM on 7/31/24. | ||
// Copyright © 2024 Pepsi-Club. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct AppStoreEndPoint: EndPoint { | ||
private let appStoreID: String | ||
|
||
public var scheme: Scheme { | ||
return .https | ||
} | ||
public var host: String { | ||
return "itunes.apple.com" | ||
} | ||
public var port: String { | ||
"" | ||
} | ||
public var path: String { | ||
return "/lookup" | ||
} | ||
public var query: [String: String] { | ||
return [ | ||
"id": appStoreID, | ||
"country": "kr" | ||
] | ||
} | ||
public var header: [String: String] { | ||
return [:] | ||
} | ||
public var body: [String: Any] { | ||
return [:] | ||
} | ||
public var method: HTTPMethod { | ||
return .get | ||
} | ||
|
||
public init(appStoreID: String) { | ||
self.appStoreID = appStoreID | ||
} | ||
} |