mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 20:35:16 +00:00
自动生成代码添加枚举类型支持 (#1073)
* fieldDialog.vue feature 增加枚举字段类型支持 * model.go.tpl feature 增加枚举字段类型支持 Co-authored-by: 周海生 <zhouhaisheng@doxue.com>
This commit is contained in:
committed by
GitHub
co-authored by
周海生
parent
86baabc452
commit
250fcf4bd6
@@ -9,7 +9,9 @@ import (
|
||||
// 如果含有time.Time 请自行import time包
|
||||
type {{.StructName}} struct {
|
||||
global.GVA_MODEL {{- range .Fields}}
|
||||
{{- if ne .FieldType "string" }}
|
||||
{{- if eq .FieldType "enum" }}
|
||||
{{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};type:enum({{.DataTypeLong}});comment:{{.Comment}};"`
|
||||
{{- else if ne .FieldType "string" }}
|
||||
{{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"`
|
||||
{{- else }}
|
||||
{{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"`
|
||||
|
||||
Reference in New Issue
Block a user