Skip to content

Commit

Permalink
chore: 클린 아키텍처 #1 도메인 레이어 구분
Browse files Browse the repository at this point in the history
===
1. Model -> 엔티티 그룹화
2. 유스케이스 추가 - 포즈 가져오기 & 포즈 업로드
  • Loading branch information
Parkjju committed Mar 18, 2024
1 parent ab1bf62 commit 77f50f3
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 87 deletions.
44 changes: 30 additions & 14 deletions posepicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
C903E53C2AF8C1BD00BD004F /* UIImageView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = C903E53B2AF8C1BD00BD004F /* UIImageView+.swift */; };
C903E5402AFCC46E00BD004F /* FilteredPose.swift in Sources */ = {isa = PBXBuildFile; fileRef = C903E53F2AFCC46E00BD004F /* FilteredPose.swift */; };
C903E5422AFCC60D00BD004F /* Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = C903E5412AFCC60D00BD004F /* Page.swift */; };
C903E5442AFCC62600BD004F /* RecommendedContents.swift in Sources */ = {isa = PBXBuildFile; fileRef = C903E5432AFCC62600BD004F /* RecommendedContents.swift */; };
C903E5472B01F51F00BD004F /* PoseFeedEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C903E5462B01F51F00BD004F /* PoseFeedEmptyView.swift */; };
C903E54A2B05BCA300BD004F /* PopUpViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C903E5492B05BCA300BD004F /* PopUpViewController.swift */; };
C903E54C2B05C13B00BD004F /* PopUpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C903E54B2B05C13B00BD004F /* PopUpView.swift */; };
Expand Down Expand Up @@ -152,6 +151,7 @@
C9D0C4062BA2D228004A3940 /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D0C4052BA2D228004A3940 /* Toast.swift */; };
C9D0C4082BA4172C004A3940 /* UserRevokeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D0C4072BA4172C004A3940 /* UserRevokeViewController.swift */; };
C9D0C40B2BA4501C004A3940 /* Functions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D0C40A2BA4501C004A3940 /* Functions.swift */; };
C9D0C4102BA828DD004A3940 /* PoseUseCases.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D0C40F2BA828DD004A3940 /* PoseUseCases.swift */; };
C9DC2F8E2AEA193300D5170D /* PoseFeedCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9DC2F8D2AEA193300D5170D /* PoseFeedCoordinator.swift */; };
C9DC2F902AEA1D5F00D5170D /* PoseFeedFilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9DC2F8F2AEA1D5F00D5170D /* PoseFeedFilterViewController.swift */; };
C9DC2F942AEA282700D5170D /* LeftAlignedCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9DC2F932AEA282600D5170D /* LeftAlignedCollectionViewFlowLayout.swift */; };
Expand Down Expand Up @@ -226,7 +226,6 @@
C903E53B2AF8C1BD00BD004F /* UIImageView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+.swift"; sourceTree = "<group>"; };
C903E53F2AFCC46E00BD004F /* FilteredPose.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilteredPose.swift; sourceTree = "<group>"; };
C903E5412AFCC60D00BD004F /* Page.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Page.swift; sourceTree = "<group>"; };
C903E5432AFCC62600BD004F /* RecommendedContents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendedContents.swift; sourceTree = "<group>"; };
C903E5462B01F51F00BD004F /* PoseFeedEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PoseFeedEmptyView.swift; sourceTree = "<group>"; };
C903E5492B05BCA300BD004F /* PopUpViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopUpViewController.swift; sourceTree = "<group>"; };
C903E54B2B05C13B00BD004F /* PopUpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopUpView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -320,6 +319,7 @@
C9D0C4052BA2D228004A3940 /* Toast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = "<group>"; };
C9D0C4072BA4172C004A3940 /* UserRevokeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserRevokeViewController.swift; sourceTree = "<group>"; };
C9D0C40A2BA4501C004A3940 /* Functions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Functions.swift; sourceTree = "<group>"; };
C9D0C40F2BA828DD004A3940 /* PoseUseCases.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PoseUseCases.swift; sourceTree = "<group>"; };
C9DC2F8D2AEA193300D5170D /* PoseFeedCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PoseFeedCoordinator.swift; sourceTree = "<group>"; };
C9DC2F8F2AEA1D5F00D5170D /* PoseFeedFilterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PoseFeedFilterViewController.swift; sourceTree = "<group>"; };
C9DC2F932AEA282600D5170D /* LeftAlignedCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftAlignedCollectionViewFlowLayout.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -564,7 +564,6 @@
88EA81F02AF69BD700020DEA /* PoseFeed.swift */,
C903E53F2AFCC46E00BD004F /* FilteredPose.swift */,
C903E5412AFCC60D00BD004F /* Page.swift */,
C903E5432AFCC62600BD004F /* RecommendedContents.swift */,
88D5C4802B027B0A0045C081 /* PoseFeedSection.swift */,
C9FDBDED2B28487E0045AA54 /* BookmarkSection.swift */,
C9FDBDF12B288F580045AA54 /* BookmarkResponse.swift */,
Expand Down Expand Up @@ -926,7 +925,7 @@
C9C890842AE106EF0010240A /* Common */,
C971A6792B2008870078EF2B /* Configs */,
C9C8909A2AE107A40010240A /* Extensions */,
C9C8909E2AE107CA0010240A /* Models */,
C9D0C40C2BA827BE004A3940 /* Domain */,
C9C890A32AE109D80010240A /* Modules */,
C9C890A72AE10A280010240A /* Networking */,
C9C890AA2AE10A3D0010240A /* Resources */,
Expand Down Expand Up @@ -1012,15 +1011,6 @@
path = UIColor;
sourceTree = "<group>";
};
C9C8909E2AE107CA0010240A /* Models */ = {
isa = PBXGroup;
children = (
88EA81EE2AF69BB900020DEA /* User */,
88EA81EF2AF69BBD00020DEA /* Pose */,
);
path = Models;
sourceTree = "<group>";
};
C9C890A32AE109D80010240A /* Modules */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1107,6 +1097,32 @@
path = Functions;
sourceTree = "<group>";
};
C9D0C40C2BA827BE004A3940 /* Domain */ = {
isa = PBXGroup;
children = (
C9D0C40D2BA8284B004A3940 /* Entities */,
C9D0C40E2BA82857004A3940 /* UseCases */,
);
path = Domain;
sourceTree = "<group>";
};
C9D0C40D2BA8284B004A3940 /* Entities */ = {
isa = PBXGroup;
children = (
88EA81EE2AF69BB900020DEA /* User */,
88EA81EF2AF69BBD00020DEA /* Pose */,
);
path = Entities;
sourceTree = "<group>";
};
C9D0C40E2BA82857004A3940 /* UseCases */ = {
isa = PBXGroup;
children = (
C9D0C40F2BA828DD004A3940 /* PoseUseCases.swift */,
);
path = UseCases;
sourceTree = "<group>";
};
C9DC2F912AEA27F600D5170D /* UICollectionView */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1417,6 +1433,7 @@
C916730E2B5E526D0092661B /* ImagePopUpViewController.swift in Sources */,
C94FD2772AE38E82003777EB /* AppCoordinator.swift in Sources */,
88EA81F82AF6A2DE00020DEA /* PoseFeedPhotoCellViewModel.swift in Sources */,
C9D0C4102BA828DD004A3940 /* PoseUseCases.swift in Sources */,
C94FD2752AE38E26003777EB /* RootViewController.swift in Sources */,
C91A265F2B8788F900F1193E /* MyPoseCoordinator.swift in Sources */,
C9FDBDF22B288F580045AA54 /* BookmarkResponse.swift in Sources */,
Expand All @@ -1440,7 +1457,6 @@
C94FD2AB2AE8CEEB003777EB /* Button.swift in Sources */,
C91CE9262B1B0DDC00048FF7 /* MockURLProtocol.swift in Sources */,
C95DD3762B8710B1005ACE84 /* MyPoseViewModel.swift in Sources */,
C903E5442AFCC62600BD004F /* RecommendedContents.swift in Sources */,
C94FD2922AE398D6003777EB /* MyPageViewModel.swift in Sources */,
C94FD2792AE38EBD003777EB /* RootCoordinator.swift in Sources */,
880E753E2AE6BE59007FAD5A /* Service.swift in Sources */,
Expand Down
14 changes: 14 additions & 0 deletions posepicker/Domain/Entities/Pose/FilteredPose.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// FilteredPose.swift
// posepicker
//
// Created by 박경준 on 2023/11/09.
//

