Merge branch 'main-v2' into lite
This commit is contained in:
@@ -51,7 +51,7 @@ type UDMAuthController struct {
|
||||
func (s *UDMAuthController) ResetData(c *gin.Context) {
|
||||
neId := c.Param("neId")
|
||||
if neId == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: neId is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: neId is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ func (s *UDMAuthController) Info(c *gin.Context) {
|
||||
neId := c.Param("neId")
|
||||
imsi := c.Param("imsi")
|
||||
if neId == "" || imsi == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: neId/imsi is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: neId/imsi is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -155,18 +155,18 @@ func (s *UDMAuthController) Add(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
neId := c.Param("neId")
|
||||
if neId == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: neId is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: neId is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
var body model.UDMAuthUser
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(422001, errMsgs))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
if body.IMSI == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: imsi is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: imsi is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -220,18 +220,18 @@ func (s *UDMAuthController) Adds(c *gin.Context) {
|
||||
neId := c.Param("neId")
|
||||
num := c.Param("num")
|
||||
if neId == "" || num == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: neId/num is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: neId/num is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
var body model.UDMAuthUser
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(422001, errMsgs))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
if body.IMSI == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: imsi is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: imsi is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -283,18 +283,18 @@ func (s *UDMAuthController) Edit(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
neId := c.Param("neId")
|
||||
if neId == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: neId is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: neId is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
var body model.UDMAuthUser
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(422001, errMsgs))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
if body.IMSI == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: imsi is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: imsi is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ func (s *UDMAuthController) Remove(c *gin.Context) {
|
||||
neId := c.Param("neId")
|
||||
imsi := c.Param("imsi")
|
||||
if neId == "" || imsi == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: neId/imsi is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: neId/imsi is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ func (s *UDMAuthController) Removes(c *gin.Context) {
|
||||
imsi := c.Param("imsi")
|
||||
num := c.Param("num")
|
||||
if neId == "" || imsi == "" || num == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: neId/imsi/num is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: neId/imsi/num is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ func (s *UDMAuthController) Export(c *gin.Context) {
|
||||
neId := c.Query("neId")
|
||||
fileType := c.Query("type")
|
||||
if neId == "" {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: neId is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: neId is empty"))
|
||||
return
|
||||
}
|
||||
if !(fileType == "csv" || fileType == "txt") {
|
||||
@@ -557,7 +557,7 @@ func (s *UDMAuthController) Import(c *gin.Context) {
|
||||
}
|
||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||
c.JSON(422, resp.CodeMsg(422001, errMsgs))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_PARSER, errMsgs))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user