|
|
@@ -12,9 +12,6 @@ import (
|
|
|
|
|
|
// Object 领域对象接口
|
|
|
type Object interface {
|
|
|
- // DBSchema 返回针对领域的数据库的schema,一般不需要赋值,除非该领域对象与其他领域对象不在同一个schema
|
|
|
- DBSchema() string
|
|
|
-
|
|
|
// DomainCNName 返回领域的中文名称
|
|
|
DomainCNName() string
|
|
|
|
|
|
@@ -154,10 +151,6 @@ func ToConcrete[T Object](object Object) (T, error) {
|
|
|
// 返回值:
|
|
|
// - 表名
|
|
|
func TableName(schema string, object Object) string {
|
|
|
- if strutils.IsStringNotEmpty(object.DBSchema()) {
|
|
|
- schema = object.DBSchema()
|
|
|
- }
|
|
|
-
|
|
|
if strutils.IsStringEmpty(schema) {
|
|
|
return template.Plural(strcase.ToSnake(template.Id(object.DomainCamelName())))
|
|
|
} else {
|
|
|
@@ -173,10 +166,6 @@ func TableName(schema string, object Object) string {
|
|
|
// 返回值:
|
|
|
// - 关联表名
|
|
|
func RelationTableName(schema string, left Object, right Object) string {
|
|
|
- if strutils.IsStringNotEmpty(left.DBSchema()) && left.DBSchema() == right.DBSchema() {
|
|
|
- schema = left.DBSchema()
|
|
|
- }
|
|
|
-
|
|
|
if strutils.IsStringEmpty(schema) {
|
|
|
return strcase.ToSnake(template.Id(left.DomainCamelName())) + "_and_" + strcase.ToSnake(template.Id(right.DomainCamelName()))
|
|
|
} else {
|