import Foundation

public struct FilteredPose: Codable {
let filteredContents: PoseFeed?
let recommendation: Bool
let recommendedContents: PoseFeed?
}
File renamed without changes.
35 changes: 35 additions & 0 deletions posepicker/Domain/Entities/Pose/PoseFeed.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// PoseFeed.swift
// posepicker
//
// Created by Jun on 2023/11/05.
//

import Foundation

public struct PoseFeed: Codable {
let content: [Pose]
let empty: Bool
let first: Bool
let last: Bool
let number: Int
let numberOfElements: Int
let size: Int
let pageable: Page
let sort: Sort
}

//struct Page: Codable {
// let offset: Int
// let pageNumber: Int
// let pageSize: Int
// let paged: Bool
// let sort: Sort
// let unpaged: Bool
//}
//
//struct Sort: Codable {
// let empty: Bool
// let sorted: Bool
// let unsorted: Bool
//}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import Foundation
import Alamofire

struct PosePick: Codable {
let poseInfo: Pose
public struct Pose: Codable {
let poseInfo: PoseInfo
}

struct Pose: Codable {
public struct PoseInfo: Codable {
let createdAt: String?
let frameCount: Int
let imageKey: String
Expand All @@ -24,7 +24,7 @@ struct Pose: Codable {
let updatedAt: String?
let bookmarkCheck: Bool?

enum CodingKeys: String, CodingKey {
public enum CodingKeys: String, CodingKey {
case createdAt
case frameCount
case imageKey
Expand All @@ -50,7 +50,7 @@ struct Pose: Codable {
self.bookmarkCheck = bookmarkCheck
}

init(from decoder: Decoder) throws {
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.createdAt = try container.decodeIfPresent(String.self, forKey: .createdAt)
self.frameCount = try container.decode(Int.self, forKey: .frameCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import Foundation

struct PoseTalk: Codable {
public struct PoseTalk: Codable {
let poseWord: PoseWord
}

struct PoseWord: Codable {
public struct PoseWord: Codable {
let content: String
let createdAt: String
let updatedAt: String
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions posepicker/Domain/UseCases/PoseUseCases.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// PoseUseCases.swift
// posepicker
//
// Created by 박경준 on 3/18/24.
//

import Foundation
26 changes: 0 additions & 26 deletions posepicker/Models/Pose/FilteredPose.swift

This file was deleted.

20 changes: 0 additions & 20 deletions posepicker/Models/Pose/PoseFeed.swift

This file was deleted.

20 changes: 0 additions & 20 deletions posepicker/Models/Pose/RecommendedContents.swift

This file was deleted.

0 comments on commit 77f50f3

Please sign in to comment.