Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
gif001 committed Jan 22, 2025
1 parent f6a022c commit 7a637b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions goio/server/server_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,30 @@ func HttpSuccess(data interface{}) *Response {

// 请求格式错误,比如参数格式、参数字段名等 不正确
func HttpBadRequest(msg string, showType ...uint32) *Response {
return ErrorResponse(gconv.String(400), msg, showType...)
return ErrorResponseX(gconv.String(400), msg, showType...)
}

// 用户没有访问权限,需要进行身份认证
func HttpUnauthorized(msg string, showType ...uint32) *Response {
return ErrorResponse(gconv.String(401), msg, showType...)
return ErrorResponseX(gconv.String(401), msg, showType...)
}

// 用户已进行身份认证,但权限不够
func HttpForbidden(msg string, showType ...uint32) *Response {
return ErrorResponse(gconv.String(403), msg, showType...)
return ErrorResponseX(gconv.String(403), msg, showType...)
}

// 接口不存在
func HttpNotFound(msg string, showType ...uint32) *Response {
return ErrorResponse(gconv.String(404), msg, showType...)
return ErrorResponseX(gconv.String(404), msg, showType...)
}

// 服务器内部错误
func HttpServerError(msg string, showType ...uint32) *Response {
return ErrorResponse(gconv.String(500), msg, showType...)
return ErrorResponseX(gconv.String(500), msg, showType...)
}

// 如需返回特殊错误码,调用此接口
func HttpFailForCode(code int64, msg string, showType ...uint32) *Response {
return ErrorResponse(gconv.String(code), msg, showType...)
return ErrorResponseX(gconv.String(code), msg, showType...)
}

0 comments on commit 7a637b4

Please sign in to comment.