info get profile

This commit is contained in:
eson
2023-09-26 17:16:10 +08:00
parent 4dfeebeaed
commit f387e46977
10 changed files with 159 additions and 29 deletions

View File

@@ -191,3 +191,12 @@ func MetadataOrderPATCH(tx *gorm.DB, sql string, orderSn string, tableStructPoin
return nil
}
func GetGormTableName(tx *gorm.DB, tableStructPointer any) string {
stype := reflect.TypeOf(tableStructPointer)
if stype.Kind() == reflect.Pointer {
stype = stype.Elem()
}
tname := tx.NamingStrategy.TableName(stype.Name())
return tname
}