domain_service.go
3.2 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package domain
type FileTableService interface {
Preview(ctx *Context, fileId int, fields []*Field, where Where) (interface{}, error)
Edit()
Flush(ctx *Context, fileId int, table *Table) (interface{}, error)
DeleteFiles(ctx *Context, files ...*File) error
GenerateTable(ctx *Context, fileId int, tableName string) (interface{}, error)
}
type TableService interface {
Preview(ctx *Context, tableId int, where Where) (interface{}, error)
CopyTable(ctx *Context, tableId int, tableName string) (interface{}, error)
DeleteTables(ctx *Context, tables ...*Table) error
AppendData(ctx *Context, fileId int, tableId int, mappingFields []*MappingField) (interface{}, error)
UpdateTableStruct(ctx *Context, tableId int, fields []*Field, name string) (interface{}, error)
AddTableStruct(ctx *Context, parentTableId int, fields []*Field, name string) (interface{}, error)
}
type PreviewDataTableService interface {
Preview(ctx *Context, fileId int, fields []*Field, where Where) (interface{}, error)
RePreview(ctx *Context, fileId int, fields []*Field, where Where) (interface{}, error)
CreateTemporaryFile(ctx *Context, fileId int) (*File, error)
GetFileId() int
}
type EditDataTableService interface {
Edit(ctx *Context, param EditTableRequest) (*DataEditDataTable, error)
}
type FlushDataTableService interface {
Flush(ctx *Context, fileId int, table *Table) (interface{}, error)
}
type DeleteFileService interface {
DeleteFiles(ctx *Context, files ...*File) error
}
type GenerateMainTableService interface {
GenerateTable(ctx *Context, fileId int, tableName string) (interface{}, error)
}
type CopyDataTableService interface {
CopyTable(ctx *Context, tableId int, tableName string) (interface{}, error)
}
type DeleteDataTableService interface {
DeleteTable(ctx *Context, tableId int) (interface{}, error)
DeleteTables(ctx *Context, tables ...*Table) error
}
type AppendDataToTableService interface {
AppendData(ctx *Context, fileId int, tableId int, mappingFields []*MappingField) (interface{}, error)
PreflightCheck(ctx *Context, fileId int, tableId int, mappingFields []*MappingField) (interface{}, error)
}
/************************************/
type UpdateTableStructService interface {
UpdateTableStruct(ctx *Context, tableId int, fields []*Field, name string) (interface{}, error)
}
type AddTableStructService interface {
AddTableStruct(ctx *Context, parentTableId int, fields []*Field, name string) (*Table, error)
}
type EditTableRequest struct {
FileId int `json:"objectId"`
Fields []*Field `json:"fields"`
ProcessFieldNames []string `json:"processFields"`
ProcessFields []*Field `json:"-" `
Where Where `json:"where"`
Action string `json:"action"`
Params map[string]interface{} `json:"params"`
}
type TableEditDataService interface {
RowEdit(ctx *Context, request EditDataRequest) (interface{}, error)
}
type EditDataRequest struct {
TableId int `json:"tableId"`
Table *Table
UpdateList []*FieldValues `json:"updateList"`
RemoveList []*FieldValues `json:"removeList"`
AddList []*FieldValues `json:"addList"`
Where Where `json:"where"`
}