重构WxError相关代码,自动根据代码补充错误中文说明

This commit is contained in:
Binary Wang 2018-05-14 23:42:28 +08:00
parent a9d552729c
commit ef97a308f3
173 changed files with 1240 additions and 361 deletions

View File

@ -0,0 +1,32 @@
package me.chanjar.weixin.common;
/**
* <pre>
* 微信类型枚举.
* Created by BinaryWang on 2018/5/14.
* </pre>
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
public enum WxType {
/**
* 企业微信
*/
CP,
/**
* 微信公众号
*/
MP,
/**
* 微信小程序
*/
MiniApp,
/**
* 微信开放平台
*/
Open,
/**
* 微信支付
*/
Pay;
}

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.common.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* WxErrorException处理器.

View File

@ -1,38 +0,0 @@
package me.chanjar.weixin.common.bean.result;
import lombok.Builder;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.io.Serializable;
/**
* 微信错误码说明请阅读 <a href="http://mp.weixin.qq.com/wiki/10/6380dc743053a91c544ffd2b7c959166.html">全局返回码说明</a>.
*
* @author Daniel Qian
*/
@Data
@Builder
public class WxError implements Serializable {
private static final long serialVersionUID = 7869786563361406291L;
private int errorCode;
private String errorMsg;
private String json;
public static WxError fromJson(String json) {
return WxGsonBuilder.create().fromJson(json, WxError.class);
}
@Override
public String toString() {
if (this.json != null) {
return this.json;
}
return "错误: Code=" + this.errorCode + ", Msg=" + this.errorMsg;
}
}

View File

