1 Star 0 Fork 0

carlmax_my/console-core-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
error_http.go 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
carlmax_my 提交于 2024-12-02 21:32 . init project
package core
import "net/http"
// 400
func BadRequest(businessCode int) BusinessError {
return Error(http.StatusBadRequest, businessCode, "")
}
func BadRequestError(businessCode int, message string) BusinessError {
return Error(http.StatusBadRequest, businessCode, message)
}
// 401
func Unauthorized(businessCode int) BusinessError {
return Error(http.StatusUnauthorized, businessCode, "")
}
func UnauthorizedError(businessCode int, message string) BusinessError {
return Error(http.StatusUnauthorized, businessCode, message)
}
// 403
func ForbiddenError(businessCode int, message string) BusinessError {
return Error(http.StatusForbidden, businessCode, message)
}
// 404
func NotFoundError(businessCode int, message string) BusinessError {
return Error(http.StatusNotFound, businessCode, message)
}
// 500
func InternalServerError(businessCode int, message string) BusinessError {
return Error(http.StatusInternalServerError, businessCode, message)
}
// 501
func NotImplementedError(businessCode int, message string) BusinessError {
return Error(http.StatusNotImplemented, businessCode, message)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/carlmax_my/console-core-go.git
git@gitee.com:carlmax_my/console-core-go.git
carlmax_my
console-core-go
console-core-go
v0.0.21

搜索帮助