fusenapi/utils/basic/basic.go

18 lines
605 B
Go
Raw Normal View History

2023-06-05 09:56:55 +00:00
package basic
// StatusResponse 公司自定义状态码
type StatusResponse struct {
Code int
Message string
}
var (
2023-06-07 10:30:58 +00:00
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 错误
2023-06-05 09:56:55 +00:00
)