forked from 1340691923/ElasticView
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.go
More file actions
105 lines (93 loc) · 2.63 KB
/
Copy pathModel.go
File metadata and controls
105 lines (93 loc) · 2.63 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
package request
import (
"errors"
jsoniter "github.com/json-iterator/go"
)
// GmRoleModel
type GmRoleModel struct {
ID int `json:"id" db:"id"`
RoleName string `json:"name" db:"role_name"`
Description string `json:"description" db:"description"`
RoleList string `json:"routes" db:"role_list"`
Api []string `json:"api"`
}
type TimingModel struct {
Page int `json:"page"`
Limit int `json:"limit"`
Status *int `json:"status"`
Action *int `json:"action"`
}
type DataxInfoListReq struct {
Remark string `json:"remark"`
Typ string `json:"typ"`
Page int `json:"page"`
Limit int `json:"limit"`
}
type DataxInfoInsertReq struct {
IP string `json:"ip"`
Port int `json:"port"`
DbName string `json:"db_name"`
Username string `json:"username"`
Pwd string `json:"pwd"`
Remark string `json:"remark"`
Typ string `json:"typ"`
}
type DataxInfoDelReq struct {
ID int `json:"id"`
}
type DataxInfoTestLinkReq struct {
IP string `json:"ip"`
Port int `json:"port"`
DbName string `json:"db_name"`
Username string `json:"username"`
Pwd string `json:"pwd"`
Remark string `json:"remark"`
Typ string `json:"typ"`
}
func (this DataxInfoInsertReq) Validate() (err error) {
if this.IP == "" {
err = errors.New("ip 不能为空")
}
return
}
type TransferReq struct {
AutoIncrementId string `json:"autoIncrementId"`
EsConnect int `json:"es_connect"`
SelectType string `json:"selectType"`
Remark string `json:"remark"`
SelectTable string `json:"selectTable"`
TypeName string `json:"type_name"`
Cols struct {
TableCols []string `json:"tableCols"`
EsCols []struct {
Col string `json:"col"`
TbCol string `json:"tbCol"`
} `json:"esCols"`
} `json:"cols"`
IndexName string `json:"indexName"`
Reset bool `json:"reset"`
GoNum int `json:"goNum"`
EsFlushInterval int `json:"esFlushInterval"`
EsBufferSize int `json:"esBufferSize"`
BufferSize int `json:"bufferSize"`
MaxIdleConns int `json:"maxIdleConns"`
MaxOpenConns int `json:"maxOpenConns"`
CrontabSpec string `json:"crontab_spec"`
}
type SelectType struct {
ID int `json:"id"`
Remark string `json:"remark"`
Typ string `json:"typ"`
}
type TransferLogReq struct {
EsConnect int `json:"es_connect"`
}
func (this *TransferReq) ParseSelectType() (*SelectType, error) {
selectType := new(SelectType)
var json = jsoniter.ConfigCompatibleWithStandardLibrary
err := json.Unmarshal([]byte(this.SelectType), selectType)
if err != nil {
return nil, err
}
return selectType, nil
}