-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from boostcampwm-2022/feature/settings-reposi…
…tory SettingsRepository 및 닉네임 변경 구현
- Loading branch information
Showing
8 changed files
with
87 additions
and
48 deletions.
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
31 changes: 31 additions & 0 deletions
31
Segno/Segno/Data/Network/Endpoints/ChangeNicknameEndpoint.swift
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,31 @@ | ||
// | ||
// SettingsEndpoint.swift | ||
// Segno | ||
// | ||
// Created by YOONJONG on 2022/12/01. | ||
// | ||
|
||
import Foundation | ||
|
||
enum ChangeNicknameEndpoint: Endpoint { | ||
case item(token: String, nickname: String) | ||
|
||
var baseURL: URL? { | ||
return URL(string: BaseURL.urlString) | ||
} | ||
|
||
var httpMethod: HTTPMethod { | ||
return .PATCH | ||
} | ||
|
||
var path: String { | ||
return "user" | ||
} | ||
|
||
var parameters: HTTPRequestParameter? { | ||
switch self { | ||
case .item(let token, let nickName): | ||
return HTTPRequestParameter.body(["token": token, "nickName": nickName]) | ||
} | ||
} | ||
} |
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,25 @@ | ||
// | ||
// ChangeNicknameUseCase.swift | ||
// Segno | ||
// | ||
// Created by YOONJONG on 2022/11/30. | ||
// | ||
|
||
import RxSwift | ||
|
||
protocol ChangeNicknameUseCase { | ||
func requestChangeNickname(to nickname: String) -> Single<Bool> | ||
} | ||
|
||
final class ChangeNicknameUseCaseImpl: ChangeNicknameUseCase { | ||
let repository: SettingsRepository | ||
private let disposeBag = DisposeBag() | ||
|
||
init(repository: SettingsRepository = SettingsRepositoryImpl()) { | ||
self.repository = repository | ||
} | ||
|
||
func requestChangeNickname(to nickname: String) -> Single<Bool> { | ||
return repository.changeNickname(to: nickname) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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