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

피드리스트를 받기 위한 UseCase, Entities,Repository를 정의했습니다. #4

Merged
merged 16 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
48 changes: 48 additions & 0 deletions HomeCafeRecipes/HomeCafeRecipes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
1D1283A22C15E94300C5A870 /* Recipe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D1283A12C15E94300C5A870 /* Recipe.swift */; };
1D1283A42C15EA8100C5A870 /* RecipeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D1283A32C15EA8100C5A870 /* RecipeType.swift */; };
1D1283A62C15EAA600C5A870 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D1283A52C15EAA600C5A870 /* User.swift */; };
1D1283A82C15EABB00C5A870 /* Comment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D1283A72C15EABB00C5A870 /* Comment.swift */; };
1D1283AA2C15EBCF00C5A870 /* SearchFeedUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D1283A92C15EBCF00C5A870 /* SearchFeedUseCase.swift */; };
1D1283AC2C15EBE600C5A870 /* FetchFeedListUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D1283AB2C15EBE600C5A870 /* FetchFeedListUseCase.swift */; };
1D2C16E62BE532B700C04508 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D2C16E52BE532B700C04508 /* AppDelegate.swift */; };
1D2C16E82BE532B700C04508 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D2C16E72BE532B700C04508 /* SceneDelegate.swift */; };
1D2C16EA2BE532B700C04508 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D2C16E92BE532B700C04508 /* ViewController.swift */; };
Expand Down Expand Up @@ -35,6 +41,12 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
1D1283A12C15E94300C5A870 /* Recipe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Recipe.swift; sourceTree = "<group>"; };
1D1283A32C15EA8100C5A870 /* RecipeType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecipeType.swift; sourceTree = "<group>"; };
1D1283A52C15EAA600C5A870 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = "<group>"; };
1D1283A72C15EABB00C5A870 /* Comment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Comment.swift; sourceTree = "<group>"; };
1D1283A92C15EBCF00C5A870 /* SearchFeedUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchFeedUseCase.swift; sourceTree = "<group>"; };
1D1283AB2C15EBE600C5A870 /* FetchFeedListUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchFeedListUseCase.swift; sourceTree = "<group>"; };
1D2C16E22BE532B700C04508 /* HomeCafeRecipes.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HomeCafeRecipes.app; sourceTree = BUILT_PRODUCTS_DIR; };
1D2C16E52BE532B700C04508 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
1D2C16E72BE532B700C04508 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -74,6 +86,26 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
1D12839F2C15E7A700C5A870 /* Entities */ = {
isa = PBXGroup;
children = (
1D1283A12C15E94300C5A870 /* Recipe.swift */,
1D1283A32C15EA8100C5A870 /* RecipeType.swift */,
1D1283A52C15EAA600C5A870 /* User.swift */,
1D1283A72C15EABB00C5A870 /* Comment.swift */,
);
path = Entities;
sourceTree = "<group>";
};
1D1283A02C15E92C00C5A870 /* UseCases */ = {
isa = PBXGroup;
children = (
1D1283A92C15EBCF00C5A870 /* SearchFeedUseCase.swift */,
1D1283AB2C15EBE600C5A870 /* FetchFeedListUseCase.swift */,
);
path = UseCases;
sourceTree = "<group>";
};
1D2C16D92BE532B700C04508 = {
isa = PBXGroup;
children = (
Expand All @@ -97,6 +129,7 @@
1D2C16E42BE532B700C04508 /* HomeCafeRecipes */ = {
isa = PBXGroup;
children = (
1D740B402C15E6680001B704 /* Domain */,
1D2C16E52BE532B700C04508 /* AppDelegate.swift */,
1D2C16E72BE532B700C04508 /* SceneDelegate.swift */,
1D2C16E92BE532B700C04508 /* ViewController.swift */,
Expand Down Expand Up @@ -124,6 +157,15 @@
path = HomeCafeRecipesUITests;
sourceTree = "<group>";
};
1D740B402C15E6680001B704 /* Domain */ = {
isa = PBXGroup;
children = (
1D1283A02C15E92C00C5A870 /* UseCases */,
1D12839F2C15E7A700C5A870 /* Entities */,
);
path = Domain;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -261,7 +303,13 @@
files = (
1D2C16EA2BE532B700C04508 /* ViewController.swift in Sources */,
1D2C16E62BE532B700C04508 /* AppDelegate.swift in Sources */,
1D1283A62C15EAA600C5A870 /* User.swift in Sources */,
1D1283AC2C15EBE600C5A870 /* FetchFeedListUseCase.swift in Sources */,
1D1283A82C15EABB00C5A870 /* Comment.swift in Sources */,
1D1283A42C15EA8100C5A870 /* RecipeType.swift in Sources */,
1D1283AA2C15EBCF00C5A870 /* SearchFeedUseCase.swift in Sources */,
1D2C16E82BE532B700C04508 /* SceneDelegate.swift in Sources */,
1D1283A22C15E94300C5A870 /* Recipe.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
20 changes: 20 additions & 0 deletions HomeCafeRecipes/HomeCafeRecipes/Domain/Entities/Recipe.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Recipe.swift
// HomeCafeRecipes
//
// Created by 김건호 on 6/9/24.
//

import Foundation

struct Recipe {
let id: Int
let type: RecipeType
let name: String
let description: String
let writer: User
let imageUrls: [String]
let isLiked: Bool
let likeCount: Int
let createdAt: Date
Comment on lines +18 to +19

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likeCount가 없을 땐 0으로 가져가는건가요? nullable한 값을 가지지 않는건지 궁금해요. (likeCount 외에 다른 값들도 전부 required네요)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 likeCount가 없을때는 0으로 가져갑니다!

}
13 changes: 13 additions & 0 deletions HomeCafeRecipes/HomeCafeRecipes/Domain/Entities/RecipeType.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// RecipeType.swift
// HomeCafeRecipes
//
// Created by 김건호 on 6/9/24.
//



enum RecipeType: String {
case coffee
case dessert
Comment on lines +11 to +12

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

외에는 더 없나요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 일단은 커피와 디저트만 생각하고 있습니다!

}