mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
#841 增加会员卡更新接口
This commit is contained in:
@@ -0,0 +1,166 @@
|
||||
package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 微信会员卡基本信息更新
|
||||
* @author yuanqixun
|
||||
* date:2018-08-25 00:36
|
||||
*/
|
||||
@Data
|
||||
public class BaseInfoUpdate implements Serializable {
|
||||
|
||||
/**
|
||||
* 需要审核:卡券名,字数上限为9个汉字 (建议涵盖卡券属性、服务及金额).
|
||||
*/
|
||||
@SerializedName("title")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 卡券的商户logo,建议像素为300*300.
|
||||
*/
|
||||
@SerializedName("logo_url")
|
||||
private String logoUrl;
|
||||
|
||||
/**
|
||||
* 卡券使用提醒,字数上限为16个汉字.
|
||||
*/
|
||||
@SerializedName("notice")
|
||||
private String notice;
|
||||
|
||||
/**
|
||||
* 需要审核:卡券使用说明,字数上限为1024个汉字.
|
||||
*/
|
||||
@SerializedName("description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 客服电话.
|
||||
*/
|
||||
@SerializedName("service_phone")
|
||||
private String servicePhone;
|
||||
|
||||
/**
|
||||
* 券颜色,按色彩规范标注填写Color010-Color100.
|
||||
*/
|
||||
@SerializedName("color")
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 门店位置ID,调用 POI门店管理接口 获取门店位置ID.
|
||||
*/
|
||||
@SerializedName("location_id_list")
|
||||
private String locationIdList;
|
||||
|
||||
/**
|
||||
* 会员卡是否支持全部门店,填写后商户门店更新时会自动同步至卡券.
|
||||
*/
|
||||
@SerializedName("use_all_locations")
|
||||
private Boolean useAllLocations;
|
||||
|
||||
/**
|
||||
* 卡券中部居中的按钮,仅在卡券激活后且可用状态 时显示.
|
||||
*/
|
||||
@SerializedName("center_title")
|
||||
private String centerTitle;
|
||||
|
||||
/**
|
||||
* 显示在入口下方的提示语,仅在卡券激活后且可用状态时显示.
|
||||
*/
|
||||
@SerializedName("center_sub_title")
|
||||
private String centerSubTitle;
|
||||
|
||||
/**
|
||||
* 顶部居中的url,仅在卡券激活后且可用状态时显示.
|
||||
*/
|
||||
@SerializedName("center_url")
|
||||
private String centerUrl;
|
||||
|
||||
/**
|
||||
* 自定义跳转外链的入口名字.
|
||||
*/
|
||||
@SerializedName("custom_url_name")
|
||||
private String customUrlName;
|
||||
|
||||
/**
|
||||
* 自定义跳转的URL.
|
||||
*/
|
||||
@SerializedName("custom_url")
|
||||
private String customUrl;
|
||||
|
||||
/**
|
||||
* 显示在入口右侧的提示语.
|
||||
*/
|
||||
@SerializedName("custom_url_sub_title")
|
||||
private String customUrlSubTitle;
|
||||
|
||||
/**
|
||||
* 营销场景的自定义入口名称.
|
||||
*/
|
||||
@SerializedName("promotion_url_name")
|
||||
private String promotionUrlName;
|
||||
|
||||
/**
|
||||
* 入口跳转外链的地址链接.
|
||||
*/
|
||||
@SerializedName("promotion_url")
|
||||
private String promotionUrl;
|
||||
|
||||
/**
|
||||
* 显示在营销入口右侧的提示语.
|
||||
*/
|
||||
@SerializedName("promotion_url_sub_title")
|
||||
private String promotionUrlSubTitle;
|
||||
|
||||
/**
|
||||
* Code展示类型.
|
||||
* "CODE_TYPE_TEXT" 文本 "CODE_TYPE_BARCODE" 一维码 "CODE_TYPE_QRCODE" 二维码 "CODE_TYPE_ONLY_QRCODE" 仅显示二维码 "CODE_TYPE_ONLY_BARCODE" 仅显示一维码 "CODE_TYPE_NONE" 不显示任何码型
|
||||
*/
|
||||
@SerializedName("code_type")
|
||||
private String codeType;
|
||||
|
||||
/**
|
||||
* 支付功能结构体,swipe_card结构.
|
||||
*/
|
||||
@SerializedName("pay_info")
|
||||
private PayInfo payInfo;
|
||||
|
||||
/**
|
||||
* 是否设置该会员卡中部的按钮同时支持微信支付刷卡和会员卡二维码.
|
||||
*/
|
||||
@SerializedName("is_pay_and_qrcode")
|
||||
private Boolean isPayAndQrcode;
|
||||
|
||||
/**
|
||||
* 每人可领券的数量限制,建议会员卡每人限领一张.
|
||||
*/
|
||||
@SerializedName("get_limit")
|
||||
private Integer getLimit;
|
||||
|
||||
/**
|
||||
* 卡券领取页面是否可分享,默认为true.
|
||||
*/
|
||||
@SerializedName("can_share")
|
||||
private Boolean canShare;
|
||||
|
||||
/**
|
||||
* 卡券是否可转赠,默认为true.
|
||||
*/
|
||||
@SerializedName("can_give_friend")
|
||||
private Boolean canGiveFriend;
|
||||
|
||||
/**
|
||||
* 使用日期,有效期的信息.
|
||||
*/
|
||||
@SerializedName("date_info")
|
||||
private DateInfo dateInfo;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author yqx
|
||||
* @date 2018/11/07
|
||||
*/
|
||||
@Data
|
||||
public class CardUpdateResult {
|
||||
|
||||
private int errcode;
|
||||
|
||||
private String errmsg;
|
||||
|
||||
/**
|
||||
* 此次更新是否需要提审,true为需要,false为不需要。
|
||||
*/
|
||||
@SerializedName("send_check")
|
||||
private boolean sendCheck;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 会员卡更新对象
|
||||
* @author yuanqixun
|
||||
*/
|
||||
@Data
|
||||
public final class MemberCardUpdate implements Serializable {
|
||||
|
||||
//以下字段顺序根据微信官方文档顺序相同,不能传入非文档之外的字段
|
||||
//https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1466494654_K9rNz
|
||||
|
||||
/**
|
||||
* 基本信息.
|
||||
*/
|
||||
@SerializedName("base_info")
|
||||
private BaseInfoUpdate baseInfo;
|
||||
|
||||
/**
|
||||
* 会员卡背景图.
|
||||
*/
|
||||
@SerializedName("background_pic_url")
|
||||
private String backgroundPicUrl;
|
||||
|
||||
/**
|
||||
* 是否支持积分,仅支持从false变为true,默认为false
|
||||
*/
|
||||
@SerializedName("supply_bonus")
|
||||
private Boolean supplyBonus;
|
||||
|
||||
/**
|
||||
* 积分清零规则.
|
||||
*/
|
||||
@SerializedName("bonus_cleared")
|
||||
private String bonusCleared;
|
||||
|
||||
/**
|
||||
* 积分规则.
|
||||
*/
|
||||
@SerializedName("bonus_rules")
|
||||
private String bonusRules;
|
||||
|
||||
/**
|
||||
* 查看积分外链,设置跳转外链查看积分详情。仅适用于积分无法通过激活接口同步的情况下使用该字段.
|
||||
*/
|
||||
@SerializedName("bonus_url")
|
||||
private String bonusUrl;
|
||||
|
||||
/**
|
||||
* 余额外链,仅适用于余额无法通过激活接口同步的情况下使用该字段.
|
||||
*/
|
||||
@SerializedName("balance_url")
|
||||
private String balanceUrl;
|
||||
|
||||
/**
|
||||
* 是否支持储值,仅支持从false变为true,默认为fals e 该字段须开通储值功能后方可使用, 详情见: 获取特殊权限
|
||||
*/
|
||||
@SerializedName("supply_balance")
|
||||
private Boolean supplyBalance;
|
||||
|
||||
/**
|
||||
* 储值规则.
|
||||
*/
|
||||
@SerializedName("balance_rules")
|
||||
private String balanceRules;
|
||||
|
||||
/**
|
||||
* 特权说明.
|
||||
*/
|
||||
@SerializedName("prerogative")
|
||||
private String prerogative;
|
||||
|
||||
/**
|
||||
* 自动激活.
|
||||
*/
|
||||
@SerializedName("auto_activate")
|
||||
private Boolean autoActivate;
|
||||
|
||||
/**
|
||||
* 是否一键开卡.
|
||||
*/
|
||||
@SerializedName("wx_activate")
|
||||
private Boolean wxActivate;
|
||||
|
||||
/**
|
||||
* 激活会员卡的url.
|
||||
*/
|
||||
@SerializedName("activate_url")
|
||||
private String activateUrl;
|
||||
|
||||
/**
|
||||
* 自定义会员类目1,会员卡激活后显示.
|
||||
*/
|
||||
@SerializedName("custom_field1")
|
||||
private CustomField customField1;
|
||||
|
||||
/**
|
||||
* 自定义会员类目2.
|
||||
*/
|
||||
@SerializedName("custom_field2")
|
||||
private CustomField customField2;
|
||||
|
||||
/**
|
||||
* 自定义会员类目3.
|
||||
*/
|
||||
@SerializedName("custom_field3")
|
||||
private CustomField customField3;
|
||||
|
||||
/**
|
||||
* 自定义会员信息类目,会员卡激活后显示.
|
||||
*/
|
||||
@SerializedName("custom_cell1")
|
||||
private CustomCell1 customCell1;
|
||||
|
||||
/**
|
||||
* 积分规则,JSON结构积分规则.
|
||||
*/
|
||||
@SerializedName("bonus_rule")
|
||||
private BonusRule bonusRule;
|
||||
|
||||
/**
|
||||
* 折扣,该会员卡享受的折扣优惠,填10就是九折.
|
||||
*/
|
||||
private Integer discount;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
public static MemberCardUpdate fromJson(String json) {
|
||||
return WxMpGsonBuilder.create().fromJson(json, MemberCardUpdate.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class MemberCardUpdateRequest implements Serializable {
|
||||
@SerializedName("card_id")
|
||||
private String cardId;
|
||||
|
||||
@SerializedName("member_card")
|
||||
private MemberCardUpdate memberCardUpdate;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user