-
Notifications
You must be signed in to change notification settings - Fork 2
/
sysDictType.go
60 lines (54 loc) · 1.78 KB
/
sysDictType.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
package systemModels
import "github.com/bzdanny/BaiZe/baize/baizeEntity"
type SysDictTypeVo struct {
DictId int64 `json:"dictId,string" db:"dict_id"`
DictName string `json:"dictName" db:"dict_name"`
DictType string `json:"dictType" db:"dict_type"`
Status string `json:"status" db:"status"`
Remark *string `json:"remark" db:"remark"`
baizeEntity.BaseEntity
}
type SysDictTypeDQL struct {
DictName string `form:"dictName" db:"dict_name"`
Status string `form:"status" db:"status"`
DictType string `form:"dictType" db:"dict_type"`
BeginTime string `form:"beginTime" db:"begin_time"`
EndTime string `form:"endTime" db:"end_time"`
baizeEntity.BaseEntityDQL
}
type SysDictTypeAdd struct {
DictId int64 `json:"dictId,string" db:"dict_id"`
DictName string `json:"dictName" db:"dict_name"`
DictType string `json:"dictType" db:"dict_type"`
Status string `json:"status" db:"status"`
Remark string `json:"remark" db:"remark"`
baizeEntity.BaseEntityAdd
}
type SysDictTypeEdit struct {
DictId int64 `json:"dictId,string" db:"dict_id"`
DictName string `json:"dictName" db:"dict_name"`
DictType string `json:"dictType" db:"dict_type"`
Status string `json:"status" db:"status"`
Remark string `json:"remark" db:"remark"`
baizeEntity.BaseEntityEdit
}
func SysDictTypeListToRows(dictTypes []*SysDictTypeVo) (rows [][]string) {
rows = make([][]string, 0, len(dictTypes)+1)
row1 := []string{"字典名称", "字典类型", "状态", "备注"}
rows = append(rows, row1)
for _, dictType := range dictTypes {
row := make([]string, 4)
row[0] = dictType.DictName
row[1] = dictType.DictType
if dictType.Status == "0" {
row[2] = "正常"
} else {
row[2] = "停用"
}
if dictType.Remark != nil {
row[3] = *dictType.Remark
}
rows = append(rows, row)
}
return
}