Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新最新代码 #11

Merged
merged 2 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ public interface WxMpCardService {
/**
* 得到WxMpService.
*
* @return WxMpService
* @return WxMpService wx mp service
*/
WxMpService getWxMpService();

/**
* 获得卡券api_ticket,不强制刷新卡券api_ticket.
*
* @return 卡券api_ticket
* @return 卡券api_ticket card api ticket
* @throws WxErrorException 异常
* @see #getCardApiTicket(boolean)
* @see #getCardApiTicket(boolean) #getCardApiTicket(boolean)
*/
String getCardApiTicket() throws WxErrorException;

Expand All @@ -38,7 +38,7 @@ public interface WxMpCardService {
* </pre>
*
* @param forceRefresh 强制刷新
* @return 卡券api_ticket
* @return 卡券api_ticket card api ticket
* @throws WxErrorException 异常
*/
String getCardApiTicket(boolean forceRefresh) throws WxErrorException;
Expand All @@ -52,9 +52,8 @@ public interface WxMpCardService {
* .9F.E6.88.90.E7.AE.97.E6.B3.95
* </pre>
*
* @param optionalSignParam 参与签名的参数数组。可以为下列字段:app_id, card_id, card_type, code, openid, location_id
* </br>注意:当做wx.chooseCard调用时,必须传入app_id参与签名,否则会造成签名失败导致拉取卡券列表为空
* @return 卡券Api签名对象
* @param optionalSignParam 参与签名的参数数组。可以为下列字段:app_id, card_id, card_type, code, openid, location_id </br>注意:当做wx.chooseCard调用时,必须传入app_id参与签名,否则会造成签名失败导致拉取卡券列表为空
* @return 卡券Api签名对象 wx card api signature
* @throws WxErrorException 异常
*/
WxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException;
Expand All @@ -63,7 +62,7 @@ public interface WxMpCardService {
* 卡券Code解码.
*
* @param encryptCode 加密Code,通过JSSDK的chooseCard接口获得
* @return 解密后的Code
* @return 解密后的Code string
* @throws WxErrorException 异常
*/
String decryptCardCode(String encryptCode) throws WxErrorException;
Expand All @@ -75,7 +74,7 @@ public interface WxMpCardService {
* @param cardId 卡券ID代表一类卡券
* @param code 单张卡券的唯一标准
* @param checkConsume 是否校验code核销状态,填入true和false时的code异常状态返回数据不同
* @return WxMpCardResult对象
* @return WxMpCardResult对象 wx mp card result
* @throws WxErrorException 异常
*/
WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException;
Expand All @@ -84,7 +83,7 @@ public interface WxMpCardService {
* 卡券Code核销。核销失败会抛出异常
*
* @param code 单张卡券的唯一标准
* @return 调用返回的JSON字符串。可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
* @return 调用返回的JSON字符串 。可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
* @throws WxErrorException 异常
*/
String consumeCardCode(String code) throws WxErrorException;
Expand All @@ -94,7 +93,7 @@ public interface WxMpCardService {
*
* @param code 单张卡券的唯一标准
* @param cardId 当自定义Code卡券时需要传入card_id
* @return 调用返回的JSON字符串。可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
* @return 调用返回的JSON字符串 。可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
* @throws WxErrorException 异常
*/
String consumeCardCode(String code, String cardId) throws WxErrorException;
Expand All @@ -117,9 +116,7 @@ public interface WxMpCardService {
* 详见 https://mp.weixin.qq.com/wiki/14/8dd77aeaee85f922db5f8aa6386d385e.html#.E6.9F.A5.E7.9C.8B.E5.8D.A1.E5.88.B8.E8.AF.A6.E6.83.85
*
* @param cardId 卡券的ID
* @return 返回的卡券详情JSON字符串
* <br> [注] 由于返回的JSON格式过于复杂,难以定义其对应格式的Bean并且难以维护,因此只返回String格式的JSON串。
* <br> 可由 com.google.gson.JsonParser#parse 等方法直接取JSON串中的某个字段。
* @return 返回的卡券详情JSON字符串 <br> [注] 由于返回的JSON格式过于复杂,难以定义其对应格式的Bean并且难以维护,因此只返回String格式的JSON串。 <br> 可由 com.google.gson.JsonParser#parse 等方法直接取JSON串中的某个字段。
* @throws WxErrorException 异常
*/
String getCardDetail(String cardId) throws WxErrorException;
Expand All @@ -128,7 +125,7 @@ public interface WxMpCardService {
* 添加测试白名单.
*
* @param openid 用户的openid
* @return string
* @return string string
* @throws WxErrorException 异常
*/
String addTestWhiteList(String openid) throws WxErrorException;
Expand All @@ -137,7 +134,7 @@ public interface WxMpCardService {
* 创建卡券.
*
* @param cardCreateMessage 请求
* @return result
* @return result wx mp card create result
* @throws WxErrorException 异常
*/
WxMpCardCreateResult createCard(WxMpCardCreateRequest cardCreateMessage) throws WxErrorException;
Expand All @@ -147,7 +144,7 @@ public interface WxMpCardService {
*
* @param cardId 卡券编号
* @param outerStr 二维码标识
* @return WxMpCardQrcodeCreateResult
* @return WxMpCardQrcodeCreateResult wx mp card qrcode create result
* @throws WxErrorException 异常
*/
WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr) throws WxErrorException;
Expand All @@ -158,7 +155,7 @@ public interface WxMpCardService {
* @param cardId 卡券编号
* @param outerStr 二维码标识
* @param expiresIn 指定二维码的有效时间,范围是60 ~ 1800秒。不填默认为365天有效
* @return WxMpCardQrcodeCreateResult
* @return WxMpCardQrcodeCreateResult wx mp card qrcode create result
* @throws WxErrorException 异常
*/
WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn) throws WxErrorException;
Expand All @@ -169,10 +166,10 @@ public interface WxMpCardService {
* @param cardId 卡券编号
* @param outerStr 用户首次领卡时,会通过 领取事件推送 给商户; 对于会员卡的二维码,用户每次扫码打开会员卡后点击任何url,会将该值拼入url中,方便开发者定位扫码来源
* @param expiresIn 指定二维码的有效时间,范围是60 ~ 1800秒。不填默认为365天有效
* @param isUniqueCode 指定下发二维码,生成的二维码随机分配一个code,领取后不可再次扫描。填写true或false。默认false,注意填写该字段时,卡券须通过审核且库存不为0。
* @param code 卡券Code码,use_custom_code字段为true的卡券必须填写,非自定义code和导入code模式的卡券不必填写。
* @param openid 指定领取者的openid,只有该用户能领取。bind_openid字段为true的卡券必须填写,非指定openid不必填写。
* @return WxMpCardQrcodeCreateResult
* @param code 卡券Code码,use_custom_code字段为true的卡券必须填写,非自定义code和导入code模式的卡券不必填写。
* @param isUniqueCode 指定下发二维码,生成的二维码随机分配一个code,领取后不可再次扫描。填写true或false。默认false,注意填写该字段时,卡券须通过审核且库存不为0。
* @return WxMpCardQrcodeCreateResult wx mp card qrcode create result
* @throws WxErrorException 异常
*/
WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn, String openid,
Expand All @@ -182,7 +179,7 @@ WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int
* 创建卡券货架.
*
* @param createRequest 货架创建参数
* @return WxMpCardLandingPageCreateResult
* @return WxMpCardLandingPageCreateResult wx mp card landing page create result
* @throws WxErrorException 异常
*/
WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateRequest createRequest)
Expand All @@ -195,7 +192,7 @@ WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateReque
* @param cardId 卡券编号
* @param code 用户会员卡号
* @param reason 设置为失效的原因
* @return result
* @return result string
* @throws WxErrorException 异常
*/
String unavailableCardCode(String cardId, String code, String reason) throws WxErrorException;
Expand All @@ -204,40 +201,46 @@ WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateReque
* 删除卡券接口.
*
* @param cardId 卡券id
* @return 删除结果
* @return 删除结果 wx mp card delete result
* @throws WxErrorException 异常
*/
WxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException;


/**
* 导入自定义code(仅对自定义code商户)
*
* @param cardId 卡券id
* @param codeList 需导入微信卡券后台的自定义code,上限为100个。
* @return the wx mp card code deposit result
* @throws WxErrorException the wx error exception
*/
WxMpCardCodeDepositResult cardCodeDeposit(String cardId, List<String> codeList) throws WxErrorException;

/**
* 查询导入code数目接口
*
* @param cardId 卡券id
* @return the wx mp card code deposit count result
* @throws WxErrorException the wx error exception
*/
WxMpCardCodeDepositCountResult cardCodeDepositCount(String cardId) throws WxErrorException;


/**
* 核查code接口
*
* @param cardId 卡券id
* @param codeList 已经微信卡券后台的自定义code,上限为100个
* @return the wx mp card code checkcode result
* @throws WxErrorException the wx error exception
*/
WxMpCardCodeCheckcodeResult cardCodeCheckcode(String cardId, List<String> codeList) throws WxErrorException;

/**
* 图文消息群发卡券获取内嵌html
*
* @param cardId 卡券id
* @return the wx mp card mpnews gethtml result
* @throws WxErrorException the wx error exception
*/
WxMpCardMpnewsGethtmlResult cardMpnewsGethtml(String cardId) throws WxErrorException;

Expand All @@ -248,6 +251,7 @@ WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateReque
*
* @param cardId 卡券ID
* @param changeValue 库存变更值,负值为减少库存
* @throws WxErrorException the wx error exception
*/
void cardModifyStock(String cardId, Integer changeValue) throws WxErrorException;

Expand All @@ -259,6 +263,7 @@ WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateReque
* @param cardId 卡券ID
* @param oldCode 需变更的Code码
* @param newCode 变更后的有效Code码
* @throws WxErrorException the wx error exception
*/
void cardCodeUpdate(String cardId, String oldCode, String newCode) throws WxErrorException;

Expand All @@ -268,6 +273,7 @@ WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateReque
*
* @param cardId 卡券ID
* @param isOpen 是否开启买单功能,填true/false
* @throws WxErrorException the wx error exception
*/
void cardPaycellSet(String cardId, Boolean isOpen) throws WxErrorException;

Expand All @@ -279,6 +285,7 @@ WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateReque
* @param isOpen 是否开启自助核销功能
* @param needVerifyCod 用户核销时是否需要输入验证码, 填true/false, 默认为false
* @param needRemarkAmount 用户核销时是否需要备注核销金额, 填true/false, 默认为false
* @throws WxErrorException the wx error exception
*/
void cardSelfConsumeCellSet(String cardId, Boolean isOpen,
Boolean needVerifyCod, Boolean needRemarkAmount) throws WxErrorException;
Expand All @@ -289,8 +296,8 @@ void cardSelfConsumeCellSet(String cardId, Boolean isOpen,
*
* @param openId 需要查询的用户openid
* @param cardId 卡券ID。不填写时默认查询当前appid下的卡券
* @return
* @throws WxErrorException
* @return user card list
* @throws WxErrorException the wx error exception
*/
WxUserCardListResult getUserCardList(String openId, String cardId) throws WxErrorException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;

import java.io.Serializable;
import java.util.List;


/**
Expand All @@ -15,22 +16,22 @@ public class WxMpCardCodeDepositResult implements Serializable {
private static final long serialVersionUID = 2955588617765355420L;

/**
* 成功个数
* 成功的code
*/
@SerializedName("succ_code")
private Integer succCode;
private List<String> successCodes;

/**
* 重复导入的code会自动被过滤
* 重复导入的code
*/
@SerializedName("duplicate_code")
private Integer duplicateCode;
private List<String> duplicateCodes;

/**
* 失败个数
* 失败的code
*/
@SerializedName("fail_code")
private Integer failCode;
private List<String> failCodes;


public static WxMpCardCodeDepositResult fromJson(String json) {
Expand Down