Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] #466 -회원가입 API 연동 #469

Merged
merged 8 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Feat] #466 - PhoneVerify 관련 API 구현
  • Loading branch information
meltsplit committed Dec 30, 2024
commit b1c8305de48985ff8a28a21aad5ad6d1763707aa
41 changes: 24 additions & 17 deletions SOPT-iOS/Projects/Modules/Networks/Sources/API/CoreAuthAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
//

import Moya
import Core

public enum CoreAuthAPI {
case sendVerifyCode(phone: )
case verfiyCode(entity: )
case sendVerifyCode(dto: SendVerificationCodeEntity)
case verfiyCode(dto: VerifyCodeEntity)
case signUp
case signIn
}
Expand All @@ -31,34 +30,42 @@ extension CoreAuthAPI: BaseAPI {
// MARK: - Path
public var path: String {
switch self {
case .sendVerifyCode(phone: let phone):
<#code#>
case .verfiyCode(entity: let entity):
<#code#>
case .sendVerifyCode:
return "/phone"
case .verfiyCode:
return "/verify/phone"
case .signUp:
<#code#>
return "signup"
case .signIn:
<#code#>
return "/login/app"
}
}

// MARK: - Method
public var method: Moya.Method {
switch self {
case .getSocialAccount:
return .get
case .changeSocialAccount:
return .patch
case .sendVerifyCode:
return .post
case .verfiyCode:
return .post
case .signUp:
return .post
case .signIn:
return .post
}
}


public var task: Task {
switch self {
case let .getSocialAccount(phone):
return .requestParameters(parameters: ["phone": phone], encoding: URLEncoding.queryString)
case let .changeSocialAccount(entity):
return .requestJSONEncodable(entity)
case let .sendVerifyCode(dto):
return .requestJSONEncodable(dto)
case let .verfiyCode(dto):
return .requestJSONEncodable(dto)
case .signUp:
return .requestPlain
case .signIn:
return .requestPlain
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Copyright © 2024 SOPT-iOS. All rights reserved.
//

import Foundation

import Alamofire
import Moya
import Core

public enum SocialAPI {
case getSocialAccount(phone: String)
Expand Down

This file was deleted.