mirror of
https://github.com/astaxie/beego.git
synced 2025-07-03 16:20:19 +00:00
orm full remove orm.Manager for simple use, add struct tag -
for skip struct field
This commit is contained in:
@ -7,8 +7,11 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func getTableName(model Modeler) string {
|
||||
val := reflect.ValueOf(model)
|
||||
func getFullName(typ reflect.Type) string {
|
||||
return typ.PkgPath() + "." + typ.Name()
|
||||
}
|
||||
|
||||
func getTableName(val reflect.Value) string {
|
||||
ind := reflect.Indirect(val)
|
||||
fun := val.MethodByName("TableName")
|
||||
if fun.IsValid() {
|
||||
@ -23,11 +26,6 @@ func getTableName(model Modeler) string {
|
||||
return snakeString(ind.Type().Name())
|
||||
}
|
||||
|
||||
func getPkgPath(model Modeler) string {
|
||||
val := reflect.ValueOf(model)
|
||||
return val.Type().Elem().PkgPath()
|
||||
}
|
||||
|
||||
func getColumnName(ft int, addrField reflect.Value, sf reflect.StructField, col string) string {
|
||||
column := strings.ToLower(col)
|
||||
if column == "" {
|
||||
|
Reference in New Issue
Block a user