Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
471f21b
feat: Domain module 초기 셋팅
hyeonghwan Dec 14, 2023
1c35394
move: Domain 관련 파일 이동
hyeonghwan Dec 14, 2023
fecac61
refaoctr: import Domain
hyeonghwan Dec 14, 2023
a1c3fd4
chore: 모듈 분리로 더이상 사용하지 않는 코드 삭제
hyeonghwan Dec 14, 2023
2289630
refactor: Core Data- MO Request Type Domain모듈로 이동
hyeonghwan Dec 14, 2023
84a8d1a
refactor: Domain 모듈로 이동에 따른 FR -> VO
hyeonghwan Dec 14, 2023
950ffec
refactor: Request Type -> Domain request Type
hyeonghwan Dec 14, 2023
85143cd
refactor: Repository 에서 mapping후 반환 하도록 변경
hyeonghwan Dec 14, 2023
ea4619e
refactor: fix model mapping
hyeonghwan Dec 14, 2023
c8552e4
feat: Domain Layer Usecase Repository 파일 생성
hyeonghwan Dec 15, 2023
91eab62
refactor: APP 에서 Domain ,Data Layer 분리 파일 이동 및 삭제
hyeonghwan Dec 16, 2023
2fe84e6
refactor: DefaultRepository Refactor Data Layer 로 이동
hyeonghwan Dec 16, 2023
ad02d2f
refactor: App에서 Data 의존성 제거
hyeonghwan Dec 16, 2023
db3da8c
refactor: Data(Network) Layer Model 접근 제어자 Public
hyeonghwan Dec 16, 2023
c6726c0
refactor: Data Layer로 이동에 따른 repository 코드 수정
hyeonghwan Dec 16, 2023
ad9032d
refactor: APP -> Data - layer로 이동에 따른 임시주석 및 병경
hyeonghwan Dec 16, 2023
bbbcc0f
refactor: Data 모듈 , Domain 모듈 의존성 수정( UseCase는 Data Layer의 객체를 domain…
hyeonghwan Dec 16, 2023
882f0e0
feat: Domain Layer Use case 객체 추가 - 기존 viewModel은 usecase를 주입받음
hyeonghwan Dec 16, 2023
dbf318c
refactor: Repository Refactor
hyeonghwan Dec 16, 2023
d9d1589
refactor: Data Layer 모델 , Provider 접근제어자 refactoring
hyeonghwan Dec 16, 2023
a35d048
feat: Domain usecase 호출할때 필요한 parameter 모델 정의
hyeonghwan Dec 16, 2023
4bcfae4
build : Tuist Build setting 모듈 템플릿 변수, 파일 리팩토링, 의존성 수정
hyeonghwan Dec 16, 2023
01ef6c8
resources: 리소스 파일 변경
hyeonghwan Dec 16, 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
171 changes: 171 additions & 0 deletions Projects/CodestackApp/Derived/Sources/TuistAssets+CodestackApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// swiftlint:disable all
// swift-format-ignore-file
// swiftformat:disable all
// Generated using tuist — https://github.com/tuist/tuist

#if os(macOS)
import AppKit
#elseif os(iOS)
import UIKit
#elseif os(tvOS) || os(watchOS)
import UIKit
#endif
#if canImport(SwiftUI)
import SwiftUI
#endif

// swiftlint:disable superfluous_disable_command file_length implicit_return

// MARK: - Asset Catalogs

// swiftlint:disable identifier_name line_length nesting type_body_length type_name
public enum CodestackAppAsset {
public static let accentColor = CodestackAppColors(name: "AccentColor")
public static let bell = CodestackAppImages(name: "bell")
public static let cftype = CodestackAppImages(name: "cftype")
public static let codeStack = CodestackAppImages(name: "codeStack")
public static let github = CodestackAppImages(name: "github")
public static let home = CodestackAppImages(name: "home")
public static let mainBanner = CodestackAppImages(name: "main-banner")
public static let my = CodestackAppImages(name: "my")
public static let onboarding1 = CodestackAppImages(name: "onboarding-1")
public static let onboarding2 = CodestackAppImages(name: "onboarding-2")
public static let problem = CodestackAppImages(name: "problem")
public static let submit = CodestackAppImages(name: "submit")
}
// swiftlint:enable identifier_name line_length nesting type_body_length type_name

// MARK: - Implementation Details

public final class CodestackAppColors {
public fileprivate(set) var name: String

#if os(macOS)
public typealias Color = NSColor
#elseif os(iOS) || os(tvOS) || os(watchOS)
public typealias Color = UIColor
#endif

@available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, *)
public private(set) lazy var color: Color = {
guard let color = Color(asset: self) else {
fatalError("Unable to load color asset named \(name).")
}
return color
}()

#if canImport(SwiftUI)
private var _swiftUIColor: Any? = nil
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
public private(set) var swiftUIColor: SwiftUI.Color {
get {
if self._swiftUIColor == nil {
self._swiftUIColor = SwiftUI.Color(asset: self)
}

return self._swiftUIColor as! SwiftUI.Color
}
set {
self._swiftUIColor = newValue
}
}
#endif

fileprivate init(name: String) {
self.name = name
}
}

