Skip to content

Commit

Permalink
feat: CoreData의 Playlist Entity 추가 (boostcampwm-2024#39)
Browse files Browse the repository at this point in the history
- MusicKit에 Playlist라는 클래스가 이미 존재하여 MolioPlaylist로 이름을 설정했다.
  • Loading branch information
Park-kxng committed Nov 14, 2024
1 parent 53ac7ba commit 50b78c9
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 10 deletions.
26 changes: 17 additions & 9 deletions Molio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
2003BA222CDCB31B002CAB3E /* SwipeMusicViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2003BA212CDCB31B002CAB3E /* SwipeMusicViewModel.swift */; };
20397E512CE33C03004ED9CE /* SwipeMusicPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20397E502CE33C03004ED9CE /* SwipeMusicPlayer.swift */; };
20397E5A2CE5CB3C004ED9CE /* PlaylistRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20397E592CE5CB3C004ED9CE /* PlaylistRepository.swift */; };
20397E5F2CE5CD85004ED9CE /* Playlist.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 20397E5D2CE5CD85004ED9CE /* Playlist.xcdatamodeld */; };
20397E6A2CE5DCDD004ED9CE /* MolioModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 20397E682CE5DCDD004ED9CE /* MolioModel.xcdatamodeld */; };
20397E6D2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20397E6B2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataClass.swift */; };
20397E6E2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20397E6C2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataProperties.swift */; };
881622692CE3671400E81EA0 /* RandomMusicDeck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881622682CE3671400E81EA0 /* RandomMusicDeck.swift */; };
8816226B2CE3838B00E81EA0 /* DeckTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8816226A2CE3838B00E81EA0 /* DeckTests.swift */; };
8816226D2CE3B11C00E81EA0 /* MusicDeck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8816226C2CE3B11C00E81EA0 /* MusicDeck.swift */; };
Expand Down Expand Up @@ -119,7 +121,9 @@
2003BA212CDCB31B002CAB3E /* SwipeMusicViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipeMusicViewModel.swift; sourceTree = "<group>"; };
20397E502CE33C03004ED9CE /* SwipeMusicPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipeMusicPlayer.swift; sourceTree = "<group>"; };
20397E592CE5CB3C004ED9CE /* PlaylistRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaylistRepository.swift; sourceTree = "<group>"; };
20397E5E2CE5CD85004ED9CE /* Playlist.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Playlist.xcdatamodel; sourceTree = "<group>"; };
20397E692CE5DCDD004ED9CE /* MolioModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MolioModel.xcdatamodel; sourceTree = "<group>"; };
20397E6B2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MolioPlaylist+CoreDataClass.swift"; sourceTree = "<group>"; };
20397E6C2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MolioPlaylist+CoreDataProperties.swift"; sourceTree = "<group>"; };
881622682CE3671400E81EA0 /* RandomMusicDeck.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomMusicDeck.swift; sourceTree = "<group>"; };
8816226A2CE3838B00E81EA0 /* DeckTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeckTests.swift; sourceTree = "<group>"; };
8816226C2CE3B11C00E81EA0 /* MusicDeck.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicDeck.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -265,7 +269,9 @@
20397E5C2CE5CD61004ED9CE /* DataModel */ = {
isa = PBXGroup;
children = (
20397E5D2CE5CD85004ED9CE /* Playlist.xcdatamodeld */,
20397E6B2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataClass.swift */,
20397E6C2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataProperties.swift */,
20397E682CE5DCDD004ED9CE /* MolioModel.xcdatamodeld */,
);
path = DataModel;
sourceTree = "<group>";
Expand Down Expand Up @@ -856,6 +862,8 @@
F17369572CDFB03E00F6242C /* DefaultMusicKitService.swift in Sources */,
2003BA222CDCB31B002CAB3E /* SwipeMusicViewModel.swift in Sources */,
F173694B2CDF265900F6242C /* DefaultMusicRepository.swift in Sources */,
20397E6D2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataClass.swift in Sources */,
20397E6E2CE5DD6A004ED9CE /* MolioPlaylist+CoreDataProperties.swift in Sources */,
F173693D2CDF191800F6242C /* RandomMusic.swift in Sources */,
F173691F2CDB995100F6242C /* SwipeMusicViewController.swift in Sources */,
2003BA1C2CDB8EE5002CAB3E /* UILabel+Extension.swift in Sources */,
Expand All @@ -875,6 +883,7 @@
B8D553EA2CDFE271007CCD6D /* EndPoint.swift in Sources */,
B809709E2CDB640B007BC3C4 /* MusicKitService.swift in Sources */,
F17369642CE36DE300F6242C /* DefaultFetchImageUseCase.swift in Sources */,
20397E6A2CE5DCDD004ED9CE /* MolioModel.xcdatamodeld in Sources */,
F17369722CE3716100F6242C /* DafaultImageProvider.swift in Sources */,
2003BA012CDB7498002CAB3E /* PretendardFontName.swift in Sources */,
B8D553E82CDFE25C007CCD6D /* NetworkProvider.swift in Sources */,
Expand Down Expand Up @@ -906,7 +915,6 @@
F17368FB2CD86B1100F6242C /* SceneDelegate.swift in Sources */,
F17369232CDC5E5F00F6242C /* MusicTagView.swift in Sources */,
881BBCAA2CDCF90700010A61 /* MockSpotifyRepository.swift in Sources */,
20397E5F2CE5CD85004ED9CE /* Playlist.xcdatamodeld in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1227,14 +1235,14 @@
/* End XCSwiftPackageProductDependency section */

/* Begin XCVersionGroup section */
20397E5D2CE5CD85004ED9CE /* Playlist.xcdatamodeld */ = {
20397E682CE5DCDD004ED9CE /* MolioModel.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
20397E5E2CE5CD85004ED9CE /* Playlist.xcdatamodel */,
20397E692CE5DCDD004ED9CE /* MolioModel.xcdatamodel */,
);
currentVersion = 20397E5E2CE5CD85004ED9CE /* Playlist.xcdatamodel */;
name = Playlist.xcdatamodeld;
path = "/Users/p_kxn_g/Documents/GitHub/naverboostcamp_challenge/membership/membership/iOS06-molio/Molio/Source/Data/Model/DataModel/Playlist.xcdatamodeld";
currentVersion = 20397E692CE5DCDD004ED9CE /* MolioModel.xcdatamodel */;
name = MolioModel.xcdatamodeld;
path = "/Users/p_kxn_g/Documents/GitHub/naverboostcamp_challenge/membership/membership/iOS06-molio/Molio/Source/Data/Model/DataModel/MolioModel.xcdatamodeld";
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22758" systemVersion="23C71" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithSwiftData="YES" userDefinedModelVersionIdentifier="">
<entity name="Playlist" representedClassName="Playlist" syncable="YES" codeGenerationType="class">
<entity name="MolioPlaylist" representedClassName="MolioPlaylist" syncable="YES" codeGenerationType="class">
<attribute name="createdAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="filters" optional="YES" attributeType="Transformable"/>
<attribute name="id" optional="YES" attributeType="UUID" usesScalarValueType="NO"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Foundation
import CoreData

@objc(MolioPlaylist)
public class MolioPlaylist: NSManagedObject {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Foundation
import CoreData


extension MolioPlaylist {

@nonobjc public class func fetchRequest() -> NSFetchRequest<MolioPlaylist> {
return NSFetchRequest<MolioPlaylist>(entityName: "MolioPlaylist")
}

@NSManaged public var id: UUID?
@NSManaged public var name: String?
@NSManaged public var filters: NSObject?
@NSManaged public var createdAt: Date?
@NSManaged public var musics: NSObject?

}

extension MolioPlaylist : Identifiable {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22758" systemVersion="23C71" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithSwiftData="YES" userDefinedModelVersionIdentifier="">
<entity name="MolioPlaylist" representedClassName="MolioPlaylist" syncable="YES" codeGenerationType="class">
<attribute name="createdAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="filters" optional="YES" attributeType="Transformable"/>
<attribute name="id" optional="YES" attributeType="UUID" usesScalarValueType="NO"/>
<attribute name="musics" optional="YES" attributeType="Transformable"/>
<attribute name="name" optional="YES" attributeType="String"/>
</entity>
</model>

0 comments on commit 50b78c9

Please sign in to comment.