fix: 调整跟踪任务数据属性字段
This commit is contained in:
@@ -16,7 +16,7 @@ var NewTraceData = &TraceDataController{
|
|||||||
traceDataService: traceService.NewTraceData,
|
traceDataService: traceService.NewTraceData,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跟踪任务
|
// 跟踪任务数据
|
||||||
//
|
//
|
||||||
// PATH /data
|
// PATH /data
|
||||||
type TraceDataController struct {
|
type TraceDataController struct {
|
||||||
@@ -24,7 +24,7 @@ type TraceDataController struct {
|
|||||||
traceDataService *traceService.TraceData
|
traceDataService *traceService.TraceData
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跟踪任务列表
|
// 跟踪任务数据列表
|
||||||
//
|
//
|
||||||
// GET /list
|
// GET /list
|
||||||
func (s *TraceDataController) List(c *gin.Context) {
|
func (s *TraceDataController) List(c *gin.Context) {
|
||||||
@@ -35,7 +35,7 @@ func (s *TraceDataController) List(c *gin.Context) {
|
|||||||
c.JSON(200, result.Ok(data))
|
c.JSON(200, result.Ok(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跟踪任务删除
|
// 跟踪任务数据删除
|
||||||
//
|
//
|
||||||
// DELETE /:ids
|
// DELETE /:ids
|
||||||
func (s *TraceDataController) Remove(c *gin.Context) {
|
func (s *TraceDataController) Remove(c *gin.Context) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ package model
|
|||||||
type TraceData struct {
|
type TraceData struct {
|
||||||
ID string `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
ID string `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||||||
TaskId int64 `json:"taskId" gorm:"task_id"` // 任务ID
|
TaskId int64 `json:"taskId" gorm:"task_id"` // 任务ID
|
||||||
Imsi string `json:"imsi" gorm:"imsi"`
|
IMSI string `json:"imsi" gorm:"imsi"`
|
||||||
Msisdn string `json:"msisdn" gorm:"msisdn"` // 可能存在
|
MSISDN string `json:"msisdn" gorm:"msisdn"` // 可能存在
|
||||||
SrcAddr string `json:"srcAddr" gorm:"src_addr"` // 源地址带端口
|
SrcAddr string `json:"srcAddr" gorm:"src_addr"` // 源地址带端口
|
||||||
DstAddr string `json:"dstAddr" gorm:"dst_addr"` // 目标地址带端口
|
DstAddr string `json:"dstAddr" gorm:"dst_addr"` // 目标地址带端口
|
||||||
IfType int64 `json:"ifType" gorm:"if_type"` // 接口类型,未分类
|
IfType int64 `json:"ifType" gorm:"if_type"` // 接口类型,未分类
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ var NewTraceData = &TraceData{
|
|||||||
resultMap: map[string]string{
|
resultMap: map[string]string{
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
"task_id": "TaskId",
|
"task_id": "TaskId",
|
||||||
"imsi": "Imsi",
|
"imsi": "IMSI",
|
||||||
"msisdn": "Msisdn",
|
"msisdn": "MSISDN",
|
||||||
"src_addr": "SrcAddr",
|
"src_addr": "SrcAddr",
|
||||||
"dst_addr": "DstAddr",
|
"dst_addr": "DstAddr",
|
||||||
"if_type": "IfType",
|
"if_type": "IfType",
|
||||||
@@ -124,13 +124,13 @@ func (r *TraceData) SelectList(data model.TraceData) []model.TraceData {
|
|||||||
// 查询条件拼接
|
// 查询条件拼接
|
||||||
var conditions []string
|
var conditions []string
|
||||||
var params []any
|
var params []any
|
||||||
if data.Imsi != "" {
|
if data.IMSI != "" {
|
||||||
conditions = append(conditions, "imsi = ?")
|
conditions = append(conditions, "imsi = ?")
|
||||||
params = append(params, data.Imsi)
|
params = append(params, data.IMSI)
|
||||||
}
|
}
|
||||||
if data.Msisdn != "" {
|
if data.MSISDN != "" {
|
||||||
conditions = append(conditions, "msisdn = ?")
|
conditions = append(conditions, "msisdn = ?")
|
||||||
params = append(params, data.Msisdn)
|
params = append(params, data.MSISDN)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建查询条件语句
|
// 构建查询条件语句
|
||||||
@@ -171,11 +171,11 @@ func (r *TraceData) Insert(data model.TraceData) string {
|
|||||||
if data.TaskId > 0 {
|
if data.TaskId > 0 {
|
||||||
params["task_id"] = data.TaskId
|
params["task_id"] = data.TaskId
|
||||||
}
|
}
|
||||||
if data.Imsi != "" {
|
if data.IMSI != "" {
|
||||||
params["imsi"] = data.Imsi
|
params["imsi"] = data.IMSI
|
||||||
}
|
}
|
||||||
if data.Msisdn != "" {
|
if data.MSISDN != "" {
|
||||||
params["msisdn"] = data.Msisdn
|
params["msisdn"] = data.MSISDN
|
||||||
}
|
}
|
||||||
if data.SrcAddr != "" {
|
if data.SrcAddr != "" {
|
||||||
params["src_addr"] = data.SrcAddr
|
params["src_addr"] = data.SrcAddr
|
||||||
|
|||||||
Reference in New Issue
Block a user