style: 去除Impl接口声明层聚焦服务函数
This commit is contained in:
@@ -1,12 +1,39 @@
|
||||
package service
|
||||
|
||||
import "be.ems/src/modules/network_data/model"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
// UE会话事件MME 服务层接口
|
||||
type IUEEventMME interface {
|
||||
// SelectPage 根据条件分页查询
|
||||
SelectPage(querys model.UEEventMMEQuery) map[string]any
|
||||
"be.ems/src/modules/network_data/model"
|
||||
"be.ems/src/modules/network_data/repository"
|
||||
)
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
DeleteByIds(ueIds []string) (int64, error)
|
||||
// 实例化数据层 UEEventMME 结构体
|
||||
var NewUEEventMME = &UEEventMME{
|
||||
ueEventRepository: repository.NewUEEventMME,
|
||||
}
|
||||
|
||||
// UEEventMME UE会话事件MME 服务层处理
|
||||
type UEEventMME struct {
|
||||
ueEventRepository *repository.UEEventMME // UE会话事件数据信息
|
||||
}
|
||||
|
||||
// SelectPage 根据条件分页查询
|
||||
func (r *UEEventMME) SelectPage(querys model.UEEventMMEQuery) map[string]any {
|
||||
return r.ueEventRepository.SelectPage(querys)
|
||||
}
|
||||
|
||||
// DeleteByIds 批量删除信息
|
||||
func (r *UEEventMME) 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