forked from AcaMate/AcaMate_iOS
30 lines
676 B
Swift
30 lines
676 B
Swift
//
|
|
// API Request.swift
|
|
// AcaMate
|
|
//
|
|
// Created by TAnine on 3/18/25.
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
|
|
public struct APIRequest<T: APIResponseProtocol> {
|
|
let url, path: String
|
|
let method: HTTPMethod
|
|
var parameters: [String: Any]
|
|
let headers: HTTPHeaders
|
|
let decoding: T.Type
|
|
|
|
init(url: String = "\(API_URL)", path: String,
|
|
method: HTTPMethod = .get, headers: HTTPHeaders = [:],
|
|
parameters: [String : Any] = [:], decoding: T.Type) {
|
|
self.url = url
|
|
self.path = path
|
|
self.method = method
|
|
self.headers = headers
|
|
self.parameters = parameters
|
|
self.decoding = decoding
|
|
}
|
|
}
|
|
|