fusenapi/utils/basic/basic.go
2023-06-07 18:30:58 +08:00

18 lines
605 B
Go

package basic
// StatusResponse 公司自定义状态码
type StatusResponse struct {
Code int
Message string
}
var (
CodeOK = &StatusResponse{200, "success"} // 成功
CodeApiErr = &StatusResponse{500, "api error"} // api 错误
CodeSaveErr = &StatusResponse{501, "fail to save"} // 储存错误
CodeServiceErr = &StatusResponse{510, "server logic error"} // server logic 错误
CodeUnAuth = &StatusResponse{401, "unauthorized"} // 未授权
CodeUpdateErr = &StatusResponse{5000, "update database error"} // update database logic 错误
)