-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d32d297
commit c740a2c
Showing
4 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// UserAPI.swift | ||
// Project_Timer | ||
// | ||
// Created by Kang Minsang on 2024/10/19. | ||
// Copyright © 2024 FDEE. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import Moya | ||
|
||
enum UserAPI { | ||
/// 티티 서비스에 일반 회원 가입을 해요. | ||
case register(request: SignupRequest) | ||
} | ||
|
||
extension UserAPI: TargetType { | ||
var baseURL: URL { | ||
return URL(string: NetworkURL.serverURL_V2 + "/api/user")! | ||
} | ||
|
||
var path: String { | ||
switch self { | ||
case .register: | ||
return "/members/register" | ||
} | ||
} | ||
|
||
var method: Moya.Method { | ||
switch self { | ||
case .register: | ||
return .post | ||
} | ||
} | ||
|
||
var task: Moya.Task { | ||
switch self { | ||
case .register(let request): | ||
return .requestJSONEncodable(request) | ||
} | ||
} | ||
|
||
var headers: [String : String]? { | ||
switch self { | ||
case .register: | ||
return nil | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// SignupRequest.swift | ||
// Project_Timer | ||
// | ||
// Created by Kang Minsang on 2024/10/19. | ||
// Copyright © 2024 FDEE. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct SignupRequest: Encodable { | ||
let username: String | ||
let wrappedEncryptedPassword: String | ||
let nickname: String | ||
let authToken: String | ||
} |