forked from GoAdminGroup/go-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
authors.go
152 lines (144 loc) · 3.12 KB
/
authors.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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
package datamodel
import (
"github.com/chenhg5/go-admin/plugins/admin/models"
"github.com/chenhg5/go-admin/template/types"
)
func GetAuthorsTable() (authorsTable models.Table) {
authorsTable.Info.FieldList = []types.FieldStruct{
{
Head: "ID",
Field: "id",
TypeName: "int",
Sortable: true,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "First Name",
Field: "first_name",
TypeName: "varchar",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "Last Name",
Field: "last_name",
TypeName: "varchar",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "Email",
Field: "email",
TypeName: "varchar",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "Birthdate",
Field: "birthdate",
TypeName: "date",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
{
Head: "Added",
Field: "added",
TypeName: "timestamp",
Sortable: false,
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
}
authorsTable.Info.Table = "authors"
authorsTable.Info.Title = "Authors"
authorsTable.Info.Description = "Authors"
authorsTable.Form.FormList = []types.FormStruct{
{
Head: "ID",
Field: "id",
TypeName: "int",
Default: "",
Editable: false,
FormType: "default",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "First Name",
Field: "first_name",
TypeName: "varchar",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Name",
Field: "name",
TypeName: "varchar",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Description",
Field: "description",
TypeName: "varchar",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Email",
Field: "email",
TypeName: "varchar",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Birthdate",
Field: "birthdate",
TypeName: "date",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
}, {
Head: "Added",
Field: "added",
TypeName: "timestamp",
Default: "",
Editable: true,
FormType: "text",
ExcuFun: func(model types.RowModel) interface{} {
return model.Value
},
},
}
authorsTable.Form.Table = "authors"
authorsTable.Form.Title = "Authors"
authorsTable.Form.Description = "Authors"
authorsTable.ConnectionDriver = "mysql"
return
}