public extension CodestackAppColors.Color {
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, macOS 10.13, *)
convenience init?(asset: CodestackAppColors) {
let bundle = CodestackAppResources.bundle
#if os(iOS) || os(tvOS)
self.init(named: asset.name, in: bundle, compatibleWith: nil)
#elseif os(macOS)
self.init(named: NSColor.Name(asset.name), bundle: bundle)
#elseif os(watchOS)
self.init(named: asset.name)
#endif
}
}

#if canImport(SwiftUI)
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
public extension SwiftUI.Color {
init(asset: CodestackAppColors) {
let bundle = CodestackAppResources.bundle
self.init(asset.name, bundle: bundle)
}
}
#endif

public struct CodestackAppImages {
public fileprivate(set) var name: String

#if os(macOS)
public typealias Image = NSImage
#elseif os(iOS) || os(tvOS) || os(watchOS)
public typealias Image = UIImage
#endif

public var image: Image {
let bundle = CodestackAppResources.bundle
#if os(iOS) || os(tvOS)
let image = Image(named: name, in: bundle, compatibleWith: nil)
#elseif os(macOS)
let image = bundle.image(forResource: NSImage.Name(name))
#elseif os(watchOS)
let image = Image(named: name)
#endif
guard let result = image else {
fatalError("Unable to load image asset named \(name).")
}
return result
}

#if canImport(SwiftUI)
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
public var swiftUIImage: SwiftUI.Image {
SwiftUI.Image(asset: self)
}
#endif
}

public extension CodestackAppImages.Image {
@available(macOS, deprecated,
message: "This initializer is unsafe on macOS, please use the CodestackAppImages.image property")
convenience init?(asset: CodestackAppImages) {
#if os(iOS) || os(tvOS)
let bundle = CodestackAppResources.bundle
self.init(named: asset.name, in: bundle, compatibleWith: nil)
#elseif os(macOS)
self.init(named: NSImage.Name(asset.name))
#elseif os(watchOS)
self.init(named: asset.name)
#endif
}
}

#if canImport(SwiftUI)
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *)
public extension SwiftUI.Image {
init(asset: CodestackAppImages) {
let bundle = CodestackAppResources.bundle
self.init(asset.name, bundle: bundle)
}

init(asset: CodestackAppImages, label: Text) {
let bundle = CodestackAppResources.bundle
self.init(asset.name, bundle: bundle, label: label)
}

init(decorative asset: CodestackAppImages) {
let bundle = CodestackAppResources.bundle
self.init(decorative: asset.name, bundle: bundle)
}
}
#endif

// swiftlint:enable all
// swiftformat:enable all
96 changes: 18 additions & 78 deletions Projects/CodestackApp/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
import ProjectDescription
import ProjectDescriptionHelpers


let dependencies: [TargetDependency] = [
.PRO.data,
.PRO.domain
]

let entitlementPath: ProjectDescription.Path = .relativeToCurrentFile("Resources/CodeStack.entitlements")

let resources: ResourceFileElements
= [
"Resources/Apollo/codestackSchema.graphqls",
Expand All @@ -26,85 +34,17 @@ let resources: ResourceFileElements
"Resources/PLanguage/python3/*.txt",
"Resources/PLanguage/swift/*.txt",
"Resources/PLanguage/typescript/*.txt",
"Resources/Base.lproj/LaunchScreen.storyboard",
"Sources/Data/MO/db_model_v1.xcdatamodeld"
"Resources/Base.lproj/LaunchScreen.storyboard"
]

let project = Project.createModule(name: "CodestackApp",
product: .app,
bundleID: "kr.co.codestack.ios",
settings: true,
dependencies: dependencies,
configuration: true,
resources: resources,
entitlement: entitlementPath,
infoPlist: "Config/Info.plist")

