2025-06-29 00:36:30 +08:00
|
|
|
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{
|
2025-07-04 19:59:06 +08:00
|
|
|
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",
|
|
|
|
|
NotFindMember: "not find member",
|
|
|
|
|
NotFindApiKey: "not find api key",
|
|
|
|
|
MemberPlatformNotSupport: "member platform not support",
|
|
|
|
|
RechargeAmountMustBeGreaterThanZero: "recharge amount must be greater than zero",
|
2025-06-29 00:36:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
Success = 200 //成功
|
|
|
|
|
Unauthorized = 401 //未授权
|
|
|
|
|
ServerError = 500 //服务器错误
|
|
|
|
|
NotFound = 404 //未找到
|
|
|
|
|
Forbidden = 403 //禁止访问
|
|
|
|
|
|
|
|
|
|
//=============== 公共code ================
|
|
|
|
|
InvalidParams = 10001 //参数错误
|
|
|
|
|
|
|
|
|
|
//================ 翻译code ===============
|
|
|
|
|
InSufficRemainChar = 20001 //剩余字数不足
|
|
|
|
|
PlatformNotSupport = 20002 //平台不支持
|
|
|
|
|
TransactionNotAvailable = 20003 //翻译服务不可用
|
|
|
|
|
ApiUnauthorized = 20004 //api禁止访问
|
2025-07-02 18:32:43 +08:00
|
|
|
|
|
|
|
|
NotFindMember = 30001 //未找到用户
|
|
|
|
|
NotFindApiKey = 30002 //未找到api key
|
|
|
|
|
MemberPlatformNotSupport = 30003 //用户平台不支持
|
2025-07-04 19:59:06 +08:00
|
|
|
|
|
|
|
|
//================ 充值相关 ===============
|
|
|
|
|
RechargeAmountMustBeGreaterThanZero = 40001 //充值金额必须大于0
|
|
|
|
|
|
2025-06-29 00:36:30 +08:00
|
|
|
)
|