1 Star 0 Fork 0

chief/openwechat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
base_response.go 759 Bytes
一键复制 编辑 原始数据 按行查看 历史
多吃点苹果 提交于 2023-01-06 01:25 +08:00 . 添加 Ret code (#180)
package openwechat
type Ret int
const (
ticketError Ret = -14 // ticket error
logicError Ret = -2 // logic error
sysError Ret = -1 // sys error
paramError Ret = 1 // param error
failedLoginWarn Ret = 1100 // failed login warn
failedLoginCheck Ret = 1101 // failed login check
cookieInvalid Ret = 1102 // cookie invalid
loginEnvAbnormality Ret = 1203 // login environmental abnormality
optTooOften Ret = 1205 // operate too often
)
// BaseResponse 大部分返回对象都携带该信息
type BaseResponse struct {
Ret Ret
ErrMsg string
}
func (b BaseResponse) Ok() bool {
return b.Ret == 0
}
func (b BaseResponse) Err() error {
if b.Ok() {
return nil
}
return b.Ret
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tiancityycf/openwechat.git
git@gitee.com:tiancityycf/openwechat.git
tiancityycf
openwechat
openwechat
v1.0.0

搜索帮助