@ -0,0 +1,806 @@
package me.chanjar.weixin.common.error;
import lombok.Getter;
/**
* <pre>
* 企业微信全局错误码.
* 参考文档<a href="https://work.weixin.qq.com/api/doc#10649">企业微信全局错误码</a>
* Created by Binary Wang on 2018/5/13.
* </pre>
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Getter
public enum WxCpErrorMsgEnum {
/**
* 系统繁忙服务器暂不可用建议稍候重试建议重试次数不超过3次
*/
CODE_1(-1, "系统繁忙服务器暂不可用建议稍候重试。建议重试次数不超过3次。"),
/**
* 请求成功接口调用成功
*/
CODE_0(0, "请求成功;接口调用成功"),
/**
* 不合法的secret参数secret在应用详情/通讯录管理助手可查看
*/
CODE_40001(40001, "不合法的secret参数secret在应用详情/通讯录管理助手可查看"),
/**
* 无效的UserID
*/
CODE_40003(40003, "无效的UserID"),
/**
* 不合法的媒体文件类型不满足系统文件要求参考上传的媒体文件限制
*/
CODE_40004(40004, "不合法的媒体文件类型;不满足系统文件要求。参考:上传的媒体文件限制"),
/**
* 不合法的type参数合法的type取值参考上传临时素材
*/
CODE_40005(40005, "不合法的type参数合法的type取值参考上传临时素材"),
/**
* 不合法的文件大小系统文件要求参考上传的媒体文件限制
*/
CODE_40006(40006, "不合法的文件大小;系统文件要求,参考:上传的媒体文件限制"),
/**
* 不合法的media_id参数
*/
CODE_40007(40007, "不合法的media_id参数"),
/**
* 不合法的msgtype参数合法的msgtype取值参考消息类型
*/
CODE_40008(40008, "不合法的msgtype参数合法的msgtype取值参考消息类型"),
/**
* 上传图片大小不是有效值图片大小的系统限制参考上传的媒体文件限制
*/
CODE_40009(40009, "上传图片大小不是有效值;图片大小的系统限制,参考上传的媒体文件限制"),
/**
* 上传视频大小不是有效值视频大小的系统限制参考上传的媒体文件限制
*/
CODE_40011(40011, "上传视频大小不是有效值;视频大小的系统限制,参考上传的媒体文件限制"),
/**
* 不合法的CorpID需确认CorpID是否填写正确 web管理端-设置 可查看
*/
CODE_40013(40013, "不合法的CorpID需确认CorpID是否填写正确在 web管理端-设置 可查看"),
/**
* 不合法的access_token
*/
CODE_40014(40014, "不合法的access_token"),
/**
* 不合法的按钮个数菜单按钮1-3个
*/
CODE_40016(40016, "不合法的按钮个数菜单按钮1-3个"),
/**
* 不合法的按钮类型支持的类型参考按钮类型
*/
CODE_40017(40017, "不合法的按钮类型;支持的类型,参考:按钮类型"),
/**
* 不合法的按钮名字长度长度应不超过16个字节
*/
CODE_40018(40018, "不合法的按钮名字长度长度应不超过16个字节"),
/**
* 不合法的按钮KEY长度长度应不超过128字节
*/
CODE_40019(40019, "不合法的按钮KEY长度长度应不超过128字节"),
/**
* 不合法的按钮URL长度长度应不超过1024字节
*/
CODE_40020(40020, "不合法的按钮URL长度长度应不超过1024字节"),
/**
* 不合法的子菜单级数只能包含一级菜单和二级菜单
*/
CODE_40022(40022, "不合法的子菜单级数;只能包含一级菜单和二级菜单"),
/**
* 不合法的子菜单按钮个数子菜单按钮1-5个
*/
CODE_40023(40023, "不合法的子菜单按钮个数子菜单按钮1-5个"),
/**
* 不合法的子菜单按钮类型支持的类型参考按钮类型
*/
CODE_40024(40024, "不合法的子菜单按钮类型;支持的类型,参考:按钮类型"),
/**
* 不合法的子菜单按钮名字长度支持的类型参考按钮类型
*/
CODE_40025(40025, "不合法的子菜单按钮名字长度;支持的类型,参考:按钮类型"),
/**
* 不合法的子菜单按钮KEY长度长度应不超过60个字节
*/
CODE_40026(40026, "不合法的子菜单按钮KEY长度长度应不超过60个字节"),
/**
* 不合法的子菜单按钮URL长度长度应不超过1024字节
*/
CODE_40027(40027, "不合法的子菜单按钮URL长度长度应不超过1024字节"),
/**
* 不合法的oauth_code
*/
CODE_40029(40029, "不合法的oauth_code"),
/**
* 不合法的UserID列表指定的UserID列表至少存在一个UserID不在通讯录中
*/
CODE_40031(40031, "不合法的UserID列表指定的UserID列表至少存在一个UserID不在通讯录中"),
/**
* 不合法的UserID列表长度
*/
CODE_40032(40032, "不合法的UserID列表长度"),
/**
* 不合法的请求字符不能包含\\uxxxx格式的字符
*/
CODE_40033(40033, "不合法的请求字符;不能包含\\uxxxx格式的字符"),
/**
* 不合法的参数
*/
CODE_40035(40035, "不合法的参数"),
/**
* chatid不存在会话需要先创建后才可修改会话详情或者发起聊天
*/
CODE_40050(40050, "chatid不存在会话需要先创建后才可修改会话详情或者发起聊天"),
/**
* 不合法的子菜单url域名
*/
CODE_40054(40054, "不合法的子菜单url域名"),
/**
* 不合法的菜单url域名
*/
CODE_40055(40055, "不合法的菜单url域名"),
/**
* 不合法的agentid
*/
CODE_40056(40056, "不合法的agentid"),
/**
* 不合法的callbackurl或者callbackurl验证失败可自助到开发调试工具重现
*/
CODE_40057(40057, "不合法的callbackurl或者callbackurl验证失败可自助到开发调试工具重现"),
/**
* 不合法的参数传递参数不符合系统要求需要参照具体API接口说明
*/
CODE_40058(40058, "不合法的参数传递参数不符合系统要求需要参照具体API接口说明"),
/**
* 不合法的上报地理位置标志位开关标志位只能填 0 或者 1
*/
CODE_40059(40059, "不合法的上报地理位置标志位;开关标志位只能填 0 或者 1"),
/**
* 参数为空
*/
CODE_40063(40063, "参数为空"),
/**
* 不合法的部门列表部门列表为空或者至少存在一个部门ID不存在于通讯录中
*/
CODE_40066(40066, "不合法的部门列表部门列表为空或者至少存在一个部门ID不存在于通讯录中"),
/**
* 不合法的标签ID标签ID未指定或者指定的标签ID不存在
*/
CODE_40068(40068, "不合法的标签ID标签ID未指定或者指定的标签ID不存在"),
/**
* 指定的标签范围结点全部无效
*/
CODE_40070(40070, "指定的标签范围结点全部无效"),
/**
* 不合法的标签名字标签名字已经存在
*/
CODE_40071(40071, "不合法的标签名字;标签名字已经存在"),
/**
* 不合法的标签名字长度不允许为空最大长度限制为32个字汉字或英文字母
*/
CODE_40072(40072, "不合法的标签名字长度不允许为空最大长度限制为32个字汉字或英文字母"),
/**
* 不合法的openidopenid不存在需确认获取来源
*/
CODE_40073(40073, "不合法的openidopenid不存在需确认获取来源"),
/**
* news消息不支持保密消息类型图文消息支持保密类型需改用mpnews
*/
CODE_40074(40074, "news消息不支持保密消息类型图文消息支持保密类型需改用mpnews"),
/**
* 不合法的pre_auth_code参数预授权码不存在参考获取预授权码
*/
CODE_40077(40077, "不合法的pre_auth_code参数预授权码不存在参考获取预授权码"),
/**
* 不合法的auth_code参数需确认获取来源并且只能消费一次
*/
CODE_40078(40078, "不合法的auth_code参数需确认获取来源并且只能消费一次"),
/**
* 不合法的suite_secret套件secret可在第三方管理端套件详情查看
*/
CODE_40080(40080, "不合法的suite_secret套件secret可在第三方管理端套件详情查看"),
/**
* 不合法的suite_token
*/
CODE_40082(40082, "不合法的suite_token"),
/**
* 不合法的suite_idsuite_id不存在
*/
CODE_40083(40083, "不合法的suite_idsuite_id不存在"),
/**
* 不合法的permanent_code参数
*/
CODE_40084(40084, "不合法的permanent_code参数"),
/**
* 不合法的的suite_ticket参数suite_ticket不存在或者已失效
*/
CODE_40085(40085, "不合法的的suite_ticket参数suite_ticket不存在或者已失效"),
/**
* 不合法的第三方应用appid至少有一个不存在应用id
*/
CODE_40086(40086, "不合法的第三方应用appid至少有一个不存在应用id"),
/**
* jobid不存在请检查 jobid 来源
*/
CODE_40088(40088, "jobid不存在请检查 jobid 来源"),
/**
* 批量任务的结果已清理系统仅保存最近5次批量任务的结果可在通讯录查看实际导入情况
*/
CODE_40089(40089, "批量任务的结果已清理系统仅保存最近5次批量任务的结果。可在通讯录查看实际导入情况"),
/**
* secret不合法可能用了别的企业的secret
*/
CODE_40091(40091, "secret不合法可能用了别的企业的secret"),
/**
* 导入文件存在不合法的内容
*/
CODE_40092(40092, "导入文件存在不合法的内容"),
/**
* 不合法的jsapi_ticket参数ticket已失效或者拼写错误
*/
CODE_40093(40093, "不合法的jsapi_ticket参数ticket已失效或者拼写错误"),
/**
* 不合法的URL缺少主页URL参数或者URL不合法链接需要带上协议头 http:// 或者 https:// 开头
*/
CODE_40094(40094, "不合法的URL缺少主页URL参数或者URL不合法链接需要带上协议头以 http:// 或者 https:// 开头)"),
/**
* 缺少access_token参数
*/
CODE_41001(41001, "缺少access_token参数"),
/**
* 缺少corpid参数
*/
CODE_41002(41002, "缺少corpid参数"),
/**
* 缺少secret参数
*/
CODE_41004(41004, "缺少secret参数"),
/**
* 缺少media_id参数media_id为调用接口必填参数请确认是否有传递
*/
CODE_41006(41006, "缺少media_id参数media_id为调用接口必填参数请确认是否有传递"),
/**
* 缺少auth code参数
*/
CODE_41008(41008, "缺少auth code参数"),
/**
* 缺少userid参数
*/
CODE_41009(41009, "缺少userid参数"),
/**
* 缺少url参数
*/
CODE_41010(41010, "缺少url参数"),
/**
* 缺少agentid参数
*/
CODE_41011(41011, "缺少agentid参数"),
/**
* 缺少 description 参数发送文本卡片消息接口description 是必填字段
*/
CODE_41033(41033, "缺少 description 参数发送文本卡片消息接口description 是必填字段"),
/**
* 缺少title参数发送图文消息标题是必填参数请确认参数是否有传递
*/
CODE_41016(41016, "缺少title参数发送图文消息标题是必填参数。请确认参数是否有传递。"),
/**
* 缺少 department 参数
*/
CODE_41019(41019, "缺少 department 参数"),
/**
* 缺少tagid参数
*/
CODE_41017(41017, "缺少tagid参数"),
/**
* 缺少suite_id参数
*/
CODE_41021(41021, "缺少suite_id参数"),
/**
* 缺少suite_access_token参数
*/
CODE_41022(41022, "缺少suite_access_token参数"),
/**
* 缺少suite_ticket参数
*/
CODE_41023(41023, "缺少suite_ticket参数"),
/**
* 缺少secret参数
*/
CODE_41024(41024, "缺少secret参数"),
/**
* 缺少permanent_code参数
*/
CODE_41025(41025, "缺少permanent_code参数"),
/**
* access_token已过期access_token有时效性需要重新获取一次
*/
CODE_42001(42001, "access_token已过期access_token有时效性需要重新获取一次"),
/**
* pre_auth_code已过期pre_auth_code有时效性需要重新获取一次
*/
CODE_42007(42007, "pre_auth_code已过期pre_auth_code有时效性需要重新获取一次"),
/**
* suite_access_token已过期suite_access_token有时效性需要重新获取一次
*/
CODE_42009(42009, "suite_access_token已过期suite_access_token有时效性需要重新获取一次"),
/**
* 指定的userid未绑定微信或未关注微信插件需要成员使用微信登录企业微信或者关注微信插件才能获取openid
*/
CODE_43004(43004, "指定的userid未绑定微信或未关注微信插件需要成员使用微信登录企业微信或者关注微信插件才能获取openid"),
/**
* 多媒体文件为空上传格式参考上传临时素材确认header和body的内容正确
*/
CODE_44001(44001, "多媒体文件为空上传格式参考上传临时素材确认header和body的内容正确。"),
/**
* 文本消息content参数为空发文本消息content为必填参数且不能为空
*/
CODE_44004(44004, "文本消息content参数为空发文本消息content为必填参数且不能为空"),
/**
* 多媒体文件大小超过限制图片不可超过5M音频不可超过5M文件不可超过20M
*/
CODE_45001(45001, "多媒体文件大小超过限制图片不可超过5M音频不可超过5M文件不可超过20M"),
/**
* 消息内容大小超过限制
*/
CODE_45002(45002, "消息内容大小超过限制"),
/**
* 应用description参数长度不符合系统限制设置应用若带有description参数则长度必须为4至120个字符
*/
CODE_45004(45004, "应用description参数长度不符合系统限制设置应用若带有description参数则长度必须为4至120个字符"),
/**
* 语音播放时间超过限制语音播放时长不能超过60秒
*/
CODE_45007(45007, "语音播放时间超过限制语音播放时长不能超过60秒"),
/**
* 图文消息的文章数量不符合系统限制图文消息的文章数量不能超过8条
*/
CODE_45008(45008, "图文消息的文章数量不符合系统限制图文消息的文章数量不能超过8条"),
/**
* 接口调用超过限制
*/
CODE_45009(45009, "接口调用超过限制"),
/**
* 应用name参数长度不符合系统限制设置应用若带有name参数则不允许为空且不超过32个字符
*/
CODE_45022(45022, "应用name参数长度不符合系统限制设置应用若带有name参数则不允许为空且不超过32个字符"),
/**
* 帐号数量超过上限
*/
CODE_45024(45024, "帐号数量超过上限"),
/**
* 触发删除用户数的保护限制参考全量覆盖成员
*/
CODE_45026(45026, "触发删除用户数的保护;限制参考:全量覆盖成员"),
/**
* 图文消息author参数长度超过限制最长64个字节
*/
CODE_45032(45032, "图文消息author参数长度超过限制最长64个字节"),
/**
* 接口并发调用超过限制
*/
CODE_45033(45033, "接口并发调用超过限制"),
/**
* 菜单未设置菜单需发布后才能获取到数据
*/
CODE_46003(46003, "菜单未设置;菜单需发布后才能获取到数据"),
/**
* 指定的用户不存在需要确认指定的用户存在于通讯录中
*/
CODE_46004(46004, "指定的用户不存在;需要确认指定的用户存在于通讯录中"),
/**
* API接口无权限调用
*/
CODE_48002(48002, "API接口无权限调用"),
/**
* 不合法的suite_id确认suite_access_token由指定的suite_id生成
*/
CODE_48003(48003, "不合法的suite_id确认suite_access_token由指定的suite_id生成"),
/**
* 授权关系无效可能是无授权或授权已被取消
*/
CODE_48004(48004, "授权关系无效;可能是无授权或授权已被取消"),
/**
* API接口已废弃接口已不再支持建议改用新接口或者新方案
*/
CODE_48005(48005, "API接口已废弃接口已不再支持建议改用新接口或者新方案"),
/**
* redirect_url未登记可信域名
*/
CODE_50001(50001, "redirect_url未登记可信域名"),
/**
* 成员不在权限范围请检查应用或管理组的权限范围
*/
CODE_50002(50002, "成员不在权限范围;请检查应用或管理组的权限范围"),
/**
* 应用已禁用禁用的应用无法使用API接口可在管理端-企业应用启用应用
*/
CODE_50003(50003, "应用已禁用禁用的应用无法使用API接口。可在”管理端-企业应用”启用应用"),
/**
* 部门长度不符合限制部门名称不能为空且长度不能超过32个字
*/
CODE_60001(60001, "部门长度不符合限制部门名称不能为空且长度不能超过32个字"),
/**
* 部门ID不存在需要确认部门ID是否有带并且存在通讯录中
*/
CODE_60003(60003, "部门ID不存在需要确认部门ID是否有带并且存在通讯录中"),
/**
* 父部门不存在需要确认父亲部门ID是否有带并且存在通讯录中
*/
CODE_60004(60004, "父部门不存在需要确认父亲部门ID是否有带并且存在通讯录中"),
/**
* 部门下存在成员不允许删除有成员的部门
*/
CODE_60005(60005, "部门下存在成员;不允许删除有成员的部门"),
/**
* 部门下存在子部门不允许删除有子部门的部门
*/
CODE_60006(60006, "部门下存在子部门;不允许删除有子部门的部门"),
/**
* 不允许删除根部门
*/
CODE_60007(60007, "不允许删除根部门"),
/**
* 部门已存在部门ID或者部门名称已存在
*/
CODE_60008(60008, "部门已存在部门ID或者部门名称已存在"),
/**
* 部门名称含有非法字符不能含有 \\:?*< >| 等字符
*/
CODE_60009(60009, "部门名称含有非法字符;不能含有 \\ :?*“< >| 等字符"),
/**
* 部门存在循环关系
*/
CODE_60010(60010, "部门存在循环关系"),
/**
* 指定的成员/部门/标签参数无权限
*/
CODE_60011(60011, "指定的成员/部门/标签参数无权限"),
/**
* 不允许删除默认应用默认应用的id为0
*/
CODE_60012(60012, "不允许删除默认应用默认应用的id为0"),
/**
* 访问ip不在白名单之中请确认访问ip是否在服务商白名单IP列表
*/
CODE_60020(60020, "访问ip不在白名单之中请确认访问ip是否在服务商白名单IP列表"),
/**
* 不允许修改第三方应用的主页 URL第三方应用类型不允许通过接口修改该应用的主页 URL
*/
CODE_60028(60028, "不允许修改第三方应用的主页 URL第三方应用类型不允许通过接口修改该应用的主页 URL"),
/**
* UserID已存在
*/
CODE_60102(60102, "UserID已存在"),
/**
* 手机号码不合法长度不超过32位字符仅支持数字加号和减号
*/
CODE_60103(60103, "手机号码不合法长度不超过32位字符仅支持数字加号和减号"),
/**
* 手机号码已存在同一个企业内成员的手机号不能重复建议更换手机号或者更新已有的手机记录
*/
CODE_60104(60104, "手机号码已存在;同一个企业内,成员的手机号不能重复。建议更换手机号,或者更新已有的手机记录。"),
/**
* 邮箱不合法长度不超过64位且为有效的email格式
*/
CODE_60105(60105, "邮箱不合法长度不超过64位且为有效的email格式"),
/**
* 邮箱已存在同一个企业内成员的邮箱不能重复建议更换邮箱或者更新已有的邮箱记录
*/
CODE_60106(60106, "邮箱已存在;同一个企业内,成员的邮箱不能重复。建议更换邮箱,或者更新已有的邮箱记录。"),
/**
* 微信号不合法微信号格式由字母数字-_组成长度为 3-20 字节首字符必须是字母或-_
*/
CODE_60107(60107, "微信号不合法;微信号格式由字母、数字、”-“、”_“组成长度为 3-20 字节,首字符必须是字母或”-“或”_“"),
/**
* 用户所属部门数量超过限制用户同时归属部门不超过20个
*/
CODE_60110(60110, "用户所属部门数量超过限制用户同时归属部门不超过20个"),
/**
* UserID不存在UserID参数为空或者不存在通讯录中
*/
CODE_60111(60111, "UserID不存在UserID参数为空或者不存在通讯录中"),
/**
* 成员name参数不合法不能为空且不能超过64字符
*/
CODE_60112(60112, "成员name参数不合法不能为空且不能超过64字符"),
/**
* 无效的部门id部门不存在通讯录中
*/
CODE_60123(60123, "无效的部门id部门不存在通讯录中"),
/**
* 无效的父部门id父部门不存在通讯录中
*/
CODE_60124(60124, "无效的父部门id父部门不存在通讯录中"),
/**
* 非法部门名字不能为空且不能超过64字节且不能含有\\:*?< >|等字符
*/
CODE_60125(60125, "非法部门名字不能为空且不能超过64字节且不能含有\\:*?”< >|等字符"),
/**
* 缺少department参数
*/
CODE_60127(60127, "缺少department参数"),
/**
* 成员手机和邮箱都为空成员手机和邮箱至少有个非空
*/
CODE_60129(60129, "成员手机和邮箱都为空;成员手机和邮箱至少有个非空"),
/**
* 发票已被其他公众号锁定
*/
CODE_72023(72023, "发票已被其他公众号锁定"),
/**
* 发票状态错误reimburse_status状态错误参考更新发票状态
*/
CODE_72024(72024, "发票状态错误reimburse_status状态错误参考更新发票状态"),
/**
* 存在发票不属于该用户只能批量更新该openid的发票参考批量更新发票状态
*/
CODE_72037(72037, "存在发票不属于该用户只能批量更新该openid的发票参考批量更新发票状态"),
/**
* 可信域名不正确或者无ICP备案
*/
CODE_80001(80001, "可信域名不正确或者无ICP备案"),
/**
* 部门下的结点数超过限制3W
*/
CODE_81001(81001, "部门下的结点数超过限制3W"),
/**
* 部门最多15层
*/
CODE_81002(81002, "部门最多15层"),
/**
* 无权限操作标签
*/
CODE_81011(81011, "无权限操作标签"),
/**
* UserID部门ID标签ID全部非法或无权限
*/
CODE_81013(81013, "UserID、部门ID、标签ID全部非法或无权限"),
/**
* 标签添加成员单次添加user或party过多
*/
CODE_81014(81014, "标签添加成员单次添加user或party过多"),
/**
* 指定的成员/部门/标签全部无效
*/
CODE_82001(82001, "指定的成员/部门/标签全部无效"),
/**
* 不合法的PartyID列表长度发消息单次不能超过100个部门
*/
CODE_82002(82002, "不合法的PartyID列表长度发消息单次不能超过100个部门"),
/**
* 不合法的TagID列表长度发消息单次不能超过100个标签
*/
CODE_82003(82003, "不合法的TagID列表长度发消息单次不能超过100个标签"),
/**
* 成员票据过期
*/
CODE_84014(84014, "成员票据过期"),
/**
* 成员票据无效确认user_ticket参数来源是否正确参考接口根据code获取成员信息
*/
CODE_84015(84015, "成员票据无效确认user_ticket参数来源是否正确。参考接口根据code获取成员信息"),
/**
* 缺少templateid参数
*/
CODE_84019(84019, "缺少templateid参数"),
/**
* templateid不存在确认参数是否有带并且已创建
*/
CODE_84020(84020, "templateid不存在确认参数是否有带并且已创建"),
/**
* 缺少register_code参数
*/
CODE_84021(84021, "缺少register_code参数"),
/**
* 无效的register_code参数
*/
CODE_84022(84022, "无效的register_code参数"),
/**
* 不允许调用设置通讯录同步完成接口
*/
CODE_84023(84023, "不允许调用设置通讯录同步完成接口"),
/**
* 无注册信息
*/
CODE_84024(84024, "无注册信息"),
/**
* 不符合的state参数必须是[a-zA-Z0-9]的参数值长度不可超过128个字节
*/
CODE_84025(84025, "不符合的state参数必须是[a-zA-Z0-9]的参数值长度不可超过128个字节"),
/**
* 包含不合法的词语
*/
CODE_85002(85002, "包含不合法的词语"),
/**
* 每企业每个月设置的可信域名不可超过20个
*/
CODE_85004(85004, "每企业每个月设置的可信域名不可超过20个"),
/**
* 可信域名未通过所有权校验
*/
CODE_85005(85005, "可信域名未通过所有权校验"),
/**
* 参数 chatid 不合法
*/
CODE_86001(86001, "参数 chatid 不合法"),
/**
* 参数 chatid 不存在
*/
CODE_86003(86003, "参数 chatid 不存在"),
/**
* 参数 群名不合法
*/
CODE_86004(86004, "参数 群名不合法"),
/**
* 参数 群主不合法
*/
CODE_86005(86005, "参数 群主不合法"),
/**
* 群成员数过多或过少
*/
CODE_86006(86006, "群成员数过多或过少"),
/**
* 不合法的群成员
*/
CODE_86007(86007, "不合法的群成员"),
/**
* 非法操作非自己创建的群
*/
CODE_86008(86008, "非法操作非自己创建的群"),
/**
* 存在非法会话成员ID
*/
CODE_86216(86216, "存在非法会话成员ID"),
/**
* 会话发送者不在会话成员列表中会话的发送者必须是会话的成员列表之一
*/
CODE_86217(86217, "会话发送者不在会话成员列表中;会话的发送者,必须是会话的成员列表之一"),
/**
* 指定的会话参数不合法
*/
CODE_86220(86220, "指定的会话参数不合法"),
/**
* 未认证摇一摇周边
*/
CODE_90001(90001, "未认证摇一摇周边"),
/**
* 缺少摇一摇周边ticket参数
*/
CODE_90002(90002, "缺少摇一摇周边ticket参数"),
/**
* 摇一摇周边ticket参数不合法
*/
CODE_90003(90003, "摇一摇周边ticket参数不合法"),
/**
* 非法的对外属性类型
*/
CODE_90100(90100, "非法的对外属性类型"),
/**
* 对外属性文本类型长度不合法文本长度不可超过12个UTF8字符
*/
CODE_90101(90101, "对外属性文本类型长度不合法文本长度不可超过12个UTF8字符"),
/**
* 对外属性网页类型标题长度不合法标题长度不可超过12个UTF8字符
*/
CODE_90102(90102, "对外属性网页类型标题长度不合法标题长度不可超过12个UTF8字符"),
/**
* 对外属性网页url不合法
*/
CODE_90103(90103, "对外属性网页url不合法"),
/**
* 对外属性小程序类型标题长度不合法标题长度不可超过12个UTF8字符
*/
CODE_90104(90104, "对外属性小程序类型标题长度不合法标题长度不可超过12个UTF8字符"),
/**
* 对外属性小程序类型pagepath不合法
*/
CODE_90105(90105, "对外属性小程序类型pagepath不合法"),
/**
* 对外属性请求参数不合法
*/
CODE_90106(90106, "对外属性:请求参数不合法"),
/**
* 获取ticket的类型无效
*/
CODE_91040(91040, "获取ticket的类型无效"),
/**
* 无权限操作指定的应用
*/
CODE_301002(301002, "无权限操作指定的应用"),
/**
* 不允许删除创建者创建者不允许从通讯录中删除如果需要删除该成员需要先在WEB管理端转移创建者身份
*/
CODE_301005(301005, "不允许删除创建者创建者不允许从通讯录中删除。如果需要删除该成员需要先在WEB管理端转移创建者身份。"),
/**
* 参数 position 不合法长度不允许超过128个字符
*/
CODE_301012(301012, "参数 position 不合法长度不允许超过128个字符"),
/**
* 参数 telephone 不合法telephone必须由1-32位的纯数字或-号组成
*/
CODE_301013(301013, "参数 telephone 不合法telephone必须由1-32位的纯数字或-‘号组成。"),
/**
* 参数 english_name 不合法参数如果有传递不允许为空字符串同时不能超过64字节只能是由字母数字(.)减号(-)空格或下划线(_)组成
*/
CODE_301014(301014, "参数 english_name 不合法参数如果有传递不允许为空字符串同时不能超过64字节只能是由字母、数字、点(.)、减号(-)、空格或下划线(_)组成"),
/**
* 参数 mediaid 不合法请检查 mediaid 来源应该通过上传临时素材的图片类型获得mediaid
*/
CODE_301015(301015, "参数 mediaid 不合法;请检查 mediaid 来源应该通过上传临时素材的图片类型获得mediaid"),
/**
* 上传语音文件不符合系统要求语音文件的系统限制参考上传的媒体文件限制
*/
CODE_301016(301016, "上传语音文件不符合系统要求;语音文件的系统限制,参考上传的媒体文件限制"),
/**
* 上传语音文件仅支持AMR格式语音文件的系统限制参考上传的媒体文件限制
*/
CODE_301017(301017, "上传语音文件仅支持AMR格式语音文件的系统限制参考上传的媒体文件限制"),
/**
* 参数 userid 无效至少有一个userid不存在于通讯录中
*/
CODE_301021(301021, "参数 userid 无效至少有一个userid不存在于通讯录中"),
/**
* 获取打卡数据失败系统失败可重试处理
*/
CODE_301022(301022, "获取打卡数据失败;系统失败,可重试处理"),
/**
* useridlist非法或超过限额列表数量不能为0且不超过100
*/
CODE_301023(301023, "useridlist非法或超过限额列表数量不能为0且不超过100"),
/**
* 获取打卡记录时间间隔超限保证开始时间大于0 且结束时间大于 0 且结束时间大于开始时间且间隔少于93天
*/
CODE_301024(301024, "获取打卡记录时间间隔超限保证开始时间大于0 且结束时间大于 0 且结束时间大于开始时间且间隔少于93天"),
/**
* 不允许更新该用户的userid
*/
CODE_301036(301036, "不允许更新该用户的userid"),
/**
* 批量导入任务的文件中userid有重复
*/
CODE_302003(302003, "批量导入任务的文件中userid有重复"),
/**
* 组织架构不合法1不是一棵树2 多个一样的partyid3 partyid空4 partyid name 5 同一个父节点下有两个子节点 部门名字一样 可能是以上情况请一一排查
*/
CODE_302004(302004, "组织架构不合法1不是一棵树2 多个一样的partyid3 partyid空4 partyid name 空5 同一个父节点下有两个子节点 部门名字一样 可能是以上情况,请一一排查)"),
/**
* 批量导入系统失败请重新尝试导入
*/
CODE_302005(302005, "批量导入系统失败,请重新尝试导入"),
/**
* 批量导入任务的文件中partyid有重复
*/
CODE_302006(302006, "批量导入任务的文件中partyid有重复"),
/**
* 批量导入任务的文件中同一个部门下有两个子部门名字一样
*/
CODE_302007(302007, "批量导入任务的文件中,同一个部门下有两个子部门名字一样"),
/**
* CorpId参数无效指定的CorpId不存在
*/
CODE_2000002(2000002, "CorpId参数无效指定的CorpId不存在");
private int code;
private String msg;
WxCpErrorMsgEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
/**
* 通过错误代码查找其中文含义.
*/
public static String findMsgByCode(int code) {
WxCpErrorMsgEnum[] values = WxCpErrorMsgEnum.values();
for (WxCpErrorMsgEnum value : values) {
if (value.code == code) {
return value.msg;
}
}
return null;
}
}

