multi-tenant

This commit is contained in:
2024-06-19 11:15:39 +08:00
parent b9c9734b16
commit 7a785182b7
9 changed files with 247 additions and 55 deletions

View File

@@ -1286,9 +1286,9 @@ func XormGetColStringArrayByWhere(table, coln, where string, colv *[]string) err
func XormFindColStringArrayByWhere(table, col, where string, cols *[]string) error {
log.Debug("XormFindColStringArrayByWhere processing... ")
err := xEngine.Table(table).Where(where).Cols(col).Distinct().Find(cols)
err := xEngine.Table(table).Where(where).Cols(col).Find(cols)
if err != nil {
log.Errorf("Failed to Find %s from table %s:%v", col, table, err)
log.Errorf("Failed to find %s from table %s: %v", col, table, err)
return err
}
return nil
@@ -1300,7 +1300,7 @@ func XormGetSingleColStringByWhere(table, col, where string) (string, error) {
var colv string
_, err := xEngine.Table(table).Where(where).Cols(col).Get(&colv)
if err != nil {
log.Errorf("Failed to Find %s from table %s:%v", col, table, err)
log.Errorf("Failed to find %s from table %s: %v", col, table, err)
return colv, err
}
return colv, nil

View File

@@ -726,3 +726,12 @@ func RecurseStructToMap(obj any) map[string]any {
}
return out
}
func IsMember(target string, group []string) bool {
for _, str := range group {
if target == str {
return true
}
}
return false
}

View File

@@ -269,7 +269,7 @@ func init() {
Register("GET", ue.UriUENum, ue.GetUENumFromNF, nil)
Register("GET", ue.CustomUriUENum, ue.GetUENumFromNF, nil)
// NBInfo
// AMF NBInfo
Register("GET", ue.UriNBInfo, ue.GetNBInfoFromNF, nil)
Register("GET", ue.CustomUriNBInfo, ue.GetNBInfoFromNF, nil)