Skip to content

Commit

Permalink
✨ :: [#68] Add Expo C
Browse files Browse the repository at this point in the history
reate API
  • Loading branch information
Xixn2 committed Nov 27, 2024
1 parent 5cbbdb9 commit e935a43
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// ExpoCreateResponse.swift
// Domain
//
// Created by 서지완 on 11/27/24.
// Copyright © 2024 SchoolofCompany. All rights reserved.
//

49 changes: 49 additions & 0 deletions Projects/Domain/Sources/Services/Expo/ExpoAPI.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// ExpoAPI.swift
// Domain
//
// Created by 서지완 on 11/27/24.
// Copyright © 2024 SchoolofCompany. All rights reserved.
//

import Foundation
import Moya

public enum ExpoAPI {
case expoCreate(param: ExpoCreateRequest)
}

extension ExpoAPI: TargetType {
public var baseURL: URL {
return URL(string: "https://port-0-expo-server-754g42aluv3zyvy.sel5.cloudtype.app/")!
}

public var path: String {
switch self {
case .expoCreate:
return "expo"
}
}

public var method: Moya.Method {
switch self {
case .expoCreate:
return .post
}
}

public var sampleData: Data {
return "@@".data(using: .utf8)!
}

public var task: Task {
switch self {
case .expoCreate(let param):
return .requestJSONEncodable(param)
}
}

public var headers: [String: String]? {
return ["Content-Type": "application/json"]
}
}

0 comments on commit e935a43

Please sign in to comment.