1
0

marge: 合并代码

This commit is contained in:
TsMask
2023-11-13 18:28:13 +08:00
parent 6caf373ab5
commit 21a5e210eb
77 changed files with 1001 additions and 664 deletions

View File

@@ -43,14 +43,15 @@ func (s *TcpdumpController) NeTask(c *gin.Context) {
}
err := c.ShouldBindBodyWith(&body, binding.JSON)
if err != nil {
c.JSON(400, result.CodeMsg(400, "参数错误"))
c.JSON(400, result.CodeMsg(400, "parameter error"))
return
}
// 检查网元信息
neInfo := s.NeInfoService.SelectNeInfoByNeTypeAndNeID(body.NeType, body.NeId)
if neInfo.NeId != body.NeId {
msg := fmt.Sprintf("找不到 %s %s 对应网元信息", body.NeType, body.NeId)
// 找不到 %s %s 对应网元信息
msg := fmt.Sprintf("Cannot find %s %s network element information.", body.NeType, body.NeId)
c.JSON(200, result.ErrMsg(msg))
return
}
@@ -85,14 +86,15 @@ func (s *TcpdumpController) Download(c *gin.Context) {
}
err := c.ShouldBindBodyWith(&body, binding.JSON)
if err != nil {
c.JSON(400, result.CodeMsg(400, "参数错误"))
c.JSON(400, result.CodeMsg(400, "parameter error"))
return
}
// 检查网元信息
neInfo := s.NeInfoService.SelectNeInfoByNeTypeAndNeID(body.NeType, body.NeId)
if neInfo.NeId != body.NeId {
msg := fmt.Sprintf("找不到 %s %s 对应网元信息", body.NeType, body.NeId)
// 找不到 %s %s 对应网元信息
msg := fmt.Sprintf("Cannot find %s %s network element information.", body.NeType, body.NeId)
c.JSON(200, result.ErrMsg(msg))
return
}
@@ -121,7 +123,7 @@ func (s *TcpdumpController) NeUPFTask(c *gin.Context) {
}
err := c.ShouldBindBodyWith(&body, binding.JSON)
if err != nil {
c.JSON(400, result.CodeMsg(400, "参数错误"))
c.JSON(400, result.CodeMsg(400, "parameter error"))
return
}
@@ -258,5 +260,5 @@ func (s *TcpdumpController) NeUPFTask(c *gin.Context) {
return
}
c.JSON(200, result.ErrMsg("请选择RunType执行start_telnet/stop_telnet/start_str/stop_str"))
c.JSON(200, result.ErrMsg("Please select RunType to execute: start_telnet/stop_telnet/start_str/stop_str"))
}