diff --git a/platform/api/app.dolphin.go b/platform/api/app.dolphin.go index 1b10ec8f..4c4e9e4a 100644 --- a/platform/api/app.dolphin.go +++ b/platform/api/app.dolphin.go @@ -188,7 +188,7 @@ func (dol *Dolphin) Reflesh() error { dol.Manager.AddBusinessDB(domain.Domain.String, db) } - platBindModelNames := dol.Manager.ModelSet().ByNotName(Name) + platBindModelNames := dol.Manager.ModelSet().NameSpaces(Name) filtedDomains := funk.Filter(domains, func(domain types.SysDomain) bool { return domain.IsSync.Int64 != 1 }).([]types.SysDomain) for i := range filtedDomains { asyncOnce.Do(func() { diff --git a/platform/api/app.model.go b/platform/api/app.model.go index cc70eb7c..e3764d91 100644 --- a/platform/api/app.model.go +++ b/platform/api/app.model.go @@ -7,6 +7,7 @@ package api import ( "sync" + "github.com/2637309949/dolphin/platform/util/slice" "github.com/spf13/viper" ) @@ -20,6 +21,7 @@ type ModelSetter interface { Add(Table, ...string) ByName(string) []Table ByNotName(string) []Table + NameSpaces(...string) (names []string) Release() } @@ -29,6 +31,17 @@ type defaultModelSetter struct { m map[string][]Table } +// Add defined add models +func (s *defaultModelSetter) NameSpaces(n ...string) (names []string) { + for k := range s.m { + if slice.StrSliceContains(n, k) { + continue + } + names = append(names, k) + } + return +} + // Add defined add models func (s *defaultModelSetter) Add(m Table, n ...string) { s.lock.Lock() diff --git a/platform/x_test.db b/platform/x_test.db index 2a2b802d..4706a46f 100644 Binary files a/platform/x_test.db and b/platform/x_test.db differ diff --git a/platform/x_test_localhost.db b/platform/x_test_localhost.db index 669fed8b..67c1ebe6 100644 Binary files a/platform/x_test_localhost.db and b/platform/x_test_localhost.db differ