View File

@ -0,0 +1,78 @@
package me.chanjar.weixin.common.error;
import lombok.Builder;
import lombok.Data;
import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
/**
* 微信错误码.
* 请阅读
* 公众平台<a href="http://mp.weixin.qq.com/wiki/10/6380dc743053a91c544ffd2b7c959166.html">全局返回码说明</a>
* 企业微信<a href="https://work.weixin.qq.com/api/doc#10649">全局错误码</a>
*
* @author Daniel Qian & Binary Wang
*/
@Data
@Builder
public class WxError implements Serializable {
private static final long serialVersionUID = 7869786563361406291L;
/**
* 微信错误代码
*/
private int errorCode;
/**
* 微信错误信息如果可以翻译为中文就为中文
*/
private String errorMsg;
/**
* 微信接口返回的错误原始信息英文
*/
private String errorMsgEn;
private String json;
public static WxError fromJson(String json) {
return fromJson(json, null);
}
public static WxError fromJson(String json, WxType type) {
final WxError wxError = WxGsonBuilder.create().fromJson(json, WxError.class);
if (StringUtils.isNotEmpty(wxError.getErrorMsgEn())) {
wxError.setErrorMsgEn(wxError.getErrorMsg());
}
if (type == null) {
return wxError;
}
if (type == WxType.MP) {
final String msg = WxMpErrorMsgEnum.findMsgByCode(wxError.getErrorCode());
if (msg != null) {
wxError.setErrorMsg(msg);
}
} else if (type == WxType.CP) {
final String msg = WxCpErrorMsgEnum.findMsgByCode(wxError.getErrorCode());
if (msg != null) {
wxError.setErrorMsg(msg);
}
}
return wxError;
}
@Override
public String toString() {
if (this.json != null) {
return this.json;
}
return "错误: Code=" + this.errorCode + ", Msg=" + this.errorMsg;
}
}

