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

@@ -16,7 +16,7 @@ import (
// 实例化控制层 TCPdumpController 结构体
var NewTCPdump = &TCPdumpController{
tcpdumpService: traceService.NewTCPdump,
neInfoService: neService.NewNeInfoImpl,
neInfoService: neService.NewNeInfo,
}
// 信令抓包
@@ -24,7 +24,7 @@ var NewTCPdump = &TCPdumpController{
// PATH /tcpdump
type TCPdumpController struct {
tcpdumpService *traceService.TCPdump // 信令抓包服务
neInfoService neService.INeInfo // 网元信息服务
neInfoService *neService.NeInfo // 网元信息服务
}
// 网元抓包PACP 开始

View File

@@ -21,7 +21,7 @@ import (
// 实例化控制层 TraceTaskHlrController 结构体
var NewTraceTaskHlr = &TraceTaskHlrController{
neInfoService: neService.NewNeInfoImpl,
neInfoService: neService.NewNeInfo,
traceTaskHlrService: traceService.NewTraceTaskHlr,
}
@@ -29,10 +29,8 @@ var NewTraceTaskHlr = &TraceTaskHlrController{
//
// PATH /task/hlr
type TraceTaskHlrController struct {
// 网元信息服务
neInfoService neService.INeInfo
// 跟踪_任务给HRL网元信息服务
traceTaskHlrService *traceService.TraceTaskHlr
neInfoService *neService.NeInfo // 网元信息服务
traceTaskHlrService *traceService.TraceTaskHlr // 跟踪_任务给HRL网元信息服务
}
// 跟踪任务列表

View File

@@ -18,13 +18,12 @@ import (
// 实例化服务层 TCPdump 结构体
var NewTCPdump = &TCPdump{
neInfoService: neService.NewNeInfoImpl,
neInfoService: neService.NewNeInfo,
}
// 信令抓包 服务层处理
type TCPdump struct {
// 网元信息服务
neInfoService neService.INeInfo
neInfoService *neService.NeInfo // 网元信息服务
}
// 抓包进程PID

View File

@@ -189,7 +189,7 @@ func (r *TraceTask) Insert(task model.TraceTask) error {
task.NotifyUrl = fmt.Sprintf("udp:%s:%d", host, port)
// 查询网元获取IP
neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(task.NeType, task.NeId)
neInfo := neService.NewNeInfo.SelectNeInfoByNeTypeAndNeID(task.NeType, task.NeId)
if neInfo.NeId != task.NeId || neInfo.IP == "" {
return fmt.Errorf("app.common.noNEInfo")
}
@@ -254,7 +254,7 @@ func (r *TraceTask) Update(task model.TraceTask) error {
task.NotifyUrl = fmt.Sprintf("udp:%s:%d", host, port)
// 查询网元获取IP
neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(task.NeType, task.NeId)
neInfo := neService.NewNeInfo.SelectNeInfoByNeTypeAndNeID(task.NeType, task.NeId)
if neInfo.NeId != task.NeId || neInfo.IP == "" {
return fmt.Errorf("app.common.noNEInfo")
}
@@ -309,7 +309,7 @@ func (r *TraceTask) DeleteByIds(ids []string) (int64, error) {
if len(rows) == len(ids) {
// 停止任务
for _, v := range rows {
neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(v.NeType, v.NeId)
neInfo := neService.NewNeInfo.SelectNeInfoByNeTypeAndNeID(v.NeType, v.NeId)
if neInfo.NeId != v.NeId || neInfo.IP == "" {
continue
}

View File

@@ -17,15 +17,13 @@ import (
// 实例化数据层 TraceTaskHlr 结构体
var NewTraceTaskHlr = &TraceTaskHlr{
traceTaskHlrRepository: repository.NewTraceTaskHlr,
neInfoService: neService.NewNeInfoImpl,
neInfoService: neService.NewNeInfo,
}
// TraceTaskHlr 跟踪_任务给HRL网元 服务层处理
type TraceTaskHlr struct {
// 跟踪_任务给HRL网元数据信息
traceTaskHlrRepository *repository.TraceTaskHlr
// 网元信息服务
neInfoService neService.INeInfo
traceTaskHlrRepository *repository.TraceTaskHlr // 跟踪_任务给HRL网元数据信息
neInfoService *neService.NeInfo // 网元信息服务
}
// SelectPage 根据条件分页查询