style: 去除Impl接口声明层聚焦服务函数

This commit is contained in:
TsMask
2024-10-12 19:06:12 +08:00
parent 94bba0c910
commit 1f0c932be8
102 changed files with 5624 additions and 6320 deletions

View File

@@ -1,12 +1,39 @@
package service
import "be.ems/src/modules/network_data/model"
import (
"fmt"
// CDR会话事件IMS 服务层接口
type ICDREventIMS interface {
// SelectPage 根据条件分页查询
SelectPage(querys model.CDREventIMSQuery) map[string]any
"be.ems/src/modules/network_data/model"
"be.ems/src/modules/network_data/repository"
)
// DeleteByIds 批量删除信息
DeleteByIds(cdrIds []string) (int64, error)
// 实例化数据层 CDREventIMS 结构体
var NewCDREventIMS = &CDREventIMS{
cdrEventIMSRepository: repository.NewCDREventIMS,
}
// CDREventImpl CDR会话事件IMS 服务层处理
type CDREventIMS struct {
cdrEventIMSRepository *repository.CDREventIMS // CDR会话事件数据信息
}
// SelectPage 根据条件分页查询
func (r *CDREventIMS) SelectPage(querys model.CDREventIMSQuery) map[string]any {
return r.cdrEventIMSRepository.SelectPage(querys)
}
// DeleteByIds 批量删除信息
func (r *CDREventIMS) DeleteByIds(cdrIds []string) (int64, error) {
// 检查是否存在
ids := r.cdrEventIMSRepository.SelectByIds(cdrIds)
if len(ids) <= 0 {
return 0, fmt.Errorf("not data")
}
if len(ids) == len(cdrIds) {
rows := r.cdrEventIMSRepository.DeleteByIds(cdrIds)
return rows, nil
}
// 删除信息失败!
return 0, fmt.Errorf("delete fail")
}