第一次提交

This commit is contained in:
wyw
2024-08-08 00:31:26 +08:00
commit c202e2b63d
1819 changed files with 221890 additions and 0 deletions

View File

@ -0,0 +1,72 @@
package com.fastbee.common.wechat;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
/**
* WeChat 调用api接口获取openid登信息后的返回类
* @author fastb
* @date 2023-07-31 11:43
*/
@Data
public class WeChatAppResult {
/**
* 接口调用凭证
*/
@JSONField(name = "access_token")
private String accessToken;
/**
* access_token 接口调用凭证超时时间,单位(秒)
*/
@JSONField(name = "expires_in")
private Long expiresIn;
/**
* 用户刷新 access_token
*/
@JSONField(name = "refresh_token")
private String refreshToken;
/**
* 授权用户唯一标识
*/
@JSONField(name = "openid")
private String openId;
/**
* 用户授权的作用域snsapi_userinfo
*/
@JSONField(name = "scope")
private String scope;
/**
* 当且仅当该移动应用已获得该用户的 userinfo 授权时,才会出现该字段
*/
@JSONField(name = "unionid")
private String unionId;
/**
* 错误码
*/
@JSONField(name = "errcode")
private Integer errCode;
/**
* 错误信息
*/
@JSONField(name = "errmsg")
private String errMsg;
/**
* 是否绑定手机号
*/
private Boolean isBind;
/**
* token 自定义登录状态
*/
private String token;
}

View File

@ -0,0 +1,89 @@
package com.fastbee.common.wechat;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 微信端登录参数
* @author fastb
* @date 2023-07-31 11:32
*/
@Data
@Accessors(chain = true)
public class WeChatLoginBody {
/**
* 传入参数:临时登录凭证
*/
private String code;
/**
* 临时获取用户手机号凭证
*/
private String phoneCode;
/**
* 传入参数 openid
*/
private String openId;
/**
* 传入参数 session_key
*/
private String sessionKey;
/**
* 传入参数 unionid
*/
private String unionId;
/**
* 传入参数: 用户非敏感信息
*/
private String rawData;
/**
* 传入参数: 签名
*/
private String signature;
/**
* 传入参数: 用户敏感信息
*/
private String encryptedData;
/**
* 传入参数: 解密算法的向量
*/
private String iv;
/**
* 用户手机号
*/
private String userPhone;
/**
* 用户密码
*/
private String userPwd;
/**
* 接口调用凭证
*/
private String accessToken;
/**
* access_token 接口调用凭证超时时间,单位(秒)
*/
private Long expiresIn;
/**
* 用户刷新 access_token
*/
private String refreshToken;
/**
* 用户授权的作用域snsapi_userinfo
*/
private String scope;
}

View File

@ -0,0 +1,22 @@
package com.fastbee.common.wechat;
import lombok.Data;
/**
* 微信登录返回结果
* @author fastb
* @date 2023-08-15 16:43
*/
@Data
public class WeChatLoginResult {
/**
* 登录成功返回token
*/
private String token;
/**
* 绑定账号跳转页面
*/
private String bindId;
}

View File

@ -0,0 +1,42 @@
package com.fastbee.common.wechat;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
/**
* @author fastb
* @date 2023-08-14 10:07
*/
@Data
public class WeChatMiniProgramResult {
/**
* 会话密钥
*/
@JSONField(name = "session_key")
private String sessionKey;
/**
* 用户在开放平台的唯一标识符,若当前小程序已绑定到微信开放平台账号下会返回,详见 UnionID 机制说明
*/
@JSONField(name = "unionid")
private String unionId;
/**
* 错误信息
*/
@JSONField(name = "errmsg")
private String errMsg;
/**
* 用户唯一标识
*/
@JSONField(name = "openid")
private String openId;
/**
* 错误码
*/
@JSONField(name = "errcode")
private String errCode;
}

View File

@ -0,0 +1,41 @@
package com.fastbee.common.wechat;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
/**
* @author fastb
* @date 2023-08-16 17:48
*/
@Data
public class WeChatPhoneInfo {
@JSONField(name = "errcode")
private String errCode;
@JSONField(name = "errmsg")
private String errmsg;
@JSONField(name = "phone_info")
private PhoneInfo phoneInfo;
@Data
public class PhoneInfo {
private String phoneNumber;
private String purePhoneNumber;
private String countryCode;
private WaterMark watermark;
}
@Data
class WaterMark {
private String timestamp;
private String appid;
}
}

View File

@ -0,0 +1,80 @@
package com.fastbee.common.wechat;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
/**
* 微信用户信息
* @author fastb
* @date 2023-07-31 14:56
*/
@Data
public class WeChatUserInfo {
/**
* 普通用户的标识,对当前开发者账号唯一
*/
@JSONField(name = "openid")
private String openId;
/**
* 普通用户昵称
*/
@JSONField(name = "nickname")
private String nickname;
/**
* 普通用户性别1 为男性2 为女性
*/
@JSONField(name = "sex")
private Integer sex;
/**
* 普通用户个人资料填写的省份
*/
@JSONField(name = "province")
private String province;
/**
* 普通用户个人资料填写的城市
*/
@JSONField(name = "city")
private String city;
/**
* 国家,如中国为 CN
*/
@JSONField(name = "country")
private String country;
/**
* 用户头像,最后一个数值代表正方形头像大小(有 0、46、64、96、132 数值可选0 代表 640*640 正方形头像),用户没有头像时该项为空
*/
@JSONField(name = "headimgurl")
private String headImgUrl;
/**
* 用户特权信息json 数组如微信沃卡用户为chinaunicom
*/
@JSONField(name = "privilege")
private String privilege;
/**
* 用户统一标识。针对一个微信开放平台账号下的应用,同一用户的 unionid 是唯一的。
*/
@JSONField(name = "unionid")
private String unionId;
/**
* 错误码
*/
@JSONField(name = "errcode")
private Integer errCode;
/**
* 错误信息
*/
@JSONField(name = "errmsg")
private String errMsg;
}

View File

@ -0,0 +1,67 @@
package com.fastbee.common.wechat;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
/**
* 微信回调的时候入参XML解析节点封装BO
* @author fastb
* @date 2024-03-12 15:24
* @version 1.0
*/
@Data
public class WxCallBackXmlBO {
@JSONField(name = "MsgType")
private String msgType;
@JSONField(name = "FromUserName")
private String fromUserName;
@JSONField(name = "ToUserName")
private String toUserName;
@JSONField(name = "CreateTime")
private String createTime;
@JSONField(name = "Content")
private String content;
@JSONField(name = "MsgId")
private String msgId;
@JSONField(name = "Event")
private String event;
@JSONField(name = "EventKey")
private String eventKey;
@JSONField(name = "Ticket")
private String ticket;
@JSONField(name = "UnionId")
private String unionId;
@JSONField(name = "Recognition")
private String recognition;
@JSONField(name = "PicUrl")
private String picUrl;
@JSONField(name = "SuccessOrderId")
private String successOrderId;
@JSONField(name = "CardId")
private String cardId;
@JSONField(name = "UserCardCode")
private String userCardCode;
@JSONField(name = "LocationX")
private String locationX;
@JSONField(name = "LocationY")
private String locationY;
}