f-fix spell (#381)

Co-authored-by: chenwenjie <chenwenjie@zzstc.cn>
master
文杰 4 years ago committed by GitHub
parent 7f49bd8a31
commit 3285436f75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,12 +22,12 @@ func genInsert(table Table, withCache bool) (string, string, error) {
expressions := make([]string, 0) expressions := make([]string, 0)
expressionValues := make([]string, 0) expressionValues := make([]string, 0)
for _, filed := range table.Fields { for _, field := range table.Fields {
camel := filed.Name.ToCamel() camel := field.Name.ToCamel()
if camel == "CreateTime" || camel == "UpdateTime" { if camel == "CreateTime" || camel == "UpdateTime" {
continue continue
} }
if filed.IsPrimaryKey && table.PrimaryKey.AutoIncrement { if field.IsPrimaryKey && table.PrimaryKey.AutoIncrement {
continue continue
} }
expressions = append(expressions, "?") expressions = append(expressions, "?")

@ -12,12 +12,12 @@ const (
category = "model" category = "model"
deleteTemplateFile = "delete.tpl" deleteTemplateFile = "delete.tpl"
deleteMethodTemplateFile = "interface-delete.tpl" deleteMethodTemplateFile = "interface-delete.tpl"
fieldTemplateFile = "filed.tpl" fieldTemplateFile = "field.tpl"
findOneTemplateFile = "find-one.tpl" findOneTemplateFile = "find-one.tpl"
findOneMethodTemplateFile = "interface-find-one.tpl" findOneMethodTemplateFile = "interface-find-one.tpl"
findOneByFieldTemplateFile = "find-one-by-field.tpl" findOneByFieldTemplateFile = "find-one-by-field.tpl"
findOneByFieldMethodTemplateFile = "interface-find-one-by-field.tpl" findOneByFieldMethodTemplateFile = "interface-find-one-by-field.tpl"
findOneByFieldExtraMethodTemplateFile = "find-one-by-filed-extra-method.tpl" findOneByFieldExtraMethodTemplateFile = "find-one-by-field-extra-method.tpl"
importsTemplateFile = "import.tpl" importsTemplateFile = "import.tpl"
importsWithNoCacheTemplateFile = "import-no-cache.tpl" importsWithNoCacheTemplateFile = "import-no-cache.tpl"
insertTemplateFile = "insert.tpl" insertTemplateFile = "insert.tpl"

@ -10,12 +10,12 @@ import (
func genUpdate(table Table, withCache bool) (string, string, error) { func genUpdate(table Table, withCache bool) (string, string, error) {
expressionValues := make([]string, 0) expressionValues := make([]string, 0)
for _, filed := range table.Fields { for _, field := range table.Fields {
camel := filed.Name.ToCamel() camel := field.Name.ToCamel()
if camel == "CreateTime" || camel == "UpdateTime" { if camel == "CreateTime" || camel == "UpdateTime" {
continue continue
} }
if filed.IsPrimaryKey { if field.IsPrimaryKey {
continue continue
} }
expressionValues = append(expressionValues, "data."+camel) expressionValues = append(expressionValues, "data."+camel)

Loading…
Cancel
Save