mirror of
https://github.com/zhufuyi/sponge.git
synced 2025-10-06 01:07:08 +08:00
docs: update api document
This commit is contained in:
@@ -47,7 +47,7 @@ func setCrudInfo(field tmplField) *CrudInfo {
|
||||
}
|
||||
pluralName := inflection.Plural(field.Name)
|
||||
|
||||
return &CrudInfo{
|
||||
info := &CrudInfo{
|
||||
ColumnName: field.ColName,
|
||||
ColumnNameCamel: field.Name,
|
||||
ColumnNameCamelFCL: customFirstLetterToLower(field.Name),
|
||||
@@ -60,6 +60,15 @@ func setCrudInfo(field tmplField) *CrudInfo {
|
||||
PrimaryKeyColumnName: primaryKeyName,
|
||||
IsStandardPrimaryKey: field.ColName == "id",
|
||||
}
|
||||
|
||||
if info.ColumnNameCamel == info.ColumnNamePluralCamel {
|
||||
info.ColumnNamePluralCamel += "s" // if singular and plural are the same, force the suffix 's' to distinguish them
|
||||
}
|
||||
if info.ColumnNameCamelFCL == info.ColumnNamePluralCamelFCL {
|
||||
info.ColumnNamePluralCamelFCL += "s" // if singular and plural are the same, force the suffix 's' to distinguish them
|
||||
}
|
||||
|
||||
return info
|
||||
}
|
||||
|
||||
func newCrudInfo(data tmplData) *CrudInfo {
|
||||
|
Reference in New Issue
Block a user