enums.go
2.8 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package domain
import "fmt"
var (
ErrorNotFound = fmt.Errorf("没有此资源")
)
var (
GenerateMainTable OperationType = "GenerateMainTable" // 主表生成
SpiltMainTable OperationType = "SpiltMainTable" //主表拆分
AppendData OperationType = "AppendData" //数据追加
EditSubTable OperationType = "EditSubTable" //分表编辑
CopyTable OperationType = "CopyTable" //表复制
RowEdit OperationType = "RowEdit" // 编辑记录
DeleteTable OperationType = "DeleteTable" // 表删除
FileUpload OperationType = "FileUpload" // 文件上传
FileVerify OperationType = "FileVerify" // 文件校验
)
var OperationTypeMap = map[string]string{
GenerateMainTable.ToString(): "主表生成",
SpiltMainTable.ToString(): "主表拆分",
AppendData.ToString(): "数据追加",
EditSubTable.ToString(): "分表编辑",
CopyTable.ToString(): "表复制",
RowEdit.ToString(): "编辑记录",
DeleteTable.ToString(): "表删除",
FileUpload.ToString(): "文件上传",
FileVerify.ToString(): "文件校验",
}
var (
VerifiedStepLog LogType = "VerifiedStepLog"
CommonLog LogType = "CommonLog"
)
var (
PKField int = 0 // 主键字段
MainTableField int = 1 // 主表字段
ManualField int = 2 // 手动添加
)
var (
MainTable TableType = "MainTable"
SideTable TableType = "SideTable"
SubTable TableType = "SubTable"
ExcelTable TableType = "ExcelTable"
)
var (
SourceFile FileType = "SourceFile"
VerifiedFile FileType = "VerifiedFile"
TemporaryFile FileType = "TemporaryFile"
)
var ObjectTypeMap = map[string]string{
MainTable.ToString(): "主表",
SideTable.ToString(): "副表",
SubTable.ToString(): "分表",
SourceFile.ToString(): "源文件",
VerifiedFile.ToString(): "校验文件",
}
var (
XLS = ".xls"
XLSX = ".xlsx"
)
var (
String SQLType = "string"
Int SQLType = "int"
Float SQLType = "float"
Date SQLType = "date"
Datetime SQLType = "datetime"
)
var SQLTypeMap = map[string]string{
String.ToString(): "文本",
Int.ToString(): "整数",
Float.ToString(): "小数",
Date.ToString(): "日期",
Datetime.ToString(): "日期时间",
}
type FileType string
func (t FileType) ToString() string {
return string(t)
}
type LogType string
func (t LogType) ToString() string {
return string(t)
}
type TableType string
func (t TableType) ToString() string {
return string(t)
}
type ObjectType TableType
type OperationType string
func (t OperationType) ToString() string {
return string(t)
}
type SQLType string
func (t SQLType) ToString() string {
return string(t)
}
func EnumsDescription(m map[string]string, key string) string {
if v, ok := m[key]; ok {
return v
}
return ""
}