Skip to content

Commit

Permalink
Merge pull request #194 from DeveloperAcademy-POSTECH/main
Browse files Browse the repository at this point in the history
[Release] Reazy 1.0.0 배포
  • Loading branch information
mooninbeom authored Nov 13, 2024
2 parents e874f8d + c3b5230 commit 2955fce
Show file tree
Hide file tree
Showing 132 changed files with 9,425 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,13 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output


.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store

timeline.xctimeline
playground.xcworkspace
*.xcconfig
30 changes: 30 additions & 0 deletions NetworkUnitTest/NetworkUnitTest.swift
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 Project/Preview Content/Preview Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
82 changes: 82 additions & 0 deletions Project/Reazy/App/AppView.swift
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 Project/Reazy/Data/DTO/ButtonGroupData+CoreDataClass.swift
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 Project/Reazy/Data/DTO/ButtonGroupData+CoreDataProperties.swift
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?
}
14 changes: 14 additions & 0 deletions Project/Reazy/Data/DTO/CommentData+CoreDataClass.swift
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 Project/Reazy/Data/DTO/CommentData+CoreDataProperties.swift
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?
}
14 changes: 14 additions & 0 deletions Project/Reazy/Data/DTO/FigureData+CoreDataClass.swift
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 Project/Reazy/Data/DTO/FigureData+CoreDataProperties.swift
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?
}
14 changes: 14 additions & 0 deletions Project/Reazy/Data/DTO/PaperData+CoreDataClass.swift
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 {

}
28 changes: 28 additions & 0 deletions Project/Reazy/Data/DTO/PaperData+CoreDataProperties.swift
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 Project/Reazy/Data/DTO/SelectionByLine+CoreDataClass.swift
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 Project/Reazy/Data/DTO/SelectionByLine+CoreDataProperties.swift
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?
}
29 changes: 29 additions & 0 deletions Project/Reazy/Data/PersistantContainer.swift
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)")
}
}
}
}
Loading

0 comments on commit 2955fce

Please sign in to comment.