feat: 网元数据CDR和UE事件接口新增查询删除
This commit is contained in:
@@ -6,4 +6,7 @@ import "ems.agt/src/modules/network_data/model"
|
||||
type ICDREvent interface {
|
||||
// SelectPage 根据条件分页查询
|
||||
SelectPage(querys model.CDREventQuery) map[string]any
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
DeleteByIds(cdrIds []string) (int64, error)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"ems.agt/src/modules/network_data/model"
|
||||
"ems.agt/src/modules/network_data/repository"
|
||||
)
|
||||
@@ -20,3 +22,19 @@ type CDREventImpl struct {
|
||||
func (r *CDREventImpl) SelectPage(querys model.CDREventQuery) map[string]any {
|
||||
return r.cdrEventRepository.SelectPage(querys)
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (r *CDREventImpl) DeleteByIds(cdrIds []string) (int64, error) {
|
||||
// 检查是否存在
|
||||
ids := r.cdrEventRepository.SelectByIds(cdrIds)
|
||||
if len(ids) <= 0 {
|
||||
return 0, fmt.Errorf("not data")
|
||||
}
|
||||
|
||||
if len(ids) == len(cdrIds) {
|
||||
rows := r.cdrEventRepository.DeleteByIds(cdrIds)
|
||||
return rows, nil
|
||||
}
|
||||
// 删除信息失败!
|
||||
return 0, fmt.Errorf("delete fail")
|
||||
}
|
||||
|
||||
@@ -6,4 +6,7 @@ import "ems.agt/src/modules/network_data/model"
|
||||
type IUEEvent interface {
|
||||
// SelectPage 根据条件分页查询
|
||||
SelectPage(querys model.UEEventQuery) map[string]any
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
DeleteByIds(ueIds []string) (int64, error)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"ems.agt/src/modules/network_data/model"
|
||||
"ems.agt/src/modules/network_data/repository"
|
||||
)
|
||||
@@ -20,3 +22,19 @@ type UEEventImpl struct {
|
||||
func (r *UEEventImpl) SelectPage(querys model.UEEventQuery) map[string]any {
|
||||
return r.ueEventRepository.SelectPage(querys)
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (r *UEEventImpl) DeleteByIds(ueIds []string) (int64, error) {
|
||||
// 检查是否存在
|
||||
ids := r.ueEventRepository.SelectByIds(ueIds)
|
||||
if len(ids) <= 0 {
|
||||
return 0, fmt.Errorf("no data")
|
||||
}
|
||||
|
||||
if len(ids) == len(ueIds) {
|
||||
rows := r.ueEventRepository.DeleteByIds(ueIds)
|
||||
return rows, nil
|
||||
}
|
||||
// 删除信息失败!
|
||||
return 0, fmt.Errorf("delete fail")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user