Skip to content

Commit

Permalink
Merge pull request #2 from wongbingg/feature/1-domain-layer
Browse files Browse the repository at this point in the history
Feature/1 domain layer
  • Loading branch information
wongbingg authored Feb 23, 2023
2 parents 5005825 + fe78d3b commit 703884a
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
BoxOffice2.xcodeproj/project.xcworkspace/xcuserdata/leewonbeen.xcuserdatad/UserInterfaceState.xcuserstate
52 changes: 52 additions & 0 deletions BoxOffice2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
AF51F6D529A70E75007A5A87 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF51F6D429A70E75007A5A87 /* ViewController.swift */; };
AF51F6DA29A70E76007A5A87 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AF51F6D929A70E76007A5A87 /* Assets.xcassets */; };
AF51F6DD29A70E76007A5A87 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AF51F6DB29A70E76007A5A87 /* LaunchScreen.storyboard */; };
AF51F6E929A7134A007A5A87 /* MovieCellData.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF51F6E829A7134A007A5A87 /* MovieCellData.swift */; };
AF51F6EB29A71355007A5A87 /* MovieDetailData.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF51F6EA29A71355007A5A87 /* MovieDetailData.swift */; };
AF51F6ED29A71EC7007A5A87 /* MovieRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF51F6EC29A71EC7007A5A87 /* MovieRepository.swift */; };
AF51F6EF29A71F5C007A5A87 /* SearchMoviesUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF51F6EE29A71F5C007A5A87 /* SearchMoviesUseCase.swift */; };
AF51F6F129A71FCF007A5A87 /* SearchMovieDetailUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF51F6F029A71FCF007A5A87 /* SearchMovieDetailUseCase.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -22,6 +27,11 @@
AF51F6D929A70E76007A5A87 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
AF51F6DC29A70E76007A5A87 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
AF51F6DE29A70E76007A5A87 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AF51F6E829A7134A007A5A87 /* MovieCellData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieCellData.swift; sourceTree = "<group>"; };
AF51F6EA29A71355007A5A87 /* MovieDetailData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieDetailData.swift; sourceTree = "<group>"; };
AF51F6EC29A71EC7007A5A87 /* MovieRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieRepository.swift; sourceTree = "<group>"; };
AF51F6EE29A71F5C007A5A87 /* SearchMoviesUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchMoviesUseCase.swift; sourceTree = "<group>"; };
AF51F6F029A71FCF007A5A87 /* SearchMovieDetailUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchMovieDetailUseCase.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -54,6 +64,7 @@
AF51F6CF29A70E75007A5A87 /* BoxOffice2 */ = {
isa = PBXGroup;
children = (
AF51F6E429A71314007A5A87 /* Domain */,
AF51F6D029A70E75007A5A87 /* AppDelegate.swift */,
AF51F6D229A70E75007A5A87 /* SceneDelegate.swift */,
AF51F6D429A70E75007A5A87 /* ViewController.swift */,
Expand All @@ -64,6 +75,42 @@
path = BoxOffice2;
sourceTree = "<group>";
};
AF51F6E429A71314007A5A87 /* Domain */ = {
isa = PBXGroup;
children = (
AF51F6E529A71319007A5A87 /* Entities */,
AF51F6E629A7131F007A5A87 /* UseCases */,
AF51F6E729A71324007A5A87 /* Interfaces */,
);
path = Domain;
sourceTree = "<group>";
};
AF51F6E529A71319007A5A87 /* Entities */ = {
isa = PBXGroup;
children = (
AF51F6E829A7134A007A5A87 /* MovieCellData.swift */,
AF51F6EA29A71355007A5A87 /* MovieDetailData.swift */,
);
path = Entities;
sourceTree = "<group>";
};
AF51F6E629A7131F007A5A87 /* UseCases */ = {
isa = PBXGroup;
children = (
AF51F6EE29A71F5C007A5A87 /* SearchMoviesUseCase.swift */,
AF51F6F029A71FCF007A5A87 /* SearchMovieDetailUseCase.swift */,
);
path = UseCases;
sourceTree = "<group>";
};
AF51F6E729A71324007A5A87 /* Interfaces */ = {
isa = PBXGroup;
children = (
AF51F6EC29A71EC7007A5A87 /* MovieRepository.swift */,
);
path = Interfaces;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -134,9 +181,14 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AF51F6E929A7134A007A5A87 /* MovieCellData.swift in Sources */,
AF51F6D529A70E75007A5A87 /* ViewController.swift in Sources */,
AF51F6ED29A71EC7007A5A87 /* MovieRepository.swift in Sources */,
AF51F6F129A71FCF007A5A87 /* SearchMovieDetailUseCase.swift in Sources */,
AF51F6EF29A71F5C007A5A87 /* SearchMoviesUseCase.swift in Sources */,
AF51F6D129A70E75007A5A87 /* AppDelegate.swift in Sources */,
AF51F6D329A70E75007A5A87 /* SceneDelegate.swift in Sources */,
AF51F6EB29A71355007A5A87 /* MovieDetailData.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
17 changes: 17 additions & 0 deletions BoxOffice2/Domain/Entities/MovieCellData.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// MovieCellData.swift
// BoxOffice2
//
// Created by 이원빈 on 2023/02/23.
//

struct MovieCellData {
let uuid: String
let posterURL: String
let currentRank: String
let title: String
let openDate: String
let totalAudience: String
let rankChange: String
let isNewEntry: Bool
}
25 changes: 25 additions & 0 deletions BoxOffice2/Domain/Entities/MovieDetailData.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// MovieDetailData.swift
// BoxOffice2
//
// Created by 이원빈 on 2023/02/23.
//

struct MovieDetailData {
let uuid: String
let posterURL: String
let currentRank: String
let title: String
let openDate: String
let totalAudience: String
let rankChange: String
let isNewEntry: Bool
let productionYear: String
let openYear: String
let showTime: String
let genreName: String
let directorName: String
let actors: [String]
let ageLimit: String
}

11 changes: 11 additions & 0 deletions BoxOffice2/Domain/Interfaces/MovieRepository.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// MovieRepository.swift
// BoxOffice2
//
// Created by 이원빈 on 2023/02/23.
//

protocol MovieRepository {
func fetchMovies() -> [MovieCellData]
func fetchMovieDetail() -> MovieDetailData
}
19 changes: 19 additions & 0 deletions BoxOffice2/Domain/UseCases/SearchMovieDetailUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// SearchMovieDetailUseCase.swift
// BoxOffice2
//
// Created by 이원빈 on 2023/02/23.
//


protocol SearchMovieDetailUseCase {
func execute() -> MovieDetailData
}

struct DefaultSearchMovieDetailUseCase: SearchMovieDetailUseCase {
let movieRepository: MovieRepository

func execute() -> MovieDetailData {
return movieRepository.fetchMovieDetail()
}
}
18 changes: 18 additions & 0 deletions BoxOffice2/Domain/UseCases/SearchMoviesUseCase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// SearchMoviesUseCase.swift
// BoxOffice2
//
// Created by 이원빈 on 2023/02/23.
//

protocol SearchMoviesUseCase {
func execute() -> [MovieCellData]
}

struct DefaultSearchMoviesUseCase: SearchMoviesUseCase {
let movieRepository: MovieRepository

func execute() -> [MovieCellData] {
return movieRepository.fetchMovies()
}
}

0 comments on commit 703884a

Please sign in to comment.