1
Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
Issue Check Inactive / issue-check-inactive (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
Issue Check Inactive / issue-check-inactive (push) Has been cancelled
This commit is contained in:
40
common/statuscode/status_1.go
Normal file
40
common/statuscode/status_1.go
Normal file
@ -0,0 +1,40 @@
|
||||
package statuscode
|
||||
|
||||
// Response 响应结构
|
||||
type Response struct {
|
||||
Status int `json:"status"`
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data interface{} `json:"data"`
|
||||
RequestID string `json:"RequestId"`
|
||||
}
|
||||
|
||||
var ErrorMessage = map[int]string{
|
||||
Success: "success",
|
||||
Unauthorized: "unauthorized",
|
||||
ServerError: "server error",
|
||||
NotFound: "not found",
|
||||
Forbidden: "forbidden",
|
||||
InvalidParams: "invalid params",
|
||||
InSufficRemainChar: "insufficent remain char",
|
||||
PlatformNotSupport: "platform not support",
|
||||
TransactionNotAvailable: "transaction not available",
|
||||
ApiUnauthorized: "api unauthorized",
|
||||
}
|
||||
|
||||
const (
|
||||
Success = 200 //成功
|
||||
Unauthorized = 401 //未授权
|
||||
ServerError = 500 //服务器错误
|
||||
NotFound = 404 //未找到
|
||||
Forbidden = 403 //禁止访问
|
||||
|
||||
//=============== 公共code ================
|
||||
InvalidParams = 10001 //参数错误
|
||||
|
||||
//================ 翻译code ===============
|
||||
InSufficRemainChar = 20001 //剩余字数不足
|
||||
PlatformNotSupport = 20002 //平台不支持
|
||||
TransactionNotAvailable = 20003 //翻译服务不可用
|
||||
ApiUnauthorized = 20004 //api禁止访问
|
||||
)
|
||||
Reference in New Issue
Block a user