let project = Project(name: "CodestackApp",
organizationName: "hyeong",
options: .options(automaticSchemesOptions: .disabled),
packages: [],
settings: .settings(configurations: [
.debug(name: "Dev",
settings: [:],
xcconfig: "Config/BuildSetting.xcconfig"),
.debug(name: "Prod",
settings: [:],
xcconfig: "Config/BuildSetting.xcconfig"),
]),
targets: [
Project.target(name: "CodestackApp",
product: .app,
bundleID: "kr.co.codestack.ios",
infoPlist: "Config/Info.plist",
sources: "Sources/**",
resources: resources,
entitlement: .relativeToCurrentFile("Resources/CodeStack.entitlements"),
dependencies: [

.project(target: "Global", path: .relativeToRoot("Projects/Global")),
.project(target: "Data", path: .relativeToRoot("Projects/Data")),
.rxSwift,
.snapKit,
.then,
.apollo,
.richtextKit,
.rxdatasources,
.rxFlow,
.rxGesture,
.sqlite,
.swinject,
.codestackAPI,
.highlightr,
],
configuration: [
.debug(name: "Dev",
settings: [:],
xcconfig: "Config/Codestack.xcconfig"),
.debug(name: "Prod",
settings: [:],
xcconfig: "Config/Codestack.xcconfig")
]),
],
schemes: [
Scheme(name: "CodestackApp-Dev",
shared: true,
buildAction: .buildAction(targets: ["CodestackApp"]),
testAction: .targets(["MyAppTests"],
configuration: .configuration("Dev"),
options: .options(coverage: true)),
runAction: .runAction(configuration: .configuration("Dev"),
arguments: .init(environment: ["OS_ACTIVITY_MODE" : "disable"],
launchArguments: [])),
archiveAction: .archiveAction(configuration: .configuration("Dev")),
profileAction: .profileAction(configuration: .configuration("Dev")),
analyzeAction: .analyzeAction(configuration: .configuration("Dev"))),
Scheme(name: "CodestackApp-Prod",
shared: true,
buildAction: .buildAction(targets: ["CodestackApp"]),
runAction: .runAction(configuration: .configuration("Prod")),
archiveAction: .archiveAction(configuration: .configuration("Prod")),
profileAction: .profileAction(configuration: .configuration("Prod")),
analyzeAction: .analyzeAction(configuration: .configuration("Prod")))
],
fileHeaderTemplate: nil,
additionalFiles: [],
resourceSynthesizers: [])

// Project.target(name: "MyAppTests",
// product: .unitTests,
// sources: "Tests/**",
// dependencies: [
// .target(name: "MyApp"),
// ])
Binary file not shown.
Binary file not shown.
15 changes: 5 additions & 10 deletions Projects/CodestackApp/Sources/APP/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ import RxSwift
import RxFlow
import Swinject
import Global
import Data
import Domain

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?

var coordinator: FlowCoordinator = FlowCoordinator()
private var gitAuthUsecase: AuthUsecase?
var disposeBag: DisposeBag = DisposeBag()

private let loginService: Auth = LoginService()
private let authService: RestAPI = DefaultRestAPI()
// private lazy var appleLoginManger: AppleLoginManager = AppleLoginManager(serviceManager: self.loginService as AppleAuthorization)

private let injector = DefaultInjector(container: Container())

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
Expand All @@ -48,16 +44,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
let flow = AppFlow(dependency: appDependency)

self.coordinator.coordinate(flow: flow, with: AppStepper())

self.gitAuthUsecase = injector.resolve(AuthUsecase.self)
Flows.use(flow, when: .created, block: { root in
window.rootViewController = root
window.makeKeyAndVisible()
})
self.window = window
}



/// Git Auth 과정에서 redirect 되었을때 호출되는 함수
/// - Parameters:
/// - scene: 현재의 scene
Expand All @@ -71,7 +65,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
if let flag = component.first?.elementsEqual("codestackios://git/auth"),
flag,
let code = component.last?.components(separatedBy: "=").last{
(loginService as GitAuth).gitOAuthComplete(code: code)
// TODO: LoginVIewModel Protocol을 어떻게든 해야댐
gitAuthUsecase?.gitOAuthComplete(code: code)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import RxCocoa
import RxFlow
import RxSwift
import Global
import Domain

class ContributionViewModel: ObservableObject, RxFlow.Stepper {

Expand All @@ -22,16 +23,13 @@ class ContributionViewModel: ObservableObject, RxFlow.Stepper {
depth: .one)]

struct Dependency {
let service: WebRepository
let submissionUsecase: SubmissionUseCase
}

private var service: WebRepository?
private var submissionUsecase: SubmissionUseCase?

static func create(depenedency: Dependency) -> ContributionViewModel {
let viewModel = ContributionViewModel()
viewModel.service = depenedency.service
viewModel.submissionUsecase = depenedency.submissionUsecase
viewModel.binding()
return viewModel
Expand Down Expand Up @@ -66,7 +64,7 @@ class ContributionViewModel: ObservableObject, RxFlow.Stepper {
}


private func caculateCurrentContribution(value: SubmissionCalendar) -> [SubmissionContribution] {
private func caculateCurrentContribution(value: SubmissionCalendarVO) -> [SubmissionContribution] {

var dayArray: [String: SubmissionContribution] = self.getContributionDates(size: contribution_day_count)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import UIKit
import SnapKit
import RichTextKit
import Global
import Domain

class RichTextViewController: UIViewController{

Expand Down
1 change: 1 addition & 0 deletions Projects/CodestackApp/Sources/DI/CodeEditorAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Swinject
import Network
import Domain


public struct CodeEditorAssembly: Assembly {
Expand Down
Loading