View File

@ -1,9 +1,9 @@
package me.chanjar.weixin.common.exception;
import me.chanjar.weixin.common.bean.result.WxError;
package me.chanjar.weixin.common.error;
/**
* @author Daniel Qian
*/
public class WxErrorException extends Exception {
private static final long serialVersionUID = -6357149550353160810L;
private WxError error;

View File

@ -1,18 +1,18 @@
package me.chanjar.weixin.mp.constant;
package me.chanjar.weixin.common.error;
import lombok.Getter;
/**
* <pre>
* 微信公众平台错误代码
* 参考文档https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433747234
* 微信公众平台全局返回码.
* 参考文档<a href="http://mp.weixin.qq.com/wiki/10/6380dc743053a91c544ffd2b7c959166.html">公众平台全局返回码</a>
* Created by Binary Wang on 2018/5/13.
* </pre>
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Getter
public enum WxMpErrorMsg {
public enum WxMpErrorMsgEnum {
/**
* 系统繁忙此时请开发者稍候再试
*/
@ -633,7 +633,7 @@ public enum WxMpErrorMsg {
private int code;
private String msg;
WxMpErrorMsg(int code, String msg) {
WxMpErrorMsgEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
@ -641,9 +641,9 @@ public enum WxMpErrorMsg {
/**
* 通过错误代码查找其中文含义.
*/
public String findMsgByCode(int code) {
WxMpErrorMsg[] values = WxMpErrorMsg.values();
for (WxMpErrorMsg value : values) {
public static String findMsgByCode(int code) {
WxMpErrorMsgEnum[] values = WxMpErrorMsgEnum.values();
for (WxMpErrorMsgEnum value : values) {
if (value.code == code) {
return value.msg;
}

View File

@ -1,21 +1,17 @@
package me.chanjar.weixin.common.util;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import me.chanjar.weixin.common.annotation.Required;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* <pre>

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.util;
import me.chanjar.weixin.common.api.WxErrorExceptionHandler;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.util.http;
import jodd.http.HttpResponse;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import okhttp3.Response;
import org.apache.http.Header;
import org.apache.http.client.methods.CloseableHttpResponse;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.common.util.http;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.io.IOException;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.util.http.apache;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;
import org.apache.http.HttpHost;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.util.http.apache;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.fs.FileUtils;
import me.chanjar.weixin.common.util.http.HttpResponseProxy;
import me.chanjar.weixin.common.util.http.BaseMediaDownloadRequestExecutor;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.util.http.apache;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import org.apache.http.HttpEntity;
@ -10,7 +10,6 @@ import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.util.http.apache;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
import org.apache.http.Consts;

View File

@ -5,8 +5,8 @@ import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
import jodd.util.StringPool;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.fs.FileUtils;
import me.chanjar.weixin.common.util.http.HttpResponseProxy;
import me.chanjar.weixin.common.util.http.BaseMediaDownloadRequestExecutor;

View File

@ -6,9 +6,9 @@ import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
import jodd.util.StringPool;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;

View File

@ -3,8 +3,8 @@ package me.chanjar.weixin.common.util.http.jodd;
import jodd.http.*;
import jodd.util.StringPool;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;

View File

@ -5,8 +5,8 @@ import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
import jodd.util.StringPool;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.util.http.okhttp;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.BaseMediaDownloadRequestExecutor;
import me.chanjar.weixin.common.util.http.HttpResponseProxy;
import me.chanjar.weixin.common.util.http.RequestHttp;

View File

@ -1,8 +1,8 @@
package me.chanjar.weixin.common.util.http.okhttp;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import okhttp3.*;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.util.http.okhttp;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;
import okhttp3.*;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.util.http.okhttp;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
import okhttp3.*;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.common.util.json;
import com.google.gson.*;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.error.WxError;
import java.lang.reflect.Type;

View File

@ -4,7 +4,7 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
public class WxGsonBuilder {

View File

@ -1,8 +1,9 @@
package me.chanjar.weixin.common.bean;
package me.chanjar.weixin.common.error;
import me.chanjar.weixin.common.bean.result.WxError;
import org.testng.*;
import org.testng.annotations.*;
import org.testng.Assert;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
@Test
public class WxErrorTest {
@ -10,26 +11,24 @@ public class WxErrorTest {
public void testFromJson() {
String json = "{ \"errcode\": 40003, \"errmsg\": \"invalid openid\" }";
WxError wxError = WxError.fromJson(json);
Assert.assertTrue(wxError.getErrorCode() == 40003);
Assert.assertEquals(wxError.getErrorMsg(), "invalid openid");
assertEquals(40003, wxError.getErrorCode());
assertEquals(wxError.getErrorMsg(), "invalid openid");
}
public void testFromBadJson1() {
String json = "{ \"errcode\": 40003, \"errmsg\": \"invalid openid\", \"media_id\": \"12323423dsfafsf232f\" }";
WxError wxError = WxError.fromJson(json);
Assert.assertTrue(wxError.getErrorCode() == 40003);
Assert.assertEquals(wxError.getErrorMsg(), "invalid openid");
assertEquals(40003, wxError.getErrorCode());
assertEquals(wxError.getErrorMsg(), "invalid openid");
}
public void testFromBadJson2() {
String json = "{\"access_token\":\"ACCESS_TOKEN\",\"expires_in\":7200}";
WxError wxError = WxError.fromJson(json);
Assert.assertTrue(wxError.getErrorCode() == 0);
Assert.assertEquals(wxError.getErrorMsg(), null);
assertEquals(0, wxError.getErrorCode());
assertEquals(wxError.getErrorMsg(), null);
}

View File

@ -1,8 +1,7 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpAgent;
import me.chanjar.weixin.cp.bean.WxCpDepart;
/**
* <pre>

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpDepart;
import java.util.List;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.io.File;
import java.io.IOException;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* <pre>

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpUserDetail;
/**

View File

@ -1,9 +1,7 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSession;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
@ -12,11 +10,6 @@ import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.cp.bean.*;
import me.chanjar.weixin.cp.config.WxCpConfigStorage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
* 微信API的Service
* @author chanjaster

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpTag;
import me.chanjar.weixin.cp.bean.WxCpTagAddOrRemoveUsersResult;
import me.chanjar.weixin.cp.bean.WxCpTagGetResult;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpInviteResult;
import me.chanjar.weixin.cp.bean.WxCpUser;

View File

@ -1,16 +1,9 @@
package me.chanjar.weixin.cp.api.impl;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpAgentService;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpAgent;
import me.chanjar.weixin.cp.bean.WxCpDepart;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.util.List;
/**

View File

@ -3,7 +3,7 @@ package me.chanjar.weixin.cp.api.impl;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.json.GsonHelper;
import me.chanjar.weixin.cp.api.WxCpDepartmentService;
import me.chanjar.weixin.cp.api.WxCpService;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.cp.api.impl;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.fs.FileUtils;
import me.chanjar.weixin.common.util.http.BaseMediaDownloadRequestExecutor;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.cp.api.impl;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpMenuService;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

View File

@ -4,7 +4,7 @@ import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.URIUtil;
import me.chanjar.weixin.common.util.json.GsonHelper;
import me.chanjar.weixin.cp.api.WxCpOAuth2Service;

View File

@ -5,8 +5,8 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.StandardSessionManager;
import me.chanjar.weixin.common.session.WxSession;
import me.chanjar.weixin.common.session.WxSessionManager;

View File

@ -1,9 +1,10 @@
package me.chanjar.weixin.cp.api.impl;
import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
@ -58,7 +59,7 @@ public class WxCpServiceApacheHttpClientImpl extends WxCpServiceAbstractImpl<Clo
} finally {
httpGet.releaseConnection();
}
WxError error = WxError.fromJson(resultContent);
WxError error = WxError.fromJson(resultContent, WxType.CP);
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);
}

View File

@ -1,9 +1,10 @@
package me.chanjar.weixin.cp.api.impl;
import jodd.http.*;
import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.cp.config.WxCpConfigStorage;
@ -44,7 +45,7 @@ public class WxCpServiceJoddHttpImpl extends WxCpServiceAbstractImpl<HttpConnect
HttpResponse response = request.send();
String resultContent = response.bodyText();
WxError error = WxError.fromJson(resultContent);
WxError error = WxError.fromJson(resultContent, WxType.CP);
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);
}

View File

@ -1,8 +1,9 @@
package me.chanjar.weixin.cp.api.impl;
import me.chanjar.weixin.common.WxType;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.common.util.http.okhttp.OkHttpProxyInfo;
import me.chanjar.weixin.cp.config.WxCpConfigStorage;
@ -51,7 +52,7 @@ public class WxCpServiceOkHttpImpl extends WxCpServiceAbstractImpl<OkHttpClient,
this.log.error(e.getMessage(), e);
}
WxError error = WxError.fromJson(resultContent);
WxError error = WxError.fromJson(resultContent, WxType.CP);
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);
}

View File

@ -2,7 +2,7 @@ package me.chanjar.weixin.cp.api.impl;
import com.google.gson.*;
import com.google.gson.reflect.TypeToken;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.api.WxCpTagService;
import me.chanjar.weixin.cp.bean.WxCpTag;

View File

@ -3,7 +3,7 @@ package me.chanjar.weixin.cp.api.impl;
import com.google.common.collect.Maps;
import com.google.gson.*;
import com.google.gson.reflect.TypeToken;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.api.WxCpUserService;
import me.chanjar.weixin.cp.bean.WxCpInviteResult;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.message;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpXmlMessage;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.message;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpXmlMessage;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.cp.message;
import me.chanjar.weixin.common.api.WxErrorExceptionHandler;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpXmlMessage;

View File

@ -3,7 +3,7 @@ package me.chanjar.weixin.cp.util.json;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.util.json.WxErrorAdapter;
import me.chanjar.weixin.cp.bean.WxCpDepart;
import me.chanjar.weixin.cp.bean.WxCpMessage;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.cp.api;
import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
import me.chanjar.weixin.cp.config.WxCpConfigStorage;
import org.apache.commons.lang3.StringUtils;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.cp.api;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
import org.testng.annotations.DataProvider;

View File

@ -2,7 +2,7 @@ package me.chanjar.weixin.cp.api;
import com.google.inject.Inject;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpMessage;
import me.chanjar.weixin.cp.bean.WxCpMessageSendResult;
import org.testng.annotations.*;

View File

@ -3,7 +3,7 @@ package me.chanjar.weixin.cp.api.impl;
import com.google.inject.Inject;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.ApiTestModule;
import me.chanjar.weixin.cp.api.TestConstants;
import me.chanjar.weixin.cp.api.WxCpService;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.cp.api.impl;
import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.ApiTestModule;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpUserDetail;

View File

@ -2,7 +2,7 @@ package me.chanjar.weixin.cp.api.impl;
import com.google.common.base.Splitter;
import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.ApiTestModule;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.api.WxCpTagService;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.cp.demo;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpService;
import javax.servlet.http.HttpServlet;

View File

@ -6,7 +6,7 @@ import cn.binarywang.wx.miniapp.bean.analysis.WxMaUserPortrait;
import cn.binarywang.wx.miniapp.bean.analysis.WxMaVisitDistribution;
import cn.binarywang.wx.miniapp.bean.analysis.WxMaVisitPage;
import cn.binarywang.wx.miniapp.bean.analysis.WxMaVisitTrend;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.util.Date;
import java.util.List;

View File

@ -5,7 +5,7 @@ import cn.binarywang.wx.miniapp.bean.code.WxMaCodeAuditStatus;
import cn.binarywang.wx.miniapp.bean.code.WxMaCodeCommitRequest;
import cn.binarywang.wx.miniapp.bean.code.WxMaCodeSubmitAuditRequest;
import cn.binarywang.wx.miniapp.bean.code.WxMaCodeVersionDistribution;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.util.List;

View File

@ -1,7 +1,7 @@
package cn.binarywang.wx.miniapp.api;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.io.File;
import java.io.InputStream;

View File

@ -2,7 +2,7 @@ package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.WxMaKefuMessage;
import cn.binarywang.wx.miniapp.bean.WxMaTemplateMessage;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* <pre>

View File

@ -1,7 +1,7 @@
package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.WxMaCodeLineColor;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.io.File;

View File

@ -2,7 +2,7 @@ package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.config.WxMaConfig;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;

View File

@ -1,7 +1,7 @@
package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.WxMaDomainAction;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* 小程序修改服务器地址成员管理 API大部分只能是第三方平台调用

View File

@ -4,7 +4,7 @@ import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateAddResult;
import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateLibraryGetResult;
import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateLibraryListResult;
import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateListResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.util.List;

View File

@ -3,7 +3,7 @@ package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* 用户信息相关操作接口.

View File

@ -12,7 +12,7 @@ import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.lang.reflect.Type;

View File

@ -11,8 +11,8 @@ import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.BaseMediaDownloadRequestExecutor;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.json.GsonHelper;

View File

@ -2,9 +2,9 @@ package cn.binarywang.wx.miniapp.api.impl;
import cn.binarywang.wx.miniapp.api.WxMaMediaService;
import cn.binarywang.wx.miniapp.api.WxMaService;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.fs.FileUtils;
import me.chanjar.weixin.common.util.http.BaseMediaDownloadRequestExecutor;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;

View File

@ -7,8 +7,8 @@ import cn.binarywang.wx.miniapp.bean.WxMaTemplateMessage;
import cn.binarywang.wx.miniapp.constant.WxMaConstants;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>

View File

@ -7,7 +7,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaQrcode;
import cn.binarywang.wx.miniapp.bean.WxMaWxcode;
import cn.binarywang.wx.miniapp.bean.WxaCodeUnlimit;
import cn.binarywang.wx.miniapp.util.http.QrCodeRequestExecutor;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.io.File;

View File

@ -11,11 +11,10 @@ import cn.binarywang.wx.miniapp.api.WxMaTemplateService;
import cn.binarywang.wx.miniapp.api.WxMaUserService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.config.WxMaConfig;
import cn.binarywang.wx.miniapp.constant.WxMaConstants;
import com.google.common.base.Joiner;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.DataUtils;
import me.chanjar.weixin.common.util.crypto.SHA1;
import me.chanjar.weixin.common.util.http.HttpType;
@ -25,7 +24,6 @@ import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
@ -40,7 +38,6 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.Lock;
import static cn.binarywang.wx.miniapp.constant.WxMaConstants.*;
import static cn.binarywang.wx.miniapp.constant.WxMaConstants.ErrorCode.*;
/**

View File

@ -4,7 +4,7 @@ import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.WxMaSettingService;
import cn.binarywang.wx.miniapp.bean.WxMaDomainAction;
import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import java.util.HashMap;
import java.util.Map;

View File

@ -6,8 +6,8 @@ import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateAddResult;
import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateLibraryGetResult;
import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateLibraryListResult;
import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateListResult;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import java.util.HashMap;

View File

@ -8,7 +8,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
/**
* @author <a href="https://github.com/binarywang">Binary Wang</a>

View File

@ -2,7 +2,7 @@ package cn.binarywang.wx.miniapp.message;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaMessage;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import java.util.Map;

View File

@ -2,7 +2,7 @@ package cn.binarywang.wx.miniapp.message;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaMessage;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import java.util.Map;

View File

@ -3,7 +3,7 @@ package cn.binarywang.wx.miniapp.message;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaMessage;
import me.chanjar.weixin.common.api.WxErrorExceptionHandler;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import java.util.ArrayList;

View File

@ -1,8 +1,8 @@
package cn.binarywang.wx.miniapp.util.http;
import cn.binarywang.wx.miniapp.bean.AbstractWxMaQrcodeWrapper;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.fs.FileUtils;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;

View File

@ -4,7 +4,7 @@ import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.test.ApiTestModule;
import com.google.inject.Inject;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;

View File

@ -7,7 +7,7 @@ import cn.binarywang.wx.miniapp.test.ApiTestModule;
import cn.binarywang.wx.miniapp.test.TestConfig;
import com.google.common.collect.Lists;
import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import org.testng.annotations.*;
import java.text.SimpleDateFormat;

View File

@ -4,7 +4,7 @@ import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.config.WxMaConfig;
import cn.binarywang.wx.miniapp.test.ApiTestModule;
import com.google.inject.Inject;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.StringUtils;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;

View File

@ -12,7 +12,7 @@ import cn.binarywang.wx.miniapp.message.WxMaMessageRouter;
import cn.binarywang.wx.miniapp.test.TestConfig;
import com.google.common.collect.Lists;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.bean.WxCardApiSignature;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.result.WxMpCardResult;
/**

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.datacube.*;
import java.util.Date;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.device.*;
/**

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
import me.chanjar.weixin.mp.bean.kefu.request.WxMpKfAccountRequest;
import me.chanjar.weixin.mp.bean.kefu.result.*;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.*;
import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult;
import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.material.*;
import java.io.File;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.membercard.WxMpMemberCardActivatedMessage;
import me.chanjar.weixin.mp.bean.membercard.WxMpMemberCardUpdateMessage;
import me.chanjar.weixin.mp.bean.membercard.WxMpMemberCardUpdateResult;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.bean.menu.WxMenu;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.menu.WxMpGetSelfMenuInfoResult;
import me.chanjar.weixin.mp.bean.menu.WxMpMenu;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.api.WxErrorExceptionHandler;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
import java.io.File;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;

View File

@ -1,7 +1,7 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.WxMpShakeInfoResult;
import me.chanjar.weixin.mp.bean.WxMpShakeQuery;
import me.chanjar.weixin.mp.bean.shake.*;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.store.WxMpStoreBaseInfo;
import me.chanjar.weixin.mp.bean.store.WxMpStoreInfo;
import me.chanjar.weixin.mp.bean.store.WxMpStoreListResult;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.subscribe.WxMpSubscribeMessage;
/**

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.template.WxMpTemplate;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateIndustry;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;

View File

@ -1,6 +1,6 @@
package me.chanjar.weixin.mp.api;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.result.WxMpUserBlacklistGetResult;
import java.util.List;

Some files were not shown because too many files have changed in this diff Show More