41 lines
991 B
Go
41 lines
991 B
Go
package service
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"be.ems/src/modules/network_data/model"
|
|
"be.ems/src/modules/network_data/repository"
|
|
)
|
|
|
|
// 实例化数据层 UEEventAMFImpl 结构体
|
|
var NewUEEventAMFImpl = &UEEventAMFImpl{
|
|
ueEventRepository: repository.NewUEEventAMFImpl,
|
|
}
|
|
|
|
// UEEventAMFImpl UE会话事件AMF 服务层处理
|
|
type UEEventAMFImpl struct {
|
|
// UE会话事件数据信息
|
|
ueEventRepository repository.IUEEventAMF
|
|
}
|
|
|
|
// SelectPage 根据条件分页查询
|
|
func (r *UEEventAMFImpl) SelectPage(querys model.UEEventAMFQuery) map[string]any {
|
|
return r.ueEventRepository.SelectPage(querys)
|
|
}
|
|
|
|
// DeleteByIds 批量删除信息
|
|
func (r *UEEventAMFImpl) 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")
|
|
}
|