style: 错误信息英文返回-trace 模块路由

This commit is contained in:
TsMask
2023-11-08 14:56:08 +08:00
parent 56a2f75ebb
commit ae7f2d050c
2 changed files with 11 additions and 9 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"))
}