mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
🎨 优化部分代码,重构OAuth2网页授权、网页登录等相关接口,方便接入open模块
This commit is contained in:
@@ -2,7 +2,6 @@ package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpResult;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -10,8 +9,7 @@ import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class WxMpCardCodeCheckcodeResult extends WxMpResult implements Serializable {
|
||||
|
||||
public class WxMpCardCodeCheckcodeResult implements Serializable {
|
||||
private static final long serialVersionUID = -5128692403997016750L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,15 +2,16 @@ package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpResult;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author S <sshzh90@gmail.com>
|
||||
*/
|
||||
@Data
|
||||
public class WxMpCardCodeDepositCountResult extends WxMpResult implements Serializable {
|
||||
|
||||
public class WxMpCardCodeDepositCountResult implements Serializable {
|
||||
private static final long serialVersionUID = -6707587956061215868L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,15 +2,16 @@ package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpResult;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author S <sshzh90@gmail.com>
|
||||
*/
|
||||
@Data
|
||||
public class WxMpCardCodeDepositResult extends WxMpResult implements Serializable {
|
||||
|
||||
public class WxMpCardCodeDepositResult implements Serializable {
|
||||
private static final long serialVersionUID = 2955588617765355420L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,15 +2,16 @@ package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpResult;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @author S <sshzh90@gmail.com>
|
||||
*/
|
||||
@Data
|
||||
public class WxMpCardMpnewsGethtmlResult extends WxMpResult implements Serializable {
|
||||
|
||||
public class WxMpCardMpnewsGethtmlResult implements Serializable {
|
||||
private static final long serialVersionUID = 6435268886823478711L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,18 +2,20 @@ package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpResult;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户已领卡券返回
|
||||
*
|
||||
* @author yang229
|
||||
* @date 2019/12/22
|
||||
*/
|
||||
@Data
|
||||
public class WxUserCardListResult extends WxMpResult implements java.io.Serializable {
|
||||
public class WxUserCardListResult implements Serializable {
|
||||
private static final long serialVersionUID = 4348804828075982412L;
|
||||
|
||||
/**
|
||||
* 卡券列表
|
||||
|
||||
@@ -10,10 +10,10 @@ import java.io.Serializable;
|
||||
* <pre>
|
||||
* 查询群发消息发送状态【订阅号与服务号认证后均可用】
|
||||
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html#%E6%9F%A5%E8%AF%A2%E7%BE%A4%E5%8F%91%E6%B6%88%E6%81%AF%E5%8F%91%E9%80%81%E7%8A%B6%E6%80%81%E3%80%90%E8%AE%A2%E9%98%85%E5%8F%B7%E4%B8%8E%E6%9C%8D%E5%8A%A1%E5%8F%B7%E8%AE%A4%E8%AF%81%E5%90%8E%E5%9D%87%E5%8F%AF%E7%94%A8%E3%80%91
|
||||
* @author S <sshzh90@gmail.com>
|
||||
*/
|
||||
@Data
|
||||
public class WxMpMassGetResult extends WxMpResult implements Serializable {
|
||||
|
||||
public class WxMpMassGetResult implements Serializable {
|
||||
private static final long serialVersionUID = -2909694117357278557L;
|
||||
|
||||
@SerializedName("msg_id")
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
package me.chanjar.weixin.mp.bean.result;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
/**
|
||||
* https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842
|
||||
*/
|
||||
@Data
|
||||
public class WxMpOAuth2AccessToken implements Serializable {
|
||||
private static final long serialVersionUID = -1345910558078620805L;
|
||||
|
||||
private String accessToken;
|
||||
|
||||
private int expiresIn = -1;
|
||||
|
||||
private String refreshToken;
|
||||
|
||||
private String openId;
|
||||
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&announce_id=11513156443eZYea&version=&lang=zh_CN.
|
||||
* 本接口在scope参数为snsapi_base时不再提供unionID字段。
|
||||
*/
|
||||
private String unionId;
|
||||
|
||||
public static WxMpOAuth2AccessToken fromJson(String json) {
|
||||
return WxMpGsonBuilder.create().fromJson(json, WxMpOAuth2AccessToken.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package me.chanjar.weixin.mp.bean.result;
|
||||
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 基础的微信公众号平台请求结果.
|
||||
*/
|
||||
@Data
|
||||
public class WxMpResult implements Serializable {
|
||||
private static final long serialVersionUID = 2101652152604850904L;
|
||||
protected String errcode;
|
||||
protected String errmsg;
|
||||
|
||||
/**
|
||||
* 请求是否成功.
|
||||
*/
|
||||
public boolean isSuccess() {
|
||||
return StringUtils.equalsIgnoreCase(errcode, "0");
|
||||
}
|
||||
|
||||
public static WxMpResult fromJson(String json) {
|
||||
return WxGsonBuilder.create().fromJson(json, WxMpResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxGsonBuilder.create().toJson(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user