zky_mandate/resource/template/vm/go/model_do.template
2023-01-20 10:53:34 +08:00

28 lines
1.2 KiB
Plaintext

// ==========================================================================
// GFast自动生成model entity操作代码。
// 生成日期:{{date "Y-m-d H:i:s"}}
// 生成路径: {{.table.PackageName}}/model/entity/{{.table.TableName}}.go
// 生成人:{{.table.FunctionAuthor}}
// desc:{{.table.FunctionName}}
// company:云南奇讯科技有限公司
// ==========================================================================
////
package do
////
import (
{{if .table.HasTimeColumn}}
"github.com/gogf/gf/v2/os/gtime"
{{end}}
"github.com/gogf/gf/v2/util/gmeta"
)
////
// {{.table.ClassName}} is the golang structure for table {{.table.TableName}}.
type {{.table.ClassName}} struct {
gmeta.Meta `orm:"table:{{.table.TableName}}, do:true"`
{{range $index, $column := .table.Columns}}
{{if $column.IsPk}}{{$column.GoField}} {{if eq $column.GoType "Time"}}*gtime.Time{{else}}interface{}{{end}} `orm:"{{$column.ColumnName}},primary" json:"{{$column.HtmlField}}"` // {{$column.ColumnComment}} {{else}}{{$column.GoField}} {{if eq $column.GoType "Time"}}*gtime.Time{{else}}interface{}{{end}} `orm:"{{$column.ColumnName}}" json:"{{$column.HtmlField}}"` // {{$column.ColumnComment}} {{end}}
{{end}}
}