
新增Package.swift和Package.resolved文件以支持Swift Package管理,创建API相关文件(API.swift、APICaller.swift、APIConstants.swift、APIEndpoints.swift、APIService.swift、APILogger.swift、APIModels.swift、Integration-Guide.md)以实现API请求管理和网络交互功能,增强项目的功能性和可扩展性。同时更新.gitignore以排除构建文件和临时文件。
27 lines
656 B
Swift
27 lines
656 B
Swift
import Foundation
|
|
|
|
enum APIConstants {
|
|
// MARK: - Base URLs
|
|
static let baseURL = "http://beta.api.molistar.xyz"
|
|
|
|
// MARK: - Common Headers
|
|
static let defaultHeaders: [String: String] = [
|
|
"Content-Type": "application/json",
|
|
"Accept": "application/json",
|
|
"platform": "ios",
|
|
"version": "1.0.0"
|
|
]
|
|
|
|
// MARK: - Endpoints
|
|
enum Endpoints {
|
|
static let clientInit = "/client/config"
|
|
static let login = "/user/login"
|
|
}
|
|
|
|
// MARK: - Common Parameters
|
|
static let commonParameters: [String: String] = [:
|
|
// "platform": "ios",
|
|
// "version": "1.0.0"
|
|
]
|
|
}
|