mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
✨ #1213 增加部分微信卡券接口
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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;
|
||||
|
||||
|
||||
@Data
|
||||
public class WxMpCardCodeCheckcodeResult extends WxMpResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5128692403997016750L;
|
||||
|
||||
/**
|
||||
* 已经成功存入的code数目
|
||||
*/
|
||||
@SerializedName("exist_code")
|
||||
private List<String> existCode;
|
||||
|
||||
@SerializedName("not_exist_code")
|
||||
private List<String> notExistCode;
|
||||
|
||||
|
||||
public static WxMpCardCodeCheckcodeResult fromJson(String json) {
|
||||
return WxMpGsonBuilder.create().fromJson(json, WxMpCardCodeCheckcodeResult.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
|
||||
|
||||
@Data
|
||||
public class WxMpCardCodeDepositCountResult extends WxMpResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6707587956061215868L;
|
||||
|
||||
/**
|
||||
* 已经成功存入的code数目
|
||||
*/
|
||||
@SerializedName("count")
|
||||
private Integer count;
|
||||
|
||||
|
||||
public static WxMpCardCodeDepositCountResult fromJson(String json) {
|
||||
return WxMpGsonBuilder.create().fromJson(json, WxMpCardCodeDepositCountResult.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
|
||||
|
||||
@Data
|
||||
public class WxMpCardCodeDepositResult extends WxMpResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2955588617765355420L;
|
||||
|
||||
/**
|
||||
* 成功个数
|
||||
*/
|
||||
@SerializedName("succ_code")
|
||||
private Integer succCode;
|
||||
|
||||
/**
|
||||
* 重复导入的code会自动被过滤
|
||||
*/
|
||||
@SerializedName("duplicate_code")
|
||||
private Integer duplicateCode;
|
||||
|
||||
/**
|
||||
* 失败个数
|
||||
*/
|
||||
@SerializedName("fail_code")
|
||||
private Integer failCode;
|
||||
|
||||
|
||||
public static WxMpCardCodeDepositResult fromJson(String json) {
|
||||
return WxMpGsonBuilder.create().fromJson(json, WxMpCardCodeDepositResult.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
|
||||
|
||||
@Data
|
||||
public class WxMpCardMpnewsGethtmlResult extends WxMpResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6435268886823478711L;
|
||||
|
||||
/**
|
||||
* 返回一段html代码,可以直接嵌入到图文消息的正文里。即可以把这段代码嵌入到 上传图文消息素材接口 中的content字段里
|
||||
*/
|
||||
@SerializedName("content")
|
||||
private String content;
|
||||
|
||||
public static WxMpCardMpnewsGethtmlResult fromJson(String json) {
|
||||
return WxMpGsonBuilder.create().fromJson(json, WxMpCardMpnewsGethtmlResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package me.chanjar.weixin.mp.bean.result;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
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
|
||||
*/
|
||||
@Data
|
||||
public class WxMpMassGetResult extends WxMpResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2909694117357278557L;
|
||||
|
||||
@SerializedName("msg_id")
|
||||
private Long msgId;
|
||||
|
||||
@SerializedName("msg_status")
|
||||
private String msgstatus;
|
||||
|
||||
public static WxMpMassGetResult fromJson(String json) {
|
||||
return WxMpGsonBuilder.create().fromJson(json, WxMpMassGetResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package me.chanjar.weixin.mp.bean.result;
|
||||
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 获取群发速度
|
||||
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Batch_Sends_and_Originality_Checks.html#9
|
||||
* speed realspeed
|
||||
* 0 80w/分钟
|
||||
* 1 60w/分钟
|
||||
* 2 45w/分钟
|
||||
* 3 30w/分钟
|
||||
* 4 10w/分钟
|
||||
* </pre>
|
||||
*/
|
||||
@Data
|
||||
public class WxMpMassSpeedGetResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6478157575168068334L;
|
||||
|
||||
private Integer speed;
|
||||
|
||||
private Integer realspeed;
|
||||
|
||||
public static WxMpMassSpeedGetResult fromJson(String json) {
|
||||
return WxMpGsonBuilder.create().fromJson(json, WxMpMassSpeedGetResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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