Skip to content

Commit

Permalink
[Add] sopt-makers#57 - 비밀번호 변경 기능을 위한 파일들 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lsj8706 committed Dec 26, 2022
1 parent 93a36a3 commit 50e7393
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import Network

public class SettingRepository {

private let networkService: UserService
private let networkService: AuthService
private let cancelBag = CancelBag()

public init(service: UserService) {
public init(service: AuthService) {
self.networkService = service
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// PasswordSettingTransform.swift
// Data
//
// Created by sejin on 2022/12/26.
// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved.
//

import Foundation

import Domain
import Network

extension PasswordChangeEntity {

public func toDomain() -> PasswordChangeModel {
return PasswordChangeModel.init()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// PasswordChangeModel.swift
// Domain
//
// Created by sejin on 2022/12/26.
// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved.
//

import Foundation

public struct PasswordChangeModel {

public init() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// PasswordChangeRepositoryInterface.swift
// Domain
//
// Created by sejin on 2022/12/26.
// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved.
//

import Combine

public protocol PasswordChangeRepositoryInterface {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// PasswordChangeUseCase.swift
// Domain
//
// Created by sejin on 2022/12/26.
// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved.
//

import Combine

public protocol PasswordChangeUseCase {

}

public class DefaultPasswordChangeUseCase {

private let repository: PasswordChangeRepositoryInterface
private var cancelBag = Set<AnyCancellable>()

public init(repository: PasswordChangeRepositoryInterface) {
self.repository = repository
}
}

extension DefaultPasswordChangeUseCase: PasswordChangeUseCase {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// PasswordChangeEntity.swift
// Network
//
// Created by sejin on 2022/12/26.
// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved.
//

import Foundation

public struct PasswordChangeEntity {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// PasswordChangeVC.swift
// Presentation
//
// Created by sejin on 2022/12/26.
// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved.
//

import UIKit

import Combine

import Core
import SnapKit
import Then

public class PasswordChangeVC: UIViewController {

// MARK: - Properties

public var viewModel: PasswordChangeViewModel!
private var cancelBag = CancelBag()

// MARK: - UI Components

// MARK: - View Life Cycle

public override func viewDidLoad() {
super.viewDidLoad()
self.bindViewModels()
}
}

// MARK: - Methods

extension PasswordChangeVC {

private func bindViewModels() {
let input = PasswordChangeViewModel.Input()
let output = self.viewModel.transform(from: input, cancelBag: self.cancelBag)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// PasswordChangeViewModel.swift
// Presentation
//
// Created by sejin on 2022/12/26.
// Copyright © 2022 SOPT-Stamp-iOS. All rights reserved.
//

import Foundation

import Combine

import Core
import Domain

public class PasswordChangeViewModel: ViewModelType {

private let useCase: PasswordChangeUseCase
private var cancelBag = CancelBag()

// MARK: - Inputs

public struct Input {

}

// MARK: - Outputs

public struct Output {

}

// MARK: - init

public init(useCase: PasswordChangeUseCase) {
self.useCase = useCase
}
}

extension PasswordChangeViewModel {
public func transform(from input: Input, cancelBag: CancelBag) -> Output {
let output = Output()
self.bindOutput(output: output, cancelBag: cancelBag)
// input,output 상관관계 작성

return output
}

private func bindOutput(output: Output, cancelBag: CancelBag) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ extension ModuleFactory: ModuleFactoryInterface {
}

public func makeSettingVC() -> SettingVC {
let repository = SettingRepository(service: userService)
let repository = SettingRepository(service: authService)
let useCase = DefaultSettingUseCase(repository: repository)
let viewModel = SettingViewModel(useCase: useCase)
let settingVC = SettingVC()
Expand Down

0 comments on commit 50e7393

Please sign in to comment.