add: multi-tenant
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -40,7 +41,7 @@ var NewUDMSubImpl = &UDMSubImpl{
|
||||
"context_id": "ContextId",
|
||||
"apn_context": "ApnContext",
|
||||
"static_ip": "StaticIp",
|
||||
"tenant_name": "TenantName", // Tenant ID for multi-tenancy
|
||||
"tenant_name": "TenantName", // Tenant name for multi-tenancy
|
||||
},
|
||||
}
|
||||
|
||||
@@ -97,8 +98,9 @@ func (r *UDMSubImpl) SelectPage(query map[string]any) map[string]any {
|
||||
}
|
||||
// for multi-tenancy solution
|
||||
if v, ok := query["tenantName"]; ok && v != "" {
|
||||
conditions = append(conditions, "tenant_name = '?'")
|
||||
conditions = append(conditions, "tenant_name = ?")
|
||||
params = append(params, v)
|
||||
fmt.Printf("tenantName = %s", v)
|
||||
}
|
||||
|
||||
// 构建查询条件语句
|
||||
|
||||
Reference in New Issue
Block a user