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

πŸ”€ :: [#130] 자슡, μ•ˆλ§ˆμ˜μž 인원 μˆ˜μ • 둜직 μΆ”κ°€ #136

Merged
merged 21 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d88a16d
:sparkles: :: [#130] InputDialogFeature / InputDialogFeature Module 생성
baekteun Jul 29, 2023
91bb93d
:seedling: :: [#130] InputDialogFeature / κΈ°λ³Έ 파일 μ„ΈνŒ…
baekteun Jul 29, 2023
3710da4
:recycle: :: [#130] InputDialogFeature / BaseStoredViewController -> …
baekteun Jul 29, 2023
49b093d
:lipstick: :: [#130] InputDialogFeature / InputDialogFeature UI
baekteun Jul 30, 2023
905f5bc
Merge branch 'master' of https://github.com/Team-Ampersand/Dotori-iOS…
baekteun Jul 30, 2023
1b1b67b
:sparkles: :: [#130] BaseFeature / RoutedViewControllable
baekteun Jul 30, 2023
ff314a5
:sparkles: :: [#130] InputDialogFeature / InputDialog Binding
baekteun Jul 30, 2023
fe4564e
:sparkles: :: [#130] InputDialogFeature / InputDialogFeature DI
baekteun Jul 30, 2023
605f5d2
:sparkles: :: [#130] InputDialogFeature / InputType DotoriRoutePathλ₯Ό …
baekteun Jul 30, 2023
3c75f98
:pencil2: :: [#130] InputDialogFeature / InputType -> DialogInputType
baekteun Jul 30, 2023
125f071
:sparkles: :: [#130] SelfStudyDomain / ModifySelfStudyPersonnelUseCas…
baekteun Jul 30, 2023
af28b2d
:sparkles: :: [#130] MassageDomain / ModifyMassagePersonnelUseCase Im…
baekteun Jul 30, 2023
14ac260
:sparkles: :: [#130] HomeFeature / InputDialog present HomeMoordinato…
baekteun Jul 30, 2023
27b9736
:globe_with_meridians: :: [#130] HomeFeature / ν™ˆ feature 지역화
baekteun Jul 30, 2023
9cc44af
:sparkles: :: [#130] HomeFeature / Modify SelfStudy|Massage Personnel…
baekteun Jul 30, 2023
094f82b
:globe_with_meridians: :: [#130] HomeFeature / 자슡, μ•ˆλ§ˆμ˜μž 신청인원 μˆ˜μ • 둜직 μΆ”κ°€
baekteun Jul 30, 2023
ffa5fd5
:sparkles: :: [#130] HomeFeature / modify selfStudy|massage personnel…
baekteun Jul 30, 2023
068843a
:sparkles: :: [#130] HomeFeature / 인원 μˆ˜μ • ν›„ ν•΄λ‹Ή μˆ˜μ •λœ 인원 refresh
baekteun Jul 30, 2023
4097dc6
:pencil2: :: [#130] InputDialogFeature / Store의 μƒˆ μƒμ„±μž μ˜΅μ…˜ μ£Όμž…
baekteun Jul 30, 2023
89508bc
:pencil2: :: [#130] HomeFeature / γ…Žγ…Ž μ˜€νƒ€λ‘œ λ‹€λ₯Έ usecase μƒμ„±ν•˜κ³  μžˆμ—ˆμŒ
baekteun Jul 30, 2023
9cafe89
Merge branch 'master' into 130-home-edit-personnel-feature-impl
baekteun Jul 30, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public extension ModulePaths {
public extension ModulePaths {
enum Feature: String, MicroTargetPathConvertable {
case ProposeMusicFeature
case InputDialogFeature
case DetailNoticeFeature
case MyViolationListFeature
case SplashFeature
Expand Down
1 change: 1 addition & 0 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ let targets: [Target] = [
.feature(target: .SignupFeature),
.feature(target: .RenewalPasswordFeature),
.feature(target: .ConfirmationDialogFeature),
.feature(target: .InputDialogFeature),
.domain(target: .AuthDomain),
.domain(target: .UserDomain),
.domain(target: .SelfStudyDomain),
Expand Down
2 changes: 2 additions & 0 deletions Projects/App/Sources/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Database
import DetailNoticeFeature
import HomeFeature
import IQKeyboardManagerSwift
import InputDialogFeature
import JwtStore
import KeyValueStore
import MainTabFeature
Expand Down Expand Up @@ -47,6 +48,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
DatabaseAssembly(),
SplashAssembly(),
HomeAssembly(),
InputDialogAssembly(),
MyViolationListAssembly(),
NoticeAssembly(),
DetailNoticeAssembly(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ public protocol RemoteMassageDataSource {
func applyMassage() async throws
func cancelMassage() async throws
func fetchMassageRankList() async throws -> [MassageRankEntity]
func modifyMassagePersonnel(limit: Int) async throws
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ public protocol MassageRepository {
func applyMassage() async throws
func cancelMassage() async throws
func fetchMassageRankList() async throws -> [MassageRankEntity]
func modifyMassagePersonnel(limit: Int) async throws
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public protocol ModifyMassagePersonnelUseCase {
func callAsFunction(limit: Int) async throws
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ public final class MassageDomainAssembly: Assembly {
container.register(FetchMassageRankListUseCase.self) { resolver in
FetchMassageRankListUseCaseImpl(massageRepository: resolver.resolve(MassageRepository.self)!)
}

container.register(ModifyMassagePersonnelUseCase.self) { resolver in
ModifyMassagePersonnelUseCaseImpl(massageRepository: resolver.resolve(MassageRepository.self)!)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public enum MassageEndpoint {
case applyMassage
case cancelMassage
case fetchMassageRankList
case modifyMassagePersonnel(limit: Int)
}

extension MassageEndpoint: DotoriEndpoint {
Expand All @@ -28,11 +29,19 @@ extension MassageEndpoint: DotoriEndpoint {

case .fetchMassageRankList:
return .get("/rank")

case .modifyMassagePersonnel:
return .patch("/limit")
}
}

public var task: HTTPTask {
switch self {
case let .modifyMassagePersonnel(limit):
return .requestParameters(body: [
"limit": limit
])

default:
return .requestPlain
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ final class RemoteMassageDataSourceImpl: RemoteMassageDataSource {
)
.toDomain()
}

func modifyMassagePersonnel(limit: Int) async throws {
try await networking.request(MassageEndpoint.modifyMassagePersonnel(limit: limit))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ final class MassageRepositoryImpl: MassageRepository {
func fetchMassageRankList() async throws -> [MassageRankEntity] {
try await remoteMassageDataSource.fetchMassageRankList()
}

func modifyMassagePersonnel(limit: Int) async throws {
try await remoteMassageDataSource.modifyMassagePersonnel(limit: limit)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import MassageDomainInterface

struct ModifyMassagePersonnelUseCaseImpl: ModifyMassagePersonnelUseCase {
private let massageRepository: any MassageRepository

init(massageRepository: any MassageRepository) {
self.massageRepository = massageRepository
}

func callAsFunction(limit: Int) async throws {
try await massageRepository.modifyMassagePersonnel(limit: limit)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ final class RemoteMassageDataSourceSpy: RemoteMassageDataSource {
fetchMassageRankListCallCount += 1
return try await fetchMassageRankListHandler()
}

var modifyMassagePersonnelCallCount = 0
func modifyMassagePersonnel(limit: Int) async throws {
modifyMassagePersonnelCallCount += 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ final class MassageRepositorySpy: MassageRepository {
fetchMassageRankListCallCount += 1
return try await fetchMassageRankListHandler()
}

var modifyMassagePersonnelCallCount = 0
func modifyMassagePersonnel(limit: Int) async throws {
modifyMassagePersonnelCallCount += 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import MassageDomainInterface

final class ModifyMassagePersonnelUseCaseSpy: ModifyMassagePersonnelUseCase {
var modifyMassagePersonnelCallCount = 0
func callAsFunction(limit: Int) async throws {
modifyMassagePersonnelCallCount += 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ public protocol RemoteSelfStudyDataSource {
func fetchSelfStudyRankList() async throws -> [SelfStudyRankEntity]
func fetchSelfStudyRankSearch(req: FetchSelfStudyRankSearchRequestDTO) async throws -> [SelfStudyRankEntity]
func checkSelfStudyMember(memberID: Int, isChecked: Bool) async throws
func modifySelfStudyPersonnel(limit: Int) async throws
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ public protocol SelfStudyRepository {
func fetchSelfStudyRankList() async throws -> [SelfStudyRankEntity]
func fetchSelfStudyRankSearch(req: FetchSelfStudyRankSearchRequestDTO) async throws -> [SelfStudyRankEntity]
func checkSelfStudyMember(memberID: Int, isChecked: Bool) async throws
func modifySelfStudyPersonnel(limit: Int) async throws
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public protocol ModifySelfStudyPersonnelUseCase {
func callAsFunction(limit: Int) async throws
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ public final class SelfStudyDomainAssembly: Assembly {
container.register(CheckSelfStudyMemberUseCase.self) { resolver in
CheckSelfStudyMemberUseCaseImpl(selfStudyRepository: resolver.resolve(SelfStudyRepository.self)!)
}

container.register(ModifySelfStudyPersonnelUseCase.self) { resolver in
ModifySelfStudyPersonnelUseCaseImpl(selfStudyRepository: resolver.resolve(SelfStudyRepository.self)!)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ final class RemoteSelfStudyDataSourceImpl: RemoteSelfStudyDataSource {
SelfStudyEndpoint.checkSelfStudyMember(memberID: memberID, isChecked: isChecked)
)
}

func modifySelfStudyPersonnel(limit: Int) async throws {
try await networking.request(SelfStudyEndpoint.modifySelfStudyPersonnel(limit: limit))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public enum SelfStudyEndpoint {
case fetchSelfStudyRank
case fetchSelfStudySearch(FetchSelfStudyRankSearchRequestDTO)
case checkSelfStudyMember(memberID: Int, isChecked: Bool)
case modifySelfStudyPersonnel(limit: Int)
}

extension SelfStudyEndpoint: DotoriEndpoint {
Expand All @@ -35,6 +36,9 @@ extension SelfStudyEndpoint: DotoriEndpoint {

case let .checkSelfStudyMember(memberID, _):
return .patch("/check/\(memberID)")

case .modifySelfStudyPersonnel:
return .patch("/limit")
}
}

Expand All @@ -48,6 +52,11 @@ extension SelfStudyEndpoint: DotoriEndpoint {
"selfStudyCheck": isChecked
])

case let .modifySelfStudyPersonnel(limit):
return .requestParameters(body: [
"limit": limit
])

default:
return .requestPlain
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ final class SelfStudyRepositoryImpl: SelfStudyRepository {
func checkSelfStudyMember(memberID: Int, isChecked: Bool) async throws {
try await remoteSelfStudyDataSource.checkSelfStudyMember(memberID: memberID, isChecked: isChecked)
}

func modifySelfStudyPersonnel(limit: Int) async throws {
try await remoteSelfStudyDataSource.modifySelfStudyPersonnel(limit: limit)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import SelfStudyDomainInterface

struct ModifySelfStudyPersonnelUseCaseImpl: ModifySelfStudyPersonnelUseCase {
private let selfStudyRepository: any SelfStudyRepository

init(selfStudyRepository: any SelfStudyRepository) {
self.selfStudyRepository = selfStudyRepository
}

func callAsFunction(limit: Int) async throws {
try await selfStudyRepository.modifySelfStudyPersonnel(limit: limit)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ final class RemoteSelfStudyDataSourceSpy: RemoteSelfStudyDataSource {
func checkSelfStudyMember(memberID: Int, isChecked: Bool) async throws {
checkSelfStudyMemberCallCount += 1
}

var modifySelfStudyPersonnelCallCount = 0
func modifySelfStudyPersonnel(limit: Int) async throws {
modifySelfStudyPersonnelCallCount += 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ final class SelfStudyRepositorySpy: SelfStudyRepository {
func checkSelfStudyMember(memberID: Int, isChecked: Bool) async throws {
checkSelfStudyMemberCallCount += 1
}

var modifySelfStudyPersonnelCallCount = 0
func modifySelfStudyPersonnel(limit: Int) async throws {
modifySelfStudyPersonnelCallCount += 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import SelfStudyDomainInterface

final class ModifySelfStudyPersonnelUseCaseSpy: ModifySelfStudyPersonnelUseCase {
var modifySelfStudyPersonnelCallCount = 0
func callAsFunction(limit: Int) async throws {
modifySelfStudyPersonnelCallCount += 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Foundation

/**
InputDialogFeatureμ—μ„œ μ‚¬μš©ν•˜κΈ° μœ„ν•œ enum
*/
public enum DialogInputType {
case number
case text
}
5 changes: 5 additions & 0 deletions Projects/Feature/BaseFeature/Interface/HasRouter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Moordinator

public protocol HasRouter {
var router: any Router { get }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public protocol RoutedViewControllable: ViewControllable, HasRouter {}
5 changes: 4 additions & 1 deletion Projects/Feature/BaseFeature/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import DependencyPlugin
let project = Project.module(
name: ModulePaths.Feature.BaseFeature.rawValue,
targets: [
.interface(module: .feature(.BaseFeature), dependencies: [
.SPM.Moordinator
]),
.implements(module: .feature(.BaseFeature), product: .framework, dependencies: [
.SPM.Moordinator,
.SPM.Store,
.SPM.IQKeyboardManagerSwift,
.SPM.Nuke,
.feature(target: .BaseFeature, type: .interface),
.userInterface(target: .DesignSystem),
.userInterface(target: .Localization),
.shared(target: .GlobalThirdPartyLibrary),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Anim
import BaseFeatureInterface
import Combine
import Configure
import DesignSystem
Expand All @@ -9,6 +10,7 @@ import UIKit
*/
open class BaseStoredModalViewController<Store: BaseStore>:
BaseModalViewController,
RoutedViewControllable,
StoredViewControllable,
StoreBindable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import BaseFeatureInterface
import Moordinator
import UIKit

open class BaseStoredViewController<Store: BaseStore>:
BaseViewController,
RoutedViewControllable,
StoredViewControllable,
StoreBindable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import BaseFeatureInterface
import Combine
import DesignSystem
import UIKit

open class BaseViewController:
UIViewController,
ViewControllable,
HasCancellableBag,
AddViewable,
SetLayoutable,
Expand Down
7 changes: 7 additions & 0 deletions Projects/Feature/BaseFeature/Sources/DotoriRoutePath.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BaseFeatureInterface
import Moordinator
import UIKit

Expand All @@ -14,6 +15,12 @@ public enum DotoriRoutePath: RoutePath {
description: String = "",
confirmAction: () async -> Void
)
case inputDialog(
title: String,
placeholder: String,
inputType: DialogInputType,
confirmAction: (String) async -> Void
)
case dismiss
case pop

Expand Down
10 changes: 9 additions & 1 deletion Projects/Feature/BaseFeature/Sources/Protocol/HasStore.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import BaseFeatureInterface
import Foundation
import Moordinator

public protocol HasStore {
public protocol HasStore: HasRouter {
associatedtype Store: BaseStore
var store: Store { get }
}

extension HasStore {
public var router: any Router {
store
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BaseFeatureInterface
import UIKit

public protocol StoredViewControllable: ViewControllable, HasStore {}
4 changes: 4 additions & 0 deletions Projects/Feature/HomeFeature/Demo/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
let loadCurrentUserRoleUseCase: LoadCurrentUserRoleUseCaseSpy = .init()
let applySelfStudyUseCase: ApplySelfStudyUseCaseSpy = .init()
let cancelSelfStudyUseCase = CancelSelfStudyUseCaseSpy()
let modifySelfStudyPersonnelUseCase = ModifySelfStudyPersonnelUseCaseSpy()
let applyMassageUseCase: ApplyMassageUseCaseSpy = .init()
let cancelMassageUseCase = CancelMassageUseCaseSpy()
let modifyMassagePersonnelUseCase = ModifyMassagePersonnelUseCaseSpy()
let logoutUseCase = LogoutUseCaseSpy()
let store = HomeStore(
repeatableTimer: repeatableTimerStub,
Expand All @@ -40,8 +42,10 @@ final class AppDelegate: UIResponder, UIApplicationDelegate {
loadCurrentUserRoleUseCase: loadCurrentUserRoleUseCase,
applySelfStudyUseCase: applySelfStudyUseCase,
cancelSelfStudyUseCase: cancelSelfStudyUseCase,
modifySelfStudyPersonnelUseCase: modifySelfStudyPersonnelUseCase,
applyMassageUseCase: applyMassageUseCase,
cancelMassageUseCase: cancelMassageUseCase,
modifyMassagePersonnelUseCase: modifyMassagePersonnelUseCase,
logoutUseCase: logoutUseCase
)
let viewController = Inject.ViewControllerHost(
Expand Down
Loading
Loading