Skip to content

Commit

Permalink
feat: Exam Api Target(#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
sozohoy committed Mar 1, 2024
1 parent 2dd3dc1 commit 92056e3
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions SUWIKI/SUWIKI/Data/API/ExamPost/APITarget+ExamPost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,38 @@
//

import Foundation

import Alamofire

extension APITarget {
enum ExamPost: TargetType {
case fetchExamPosts(DTO.FetchExamPostsRequest)
}
}

extension APITarget.ExamPost {
var targetURL: URL {
URL(string: APITarget.baseURL + "exam-posts")!
}

var method: Alamofire.HTTPMethod {
switch self {
case .fetchExamPosts:
return .get
}
}

var path: String {
switch self {
case .fetchExamPosts:
""
}
}

var parameters: RequestParameter {
switch self {
case let .fetchExamPosts(fetchExamPosts):
return .query(fetchExamPosts)
}
}
}

0 comments on commit 92056e3

Please sign in to comment.