mirror of
https://github.com/beego/bee.git
synced 2025-07-05 18:20:18 +00:00
support migrate generate sql
This commit is contained in:
24
g_model.go
24
g_model.go
@ -71,30 +71,6 @@ func getStruct(structname, fields string) (string, error) {
|
||||
return structStr, nil
|
||||
}
|
||||
|
||||
func camelString(s string) string {
|
||||
data := make([]byte, 0, len(s))
|
||||
j := false
|
||||
k := false
|
||||
num := len(s) - 1
|
||||
for i := 0; i <= num; i++ {
|
||||
d := s[i]
|
||||
if k == false && d >= 'A' && d <= 'Z' {
|
||||
k = true
|
||||
}
|
||||
if d >= 'a' && d <= 'z' && (j || k == false) {
|
||||
d = d - 32
|
||||
j = false
|
||||
k = true
|
||||
}
|
||||
if k && d == '_' && num > i && s[i+1] >= 'a' && s[i+1] <= 'z' {
|
||||
j = true
|
||||
continue
|
||||
}
|
||||
data = append(data, d)
|
||||
}
|
||||
return string(data[:len(data)])
|
||||
}
|
||||
|
||||
// fields support type
|
||||
// http://beego.me/docs/mvc/model/models.md#mysql
|
||||
func getType(ktype string) (kt, tag string) {
|
||||
|
Reference in New Issue
Block a user