Skip to content

Commit

Permalink
Merge pull request #196 from GSM-MSG/195-delete-CreateClubCode
Browse files Browse the repository at this point in the history
🔀 :: [#195] 개설신청서 관련 코드 삭제
  • Loading branch information
junseopark0331 authored Dec 28, 2023
2 parents 627c2c0 + bce228c commit 4400fb3
Show file tree
Hide file tree
Showing 26 changed files with 228 additions and 1,565 deletions.
5 changes: 0 additions & 5 deletions Service/Sources/DI/UseCaseAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ public final class UseCaseAssembly: Assembly {
clubRepository: r.resolve(ClubRepository.self)!
)
}
container.register(CreateNewClubUseCase.self) { r in
CreateNewClubUseCase(
clubRepository: r.resolve(ClubRepository.self)!
)
}
container.register(DeleteClubUseCase.self) { r in
DeleteClubUseCase(
clubRepository: r.resolve(ClubRepository.self)!
Expand Down
17 changes: 1 addition & 16 deletions Service/Sources/Data/DataSource/Remote/API/ClubAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Moya
enum ClubAPI {
case clubList(type: ClubType)
case clubDetail(clubID: Int)
case createNewClub(req: NewClubRequest)
case updateClub(clubID: Int, req: UpdateClubRequest)
case deleteClub(clubID: Int)
case clubOpen(clubID: Int)
Expand All @@ -18,7 +17,7 @@ extension ClubAPI: GCMSAPI {

var urlPath: String {
switch self {
case .clubList, .createNewClub:
case .clubList:
return ""

case let .clubDetail(clubID), let .updateClub(clubID, _), let .deleteClub(clubID):
Expand All @@ -40,9 +39,6 @@ extension ClubAPI: GCMSAPI {
case .clubList, .clubDetail:
return .get

case .createNewClub:
return .post

case .updateClub, .clubOpen, .clubClose:
return .patch

Expand All @@ -61,9 +57,6 @@ extension ClubAPI: GCMSAPI {
case .clubDetail, .clubOpen, .clubClose, .exitClub, .deleteClub:
return .requestPlain

case let .createNewClub(req):
return .requestJSONEncodable(req)

case let .updateClub(_, req):
return .requestJSONEncodable(req)
}
Expand Down Expand Up @@ -93,14 +86,6 @@ extension ClubAPI: GCMSAPI {
500: .serverError
]

case .createNewClub:
return [
400: .invalidInput,
401: .unauthorized,
409: .alreadyExistClub,
500: .serverError
]

case .updateClub:
return [
400: .invalidInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import RxSwift
protocol ClubRemoteProtocol {
func fetchClubList(type: ClubType) -> Single<[ClubList]>
func fetchDetailClub(clubID: Int) -> Single<Club>
func createNewClub(req: NewClubRequest) -> Completable
func updateClub(clubID: Int, req: UpdateClubRequest) -> Completable
func deleteClub(clubID: Int) -> Completable
func clubOpen(clubID: Int) -> Completable
Expand All @@ -24,11 +23,6 @@ final class ClubRemote: BaseRemote<ClubAPI>, ClubRemoteProtocol {
.map { $0.toDomain() }
}

func createNewClub(req: NewClubRequest) -> Completable {
request(.createNewClub(req: req))
.asCompletable()
}

func updateClub(clubID: Int, req: UpdateClubRequest) -> Completable {
request(.updateClub(clubID: clubID, req: req))
.asCompletable()
Expand Down
4 changes: 0 additions & 4 deletions Service/Sources/Data/Repositories/DefaultClubRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ final class DefaultClubRepository: ClubRepository {
clubRemote.fetchDetailClub(clubID: clubID)
}

func createNewClub(req: NewClubRequest) -> Completable {
clubRemote.createNewClub(req: req)
}

func updateClub(clubID: Int, req: UpdateClubRequest) -> Completable {
clubRemote.updateClub(clubID: clubID, req: req)
}
Expand Down
1 change: 0 additions & 1 deletion Service/Sources/Domain/Repositories/ClubRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import RxSwift
public protocol ClubRepository {
func fetchClubList(type: ClubType) -> Observable<[ClubList]>
func fetchDetailClub(clubID: Int) -> Single<Club>
func createNewClub(req: NewClubRequest) -> Completable
func updateClub(clubID: Int, req: UpdateClubRequest) -> Completable
func deleteClub(clubID: Int) -> Completable
func clubOpen(clubID: Int) -> Completable
Expand Down
13 changes: 0 additions & 13 deletions Service/Sources/Domain/UseCases/Club/CreateNewClubUseCase.swift

This file was deleted.

15 changes: 0 additions & 15 deletions iOS/Sources/Application/DI/Assembly/ReactorAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ final class ReactorAssembly: Assembly {
)
}

container.register(NewClubReactor.self) { r in
NewClubReactor(
createNewClubUseCase: r.resolve(CreateNewClubUseCase.self)!,
uploadImagesUseCase: r.resolve(UploadImagesUseCase.self)!
)
}

container.register(UpdateClubReactor.self) { r, club in
UpdateClubReactor(
club: club,
Expand All @@ -55,14 +48,6 @@ final class ReactorAssembly: Assembly {
)
}

container.register(MemberAppendReactor.self) { r, closure, clubType in
MemberAppendReactor(
closure: closure,
clubType: clubType,
searchUserUseCase: r.resolve(SearchUserUseCase.self)!
)
}

container.register(ClubMemberReactor.self) { r, clubID, isOpened in
ClubMemberReactor(
clubID: clubID,
Expand Down
31 changes: 0 additions & 31 deletions iOS/Sources/Application/Flow/Flows/Main/MainFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,10 @@ final class MainFlow: Flow {
return navigateToMyPage()
case let .alert(title, message, style, actions):
return presentToAlert(title: title, message: message, style: style, actions: actions)
case let .memberAppendIsRequired(closure, clubType):
return presentToMemberAppend(closure: closure, clubType: clubType)
case .popToRoot:
return popToRoot()
case .dismiss:
return dismiss()
// MARK: NewClub
case .firstNewClubIsRequired:
return navigateToFirstNewClub()
case let .secondNewClubIsRequired(reactor):
return navigateToSecondNewClub(reactor: reactor)
case let .thirdNewClubIsRequired(reactor):
return navigateToThirdNewClub(reactor: reactor)
// MARK: UpdateClub
case let .firstUpdateClubIsRequired(club):
return navigateToFirstUpdateClub(club: club)
Expand Down Expand Up @@ -92,32 +83,10 @@ private extension MainFlow {
self.rootVC.topViewController?.present(alert, animated: true)
return .none
}
func presentToMemberAppend(closure: @escaping (([User]) -> Void), clubType: ClubType) -> FlowContributors {
let reactor = AppDelegate.container.resolve(MemberAppendReactor.self, arguments: closure, clubType)!
let vc = MemberAppendVC(reactor: reactor)
self.rootVC.topViewController?.presentPanModal(vc)
return .one(flowContributor: .contribute(withNextPresentable: vc, withNextStepper: reactor))
}
func dismiss() -> FlowContributors {
self.rootVC.topViewController?.dismiss(animated: true)
return .none
}
func navigateToFirstNewClub() -> FlowContributors {
let reactor = AppDelegate.container.resolve(NewClubReactor.self)!
let vc = FirstNewClubVC(reactor: reactor)
self.rootVC.pushViewController(vc, animated: true)
return .one(flowContributor: .contribute(withNextPresentable: vc, withNextStepper: reactor))
}
func navigateToSecondNewClub(reactor: NewClubReactor) -> FlowContributors {
let vc = SecondNewClubVC(reactor: reactor)
self.rootVC.pushViewController(vc, animated: true)
return .one(flowContributor: .contribute(withNextPresentable: vc, withNextStepper: reactor))
}
func navigateToThirdNewClub(reactor: NewClubReactor) -> FlowContributors {
let vc = ThirdNewClubVC(reactor: reactor)
self.rootVC.pushViewController(vc, animated: true)
return .one(flowContributor: .contribute(withNextPresentable: vc, withNextStepper: reactor))
}
func navigateToFirstUpdateClub(club: Club) -> FlowContributors {
let reactor = AppDelegate.container.resolve(UpdateClubReactor.self, argument: club)!
let vc = FirstUpdateClubVC(reactor: reactor)
Expand Down
7 changes: 0 additions & 7 deletions iOS/Sources/Application/Flow/Step/GCMSStep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,9 @@ enum GCMSStep: Step {
case clubListIsRequired
case clubDetailIsRequired(clubID: Int)

// MARK: NewClub
case firstNewClubIsRequired
case secondNewClubIsRequired(reactor: NewClubReactor)
case thirdNewClubIsRequired(reactor: NewClubReactor)

// MARK: - UpdateClub
case firstUpdateClubIsRequired(club: Club)
case secondUpdateClubIsRequired(reactor: UpdateClubReactor)

case memberAppendIsRequired(closure: (([User]) -> Void), clubType: ClubType)
case clubStatusIsRequired(clubID: Int, isHead: Bool, isOpened: Bool)

// MARK: Administrator
Expand Down
3 changes: 0 additions & 3 deletions iOS/Sources/Presentation/Scene/Main/Home/HomeReactor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ final class HomeReactor: Reactor, Stepper {
case viewDidLoad
case viewDidAppear(ClubType)
case myPageButtonDidTap
case newClubButtonDidTap
case updateLoading(Bool)
case clubDidTap(Int)
case refreshTrigger(ClubType)
Expand Down Expand Up @@ -67,8 +66,6 @@ extension HomeReactor {
switch action {
case .myPageButtonDidTap:
steps.accept(GCMSStep.myPageIsRequired)
case .newClubButtonDidTap:
steps.accept(GCMSStep.firstNewClubIsRequired)
case let .updateLoading(load):
return .just(.setIsLoading(load))
case .viewDidLoad:
Expand Down
11 changes: 1 addition & 10 deletions iOS/Sources/Presentation/Scene/Main/Home/HomeVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ final class HomeVC: TabmanViewController, View {
style: .plain,
target: nil,
action: nil)
private let newClubButton = UIBarButtonItem(image: .init(systemName: "plus.app")?.tintColor(GCMSAsset.Colors.gcmsGray4.color),
style: .plain,
target: nil,
action: nil)
private lazy var indicator = LottieAnimationView(name: "GCMS-Indicator").then {
$0.contentMode = .scaleAspectFit
$0.loopMode = .loop
Expand Down Expand Up @@ -112,7 +108,7 @@ private extension HomeVC {
}
func configNavigation() {
self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(customView: titleLabel)
self.navigationItem.setRightBarButtonItems([myPageButton, newClubButton], animated: true)
self.navigationItem.rightBarButtonItem = myPageButton
self.navigationItem.configBack()
}
func bindAction(reactor: HomeReactor) {
Expand All @@ -126,11 +122,6 @@ private extension HomeVC {
.map { _ in Reactor.Action.myPageButtonDidTap }
.bind(to: reactor.action)
.disposed(by: disposeBag)

newClubButton.rx.tap
.map { _ in Reactor.Action.newClubButtonDidTap }
.bind(to: reactor.action)
.disposed(by: disposeBag)
}
func bindState(reactor: HomeReactor) {
let sharedState = reactor.state.share(replay: 3).observe(on: MainScheduler.asyncInstance)
Expand Down

This file was deleted.

Loading

0 comments on commit 4400fb3

Please sign in to comment.