-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.go
53 lines (41 loc) · 981 Bytes
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"StructifyCSV/backend/core"
"StructifyCSV/backend/entity"
"StructifyCSV/backend/ui"
"context"
)
type App struct {
ctx context.Context
}
func NewApp() *App {
return &App{}
}
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
func (a *App) ImportJsonSchema() core.ImportSchemaRes {
return core.ImportJsonSchema(a.ctx)
}
func (a *App) ImportCsvFileData() entity.CsvFileData {
return core.ImportCsvFileData(a.ctx)
}
func (a *App) ExportJsonSchema(jsonSchema entity.JsonSchema) {
core.ExportJsonSchema(a.ctx, jsonSchema)
}
func (a *App) ProcessCsvWithSchema(csvFile entity.CsvFileData, jsonSchema entity.JsonSchema) entity.CsvProcessingReport {
report := core.ProcessCsv(a.ctx, csvFile, jsonSchema)
return report
}
func (a *App) MinimizeWindow() {
ui.Minimize(a.ctx)
}
func (a *App) MaximizeWindow() {
ui.Maximize(a.ctx)
}
func (a *App) UnmaximizeWindow() {
ui.Unmaximize(a.ctx)
}
func (a *App) ExitProgram() {
ui.Exit(a.ctx)
}