Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 40 additions & 4 deletions Projects/Data/Data.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
3D7C36B11F2F7C3A87B33C09 /* gitkeep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 918D54447E8741D1A3F36725 /* gitkeep.swift */; };
43E9C2380F425520C1FA1AD2 /* CourseDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAAC2885ACFE998578DC25E8 /* CourseDTO.swift */; };
684AAEA9796EED3F9FC592FC /* NetworkConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D46FD93B80D052843AD5063 /* NetworkConfiguration.swift */; };
901ACA7B98089AB702ADA830 /* Domain.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06FAA1459D11CCE724C34195 /* Domain.framework */; };
B2F8FBFA915F696CCCA4152A /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A3B0D3D8C7049B6856791C1D /* Alamofire.framework */; };
E1BFC73FB539432F6E12CD94 /* CourseRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0730BC3657E24BCEA511A3C /* CourseRepository.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -26,9 +29,12 @@

/* Begin PBXFileReference section */
033B57EACF093CA22F91EAB9 /* Data-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Data-Info.plist"; sourceTree = "<group>"; };
06FAA1459D11CCE724C34195 /* Domain.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Domain.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4E75197C294DE74F5162FAA7 /* Data.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Data.framework; sourceTree = BUILT_PRODUCTS_DIR; };
918D54447E8741D1A3F36725 /* gitkeep.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = gitkeep.swift; sourceTree = "<group>"; };
5D46FD93B80D052843AD5063 /* NetworkConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkConfiguration.swift; sourceTree = "<group>"; };
A3B0D3D8C7049B6856791C1D /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AAAC2885ACFE998578DC25E8 /* CourseDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDTO.swift; sourceTree = "<group>"; };
B0730BC3657E24BCEA511A3C /* CourseRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseRepository.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -37,6 +43,7 @@
buildActionMask = 2147483647;
files = (
B2F8FBFA915F696CCCA4152A /* Alamofire.framework in Frameworks */,
901ACA7B98089AB702ADA830 /* Domain.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -48,10 +55,27 @@
children = (
A3B0D3D8C7049B6856791C1D /* Alamofire.framework */,
4E75197C294DE74F5162FAA7 /* Data.framework */,
06FAA1459D11CCE724C34195 /* Domain.framework */,
);
name = Products;
sourceTree = "<group>";
};
647255CD65221C9CD4A43DED /* DTO */ = {
isa = PBXGroup;
children = (
AAAC2885ACFE998578DC25E8 /* CourseDTO.swift */,
);
path = DTO;
sourceTree = "<group>";
};
73F3ED55BFDC2EF15878F5B6 /* Repository */ = {
isa = PBXGroup;
children = (
B0730BC3657E24BCEA511A3C /* CourseRepository.swift */,
);
path = Repository;
sourceTree = "<group>";
};
8A6D38DA6706D1F4DD8A055B = {
isa = PBXGroup;
children = (
Expand All @@ -60,6 +84,14 @@
);
sourceTree = "<group>";
};
A46DA33BCE1E2288153B2AC3 /* Network */ = {
isa = PBXGroup;
children = (
5D46FD93B80D052843AD5063 /* NetworkConfiguration.swift */,
);
path = Network;
sourceTree = "<group>";
};
AABE3A120DFAA5B30C74694C /* InfoPlists */ = {
isa = PBXGroup;
children = (
Expand All @@ -79,7 +111,9 @@
C590795A2658F92D49B27E8D /* Sources */ = {
isa = PBXGroup;
children = (
918D54447E8741D1A3F36725 /* gitkeep.swift */,
647255CD65221C9CD4A43DED /* DTO */,
A46DA33BCE1E2288153B2AC3 /* Network */,
73F3ED55BFDC2EF15878F5B6 /* Repository */,
);
path = Sources;
sourceTree = "<group>";
Expand Down Expand Up @@ -159,7 +193,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3D7C36B11F2F7C3A87B33C09 /* gitkeep.swift in Sources */,
43E9C2380F425520C1FA1AD2 /* CourseDTO.swift in Sources */,
684AAEA9796EED3F9FC592FC /* NetworkConfiguration.swift in Sources */,
E1BFC73FB539432F6E12CD94 /* CourseRepository.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
1 change: 1 addition & 0 deletions Projects/Data/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let project = Project(
bundleId: "io.tuist.Data",
sources: ["Sources/**"],
dependencies: [
.project(target: "Domain", path: "../Domain"),
.external(name: "Alamofire")
]
)
Expand Down
49 changes: 49 additions & 0 deletions Projects/Data/Sources/DTO/CourseDTO.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// CourseDTO.swift
// Data
//
// Created by ๋ฐ•์ง€์œค on 7/8/25.
//

import Foundation
import Domain

public struct HomeCourseDTO: Decodable {
public let list: [CourseDTO]?
}

public struct CourseDTO: Decodable {
public let courseInfoDTO: [CourseInfoDTO]?
}

public struct CourseInfoDTO: Decodable {
public let courseLv: Int?
public let courseDescription: String?
public let stepList: [StepInfoDTO]?
}

public struct StepInfoDTO: Decodable {
public let stepLv: Int?
public let stepTitle: String?
public let stepDescription: String?
public let stepStatus: String?
}

extension CourseDTO {
func toDomain() -> CourseVO {
return CourseVO(courseLv: 1,
courseDescription: "courseDescription",
stepLv: 1,
stepTitle: "stepTitle",
stepDescription: "stepDescription",
stepStatus: "SOLVED")
}
}

extension HomeCourseDTO {
func toHome() -> HomeCourseVO {
let courseList = list ?? []
return .init(list: Array(courseList
.map{$0.toDomain()}))
}
}
11 changes: 11 additions & 0 deletions Projects/Data/Sources/Network/NetworkConfiguration.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// NetworkConfiguration.swift
// Data
//
// Created by ๋ฐ•์ง€์œค on 7/8/25.
//

enum NetworkConfiguration {
static let appID = ""
static let baseUrl = "https://"
}
57 changes: 57 additions & 0 deletions Projects/Data/Sources/Repository/CourseRepository.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// CourseRepository.swift
// Data
//
// Created by ๋ฐ•์ง€์œค on 7/8/25.
//

import Domain
import RxSwift
import Alamofire

public class DefaultCourseRepository: CourseRepository {
public init() {}

public func getCourses() -> Single<CourseVO> {
return request(
endpoint: NetworkConfiguration.baseUrl,
id: 4,
responseType: CourseDTO.self
)
.map { dto in
return CourseVO(
courseLv: 1,
courseDescription: "courseDescription",
stepLv: 1,
stepTitle: "stepTitle",
stepDescription: "stepDescription",
stepStatus: "SOLVED"
)
}
}

private func request<T: Decodable>(endpoint: String, id: Int, responseType: T.Type) -> Single<T> {
return Single.create { single in
let url = "\(NetworkConfiguration.baseUrl)\(endpoint)"
let parameters: Parameters = [
"id": id
]

let request = AF.request(url,
method: .get,
parameters: parameters,
encoding: URLEncoding.queryString)
.validate()
.responseDecodable(of: responseType) { response in
switch response.result {
case .success(let value):
single(.success(value))
case .failure(let error):
single(.failure(error))
}
}

return Disposables.create { request.cancel() }
}
}
}
7 changes: 0 additions & 7 deletions Projects/Data/Sources/gitkeep.swift

This file was deleted.

45 changes: 39 additions & 6 deletions Projects/Domain/Domain.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objectVersion = 55;
objects = {

/* Begin PBXBuildFile section */
0BCC97781DA6EE874B081DBE /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2E30672E510822AAF38EAD /* RxSwift.framework */; };
850D3256EE250153F112D564 /* gitkeep.swift in Sources */ = {isa = PBXBuildFile; fileRef = F05702E18938E331F26864D0 /* gitkeep.swift */; };
5EB8590C9D2C002D0BDBC021 /* CourseVO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 747DBBCAB797E5E0A82177F2 /* CourseVO.swift */; };
69DAD609572D32F2BA3845AE /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E1DA9A49E79A791F7A526A1 /* String+Extension.swift */; };
BBED9ACB62B271298F7028F8 /* CourseUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F904C836B5CD2D4DA5EAE38D /* CourseUseCase.swift */; };
D510BC17C4583615CB60439E /* CourseRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCA3E06ED2A8180A63919B6C /* CourseRepository.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -25,9 +28,12 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
2E1DA9A49E79A791F7A526A1 /* String+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = "<group>"; };
747DBBCAB797E5E0A82177F2 /* CourseVO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseVO.swift; sourceTree = "<group>"; };
9A2E30672E510822AAF38EAD /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
BD15A37E85BAE3A36B2CE72C /* Domain-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Domain-Info.plist"; sourceTree = "<group>"; };
F05702E18938E331F26864D0 /* gitkeep.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = gitkeep.swift; sourceTree = "<group>"; };
DCA3E06ED2A8180A63919B6C /* CourseRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseRepository.swift; sourceTree = "<group>"; };
F904C836B5CD2D4DA5EAE38D /* CourseUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseUseCase.swift; sourceTree = "<group>"; };
FD49F277B86481D3D105FAC8 /* Domain.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Domain.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -60,18 +66,29 @@
name = Products;
sourceTree = "<group>";
};
266DBF54466AF3D041290301 /* Extension */ = {
isa = PBXGroup;
children = (
2E1DA9A49E79A791F7A526A1 /* String+Extension.swift */,
);
path = Extension;
sourceTree = "<group>";
};
28B694539E22431DAF52B883 /* Sources */ = {
isa = PBXGroup;
children = (
266DBF54466AF3D041290301 /* Extension */,
BC1A55AF7DC675AFEA6E7C12 /* RepositoryProtocol */,
2BE278B80FDD95404961E580 /* UseCase */,
9C17CEB3595F4C3FA69C5BAF /* VO */,
);
path = Sources;
sourceTree = "<group>";
};
2BE278B80FDD95404961E580 /* UseCase */ = {
isa = PBXGroup;
children = (
F904C836B5CD2D4DA5EAE38D /* CourseUseCase.swift */,
);
path = UseCase;
sourceTree = "<group>";
Expand All @@ -93,10 +110,18 @@
name = Project;
sourceTree = "<group>";
};
9C17CEB3595F4C3FA69C5BAF /* VO */ = {
isa = PBXGroup;
children = (
747DBBCAB797E5E0A82177F2 /* CourseVO.swift */,
);
path = VO;
sourceTree = "<group>";
};
BC1A55AF7DC675AFEA6E7C12 /* RepositoryProtocol */ = {
isa = PBXGroup;
children = (
F05702E18938E331F26864D0 /* gitkeep.swift */,
DCA3E06ED2A8180A63919B6C /* CourseRepository.swift */,
);
path = RepositoryProtocol;
sourceTree = "<group>";
Expand Down Expand Up @@ -139,6 +164,8 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
TargetAttributes = {
};
};
buildConfigurationList = 5B17347D429F14C389327C78 /* Build configuration list for PBXProject "Domain" */;
compatibilityVersion = "Xcode 14.0";
Expand Down Expand Up @@ -173,7 +200,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
850D3256EE250153F112D564 /* gitkeep.swift in Sources */,
69DAD609572D32F2BA3845AE /* String+Extension.swift in Sources */,
D510BC17C4583615CB60439E /* CourseRepository.swift in Sources */,
BBED9ACB62B271298F7028F8 /* CourseUseCase.swift in Sources */,
5EB8590C9D2C002D0BDBC021 /* CourseVO.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -347,7 +377,10 @@
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = (
"$(inherited)",
DEBUG,
);
SWIFT_COMPILATION_MODE = singlefile;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand Down
18 changes: 18 additions & 0 deletions Projects/Domain/Sources/Extension/String+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// String+Extension.swift
// Domain
//
// Created by ๋ฐ•์ง€์œค on 7/8/25.
//

import Foundation

extension String {
func formatDateString() -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
guard let date = dateFormatter.date(from: self) else { return self }
dateFormatter.dateFormat = "yyyy๋…„ MM์›” dd์ผ"
return dateFormatter.string(from: date)
}
}
12 changes: 12 additions & 0 deletions Projects/Domain/Sources/RepositoryProtocol/CourseRepository.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// CourseRepository.swift
// Domain
//
// Created by ๋ฐ•์ง€์œค on 7/8/25.
//

import RxSwift

public protocol CourseRepository {
func getCourses() -> Single<CourseVO>
}
7 changes: 0 additions & 7 deletions Projects/Domain/Sources/RepositoryProtocol/gitkeep.swift

This file was deleted.

Loading
Loading