fix: delete ims user and voip auth

This commit is contained in:
zhangsz
2025-04-11 15:37:49 +08:00
parent 6375bb7d8b
commit cbdec51ba8
3 changed files with 15 additions and 12 deletions

View File

@@ -4,13 +4,13 @@ import (
"fmt"
"strings"
"be.ems/features/ue/model"
dborm "be.ems/lib/core/datasource"
"be.ems/lib/log"
"be.ems/src/framework/datasource"
"be.ems/src/framework/logger"
"be.ems/src/framework/utils/parse"
"be.ems/src/framework/utils/repo"
"be.ems/features/ue/model"
)
// 实例化数据层 VoIPAuthRepository 结构体
@@ -22,11 +22,10 @@ var NewVoIPAuthRepository = &VoIPAuthRepository{
left join sys_tenant t on t.tenant_id = s.tenant_id and t.status = 1`,
resultMap: map[string]string{
"id": "ID",
"ne_id": "NeId",
"user_name": "UserName",
"password": "Password",
"id": "ID",
"ne_id": "NeId",
"user_name": "UserName",
"password": "Password",
"tenant_id": "TenantID",
"tenant_name": "TenantName", // Tenant name for multi-tenancy
@@ -235,7 +234,7 @@ func (r *VoIPAuthRepository) Inserts(uArr []model.VoIPAuth) int64 {
// Delete 删除实体
func (r *VoIPAuthRepository) Delete(userName, neId string) int64 {
tx := datasource.DefaultDB().Where("user_name = ? and ne_id = ?", userName, neId).Delete(&VoIPAuthRepository{})
tx := datasource.DefaultDB().Where("user_name = ? and ne_id = ?", userName, neId).Delete(&model.VoIPAuth{})
if err := tx.Error; err != nil {
logger.Errorf("Delete err => %v", err)
}