-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from DeveloperAcademy-POSTECH/main
[Release] Reazy 1.0.0 배포
- Loading branch information
Showing
132 changed files
with
9,425 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// NetworkUnitTest.swift | ||
// NetworkUnitTest | ||
// | ||
// Created by 문인범 on 11/4/24. | ||
// | ||
|
||
import Testing | ||
import Foundation | ||
@testable import Reazy | ||
|
||
struct NetworkUnitTest { | ||
|
||
@Test func testNetwork() async throws { | ||
let pdfURL = Bundle.main.url(forResource: "engPD5", withExtension: "pdf")! | ||
let data: PDFInfo = try await NetworkManager.fetchPDFExtraction(process: .processHeaderDocument, pdfURL: pdfURL) | ||
|
||
print(data.names) | ||
|
||
#expect(data.names != nil) | ||
} | ||
|
||
@Test func testNetwork2() async throws { | ||
let pdfURL = Bundle.main.url(forResource: "engPD5", withExtension: "pdf")! | ||
let data: PDFLayout = try await NetworkManager.fetchPDFExtraction(process: .processFulltextDocument, pdfURL: pdfURL) | ||
|
||
#expect(data.div.count > 0) | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
Project/Preview Content/Preview Assets.xcassets/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// | ||
// ReazyApp.swift | ||
// Reazy | ||
// | ||
// Created by 문인범 on 10/14/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
@main | ||
struct AppView: App { | ||
// AppDelegate | ||
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate | ||
|
||
// Navigation 컨트롤 | ||
@StateObject private var navigationCoordinator: NavigationCoordinator = .init() | ||
|
||
@StateObject private var pdfFileManager: PDFFileManager = .init(paperService: .shared) | ||
|
||
var body: some Scene { | ||
WindowGroup { | ||
NavigationStack(path: $navigationCoordinator.path) { | ||
navigationCoordinator.build(.home) | ||
.navigationDestination(for: Screen.self) { screen in | ||
navigationCoordinator.build(screen) | ||
} | ||
.sheet(item: $navigationCoordinator.sheet) { sheet in | ||
navigationCoordinator.build(sheet) | ||
} | ||
.fullScreenCover(item: $navigationCoordinator.fullScreenCover) { fullScreenCover in | ||
navigationCoordinator.build(fullScreenCover) | ||
} | ||
} | ||
.environmentObject(navigationCoordinator) | ||
.environmentObject(pdfFileManager) | ||
.onAppear { | ||
setSample() | ||
} | ||
} | ||
} | ||
} | ||
|
||
class AppDelegate: NSObject, UIApplicationDelegate { | ||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
|
||
// 전체 Tint Color 설정 | ||
UIView.appearance().tintColor = UIColor.primary1 | ||
|
||
return true | ||
} | ||
} | ||
|
||
|
||
extension AppView { | ||
private func setSample() { | ||
let isFirst = UserDefaults.standard.bool(forKey: "sample") | ||
|
||
if isFirst { | ||
return | ||
} | ||
|
||
let url = Bundle.main.url(forResource: "sample", withExtension: "json")! | ||
|
||
let layout = try! JSONDecoder().decode(PDFLayout.self, from: .init(contentsOf: url)) | ||
|
||
let id = pdfFileManager.uploadSampleFile()! | ||
UserDefaults.standard.set(id.uuidString, forKey: "sampleId") | ||
pdfFileManager.updateIsFigureSaved(at: id, isFigureSaved: true) | ||
|
||
layout.fig.forEach { | ||
let _ = FigureDataService.shared.saveFigureData(for: id, with: .init( | ||
id: $0.id, | ||
head: $0.head, | ||
label: $0.label, | ||
figDesc: $0.figDesc, | ||
coords: $0.coords, | ||
graphicCoord: $0.graphicCoord)) | ||
} | ||
|
||
UserDefaults.standard.set(true, forKey: "sample") | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
Project/Reazy/Data/DTO/ButtonGroupData+CoreDataClass.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// ButtonGroupData+CoreDataClass.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
@objc(ButtonGroupData) | ||
public class ButtonGroupData: NSManagedObject { | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
Project/Reazy/Data/DTO/ButtonGroupData+CoreDataProperties.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// ButtonGroupData+CoreDataProperties.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
extension ButtonGroupData { | ||
|
||
@nonobjc public class func fetchRequest() -> NSFetchRequest<ButtonGroupData> { | ||
return NSFetchRequest<ButtonGroupData>(entityName: "ButtonGroupData") | ||
} | ||
|
||
@NSManaged public var id: UUID | ||
@NSManaged public var page: Int32 | ||
@NSManaged public var selectedLine: Data | ||
@NSManaged public var buttonPosition: Data | ||
|
||
@NSManaged public var paperData: PaperData? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// CommentData+CoreDataClass.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
@objc(CommentData) | ||
public class CommentData: NSManagedObject { | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
Project/Reazy/Data/DTO/CommentData+CoreDataProperties.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// CommentData+CoreDataProperties.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
extension CommentData { | ||
|
||
@nonobjc public class func fetchRequest() -> NSFetchRequest<CommentData> { | ||
return NSFetchRequest<CommentData>(entityName: "CommentData") | ||
} | ||
|
||
@NSManaged public var id: UUID | ||
@NSManaged public var buttonID: UUID | ||
@NSManaged public var text: String | ||
@NSManaged public var selectedText: String | ||
@NSManaged public var selectionByLine: Set<SelectionByLine> | ||
@NSManaged public var pages: [Int] | ||
@NSManaged public var bounds: Data | ||
|
||
@NSManaged public var paperData: PaperData? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// FigureData+CoreDataClass.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/10/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
@objc(FigureData) | ||
public class FigureData: NSManagedObject { | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
Project/Reazy/Data/DTO/FigureData+CoreDataProperties.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// FigureData+CoreDataProperties.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/10/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
extension FigureData { | ||
|
||
@nonobjc public class func fetchRequest() -> NSFetchRequest<FigureData> { | ||
return NSFetchRequest<FigureData>(entityName: "FigureData") | ||
} | ||
|
||
@NSManaged public var id: String | ||
@NSManaged public var head: String? | ||
@NSManaged public var label: String? | ||
@NSManaged public var figDesc: String? | ||
@NSManaged public var coords: [String] | ||
@NSManaged public var graphicCoord: [String]? | ||
|
||
@NSManaged public var paperData: PaperData? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// PaperData+CoreDataClass.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/6/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
@objc(PaperData) | ||
public class PaperData: NSManagedObject { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// PaperData+CoreDataProperties.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/6/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
extension PaperData { | ||
|
||
@nonobjc public class func fetchRequest() -> NSFetchRequest<PaperData> { | ||
return NSFetchRequest<PaperData>(entityName: "PaperData") | ||
} | ||
|
||
@NSManaged public var id: UUID | ||
@NSManaged public var title: String | ||
@NSManaged public var thumbnail: Data | ||
@NSManaged public var url: Data | ||
@NSManaged public var lastModifiedDate: Date | ||
@NSManaged public var isFavorite: Bool | ||
@NSManaged public var memo: String? | ||
@NSManaged public var isFigureSaved: Bool | ||
|
||
@NSManaged public var figureData: Set<FigureData>? | ||
@NSManaged public var commentData: Set<CommentData>? | ||
} |
14 changes: 14 additions & 0 deletions
14
Project/Reazy/Data/DTO/SelectionByLine+CoreDataClass.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// SelectionByLine+CoreDataClass.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
@objc(SelectionByLine) | ||
public class SelectionByLine: NSManagedObject { | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
Project/Reazy/Data/DTO/SelectionByLine+CoreDataProperties.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// SelectionByLine+CoreDataProperties.swift | ||
// Reazy | ||
// | ||
// Created by 유지수 on 11/11/24. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
extension SelectionByLine { | ||
|
||
@nonobjc public class func fetchRequest() -> NSFetchRequest<SelectionByLine> { | ||
return NSFetchRequest<SelectionByLine>(entityName: "SelectionByLine") | ||
} | ||
|
||
@NSManaged public var page: Int32 | ||
@NSManaged public var bounds: Data | ||
|
||
@NSManaged public var commentData: CommentData? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// PersistantContainer.swift | ||
// Reazy | ||
// | ||
// Created by 문인범 on 11/10/24. | ||
// | ||
|
||
import CoreData | ||
|
||
|
||
final class PersistantContainer { | ||
static let shared = PersistantContainer() | ||
|
||
public var container: NSPersistentContainer { | ||
self._container | ||
} | ||
|
||
private let _container: NSPersistentContainer | ||
|
||
private init() { | ||
self._container = .init(name: "Reazy") | ||
self._container.loadPersistentStores { | ||
(storeDescription, error) in | ||
if let error = error as NSError? { | ||
fatalError("Unresolved error \(error), \(error.userInfo)") | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.