Filter keywords

过滤关键字
This commit is contained in:
谢小军
2020-05-11 15:16:24 +08:00
parent 89ef2282a9
commit a3901e56d2
5 changed files with 47 additions and 46 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/xxjwxc/gormt/data/view/cnf"
"github.com/xxjwxc/gormt/data/view/genfunc"
"github.com/xxjwxc/public/mybigcamel"
"github.com/xxjwxc/public/tools"
)
// getCamelName Big Hump or Capital Letter.大驼峰或者首字母大写
@@ -41,7 +42,16 @@ func CapLowercase(name string) string { // IDAPIID == > idAPIID
return ""
}
return list[0] + name[len(list[0]):]
re := list[0] + name[len(list[0]):]
return FilterKeywords(re)
}
func FilterKeywords(src string) string {
if tools.IsKeywords(src) {
return "_" + src
}
return src
}
// getTypeName Type acquisition filtering.类型获取过滤