fix:: 请求响应码用常量
This commit is contained in:
@@ -67,7 +67,7 @@ func (s *NeLicenseController) Info(c *gin.Context) {
|
||||
language := reqctx.AcceptLanguage(c)
|
||||
id := parse.Number(c.Param("id"))
|
||||
if id <= 0 {
|
||||
c.JSON(422, resp.CodeMsg(422002, "bind err: id is empty"))
|
||||
c.JSON(422, resp.CodeMsg(resp.CODE_PARAM_CHEACK, "bind err: id is empty"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ func (s *NeLicenseController) NeTypeAndID(c *gin.Context) {
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); 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
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ func (s *NeLicenseController) Code(c *gin.Context) {
|
||||
}
|
||||
if err := c.ShouldBindQuery(&querys); 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
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ func (s *NeLicenseController) Change(c *gin.Context) {
|
||||
err := c.ShouldBindBodyWithJSON(&body)
|
||||
if err != nil || body.LicensePath == "" {
|
||||
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