Documentation ¶
Index ¶
Constants ¶
View Source
const ApiTemplate = `` /* 5288-byte string literal not displayed */
View Source
const EntityTemplate = `
package {{.packageName}}
import (
"time"
"gitee.com/chunanyong/zorm"
)
// {{.structName}}TableName 表名常量,方便直接调用
const {{.structName}}TableName = "{{.tableName}}"
// {{.structName}} {{.tableComment}}
type {{.structName}} struct {
zorm.EntityStruct
{{range $i, $v := .columns}}
// {{$v.field}} {{$v.COLUMN_COMMENT}}
{{$v.field}} {{$v.DATA_TYPE}} ` + "`" + `column:"{{$v.COLUMN_NAME}}"` + "`" + `
{{end}}
// * 数据库字段结束,以下是自定义字段 *
}
// GetTableName 获取表名称
func (entity *{{.structName}}) GetTableName() string {
return {{.structName}}TableName
}
// GetPKColumnName 获取数据库表的主键字段名称
func (entity *{{.structName}}) GetPKColumnName() string {
return "{{.pkName}}"
}
`
View Source
const LogicTemplate = `` /* 11990-byte string literal not displayed */
View Source
const ModelTemplate = `
package {{.modelPackageName}}
import (
"time"
"{{.coreName}}/types"
)
// {{.camelName}}Model {{.tableComment}}
type {{.camelName}}Model struct {
types.ReqPageModel
{{range $i, $v := .fields}}
// {{$v.field}} {{$v.COLUMN_COMMENT}}
{{$v.field}} {{$v.DATA_TYPE}} ` + "`" + `json:"{{$v.json}}"` + "`" + `
{{end}}
}
`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.