Compare commits
2 Commits
develop
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bf69cbbc6 | ||
|
|
aa94c5c4d4 |
@@ -241,16 +241,4 @@ public class OrderProductInfo implements Serializable {
|
||||
@JsonProperty("national_subsidy_merchant_discounted_price")
|
||||
private Integer nationalSubsidyMerchantDiscountedPrice;
|
||||
|
||||
/**
|
||||
* 订单内商品维度活动商家补贴,即参与平台补贴活动时商家通过活动报名价优惠的部分,单位为分
|
||||
*/
|
||||
@JsonProperty("platform_activity_merchant_discounted_price")
|
||||
private Integer platformActivityMerchantDiscountedPrice;
|
||||
|
||||
/**
|
||||
* 订单内商品维度平台券优惠金额,单位为分
|
||||
*/
|
||||
@JsonProperty("cash_coupon_discounted_price")
|
||||
private Integer cashCouponDiscountedPrice;
|
||||
|
||||
}
|
||||
|
||||
@@ -465,39 +465,31 @@ public class WxConsts {
|
||||
/**
|
||||
* 名称审核事件
|
||||
*/
|
||||
public static final String WXA_NICKNAME_AUDIT = "wxa_nickname_audit";
|
||||
public static final String WXA_NICKNAME_AUDIT = "wxa_nickname_audit" ;
|
||||
/**
|
||||
* 小程序违规记录事件
|
||||
*小程序违规记录事件
|
||||
*/
|
||||
public static final String WXA_ILLEGAL_RECORD = "wxa_illegal_record";
|
||||
public static final String WXA_ILLEGAL_RECORD= "wxa_illegal_record";
|
||||
/**
|
||||
* 小程序申诉记录推送
|
||||
*小程序申诉记录推送
|
||||
*/
|
||||
public static final String WXA_APPEAL_RECORD = "wxa_appeal_record";
|
||||
public static final String WXA_APPEAL_RECORD= "wxa_appeal_record";
|
||||
/**
|
||||
* 隐私权限审核结果推送
|
||||
*/
|
||||
public static final String WXA_PRIVACY_APPLY = "wxa_privacy_apply";
|
||||
public static final String WXA_PRIVACY_APPLY= "wxa_privacy_apply";
|
||||
/**
|
||||
* 类目审核结果事件推送
|
||||
*/
|
||||
public static final String WXA_CATEGORY_AUDIT = "wxa_category_audit";
|
||||
public static final String WXA_CATEGORY_AUDIT= "wxa_category_audit";
|
||||
/**
|
||||
* 小程序微信认证支付成功事件
|
||||
*/
|
||||
public static final String WX_VERIFY_PAY_SUCC = "wx_verify_pay_succ";
|
||||
public static final String WX_VERIFY_PAY_SUCC= "wx_verify_pay_succ";
|
||||
/**
|
||||
* 小程序微信认证派单事件
|
||||
*/
|
||||
public static final String WX_VERIFY_DISPATCH = "wx_verify_dispatch";
|
||||
/**
|
||||
* 提醒需要上传发货信息事件:曾经发过货的小程序,订单超过48小时未发货时
|
||||
*/
|
||||
public static final String TRADE_MANAGE_REMIND_SHIPPING = "trade_manage_remind_shipping";
|
||||
/**
|
||||
* 订单完成发货时、订单结算时
|
||||
*/
|
||||
public static final String TRADE_MANAGE_ORDER_SETTLEMENT = "trade_manage_order_settlement";
|
||||
public static final String WX_VERIFY_DISPATCH= "wx_verify_dispatch";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,9 +40,6 @@ public class WxMaKefuMessage implements Serializable {
|
||||
@SerializedName("miniprogrampage")
|
||||
private KfMaPage maPage;
|
||||
|
||||
@SerializedName("aimsgcontext")
|
||||
private AiMsgContext aiMsgContext;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@@ -93,16 +90,6 @@ public class WxMaKefuMessage implements Serializable {
|
||||
private String thumbMediaId;
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class AiMsgContext implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SerializedName("msgid")
|
||||
private String msgId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得文本消息builder.
|
||||
*/
|
||||
|
||||
@@ -257,62 +257,6 @@ public class WxMaMessage implements Serializable {
|
||||
*/
|
||||
private String context;
|
||||
|
||||
/**
|
||||
* 微信支付订单号
|
||||
*/
|
||||
@XStreamAlias("transaction_id")
|
||||
private String transactionId;
|
||||
/**
|
||||
* 商户号
|
||||
*/
|
||||
@XStreamAlias("merchant_id")
|
||||
private String merchantId;
|
||||
/**
|
||||
* 子商户号
|
||||
*/
|
||||
@XStreamAlias("sub_merchant_id")
|
||||
private String subMerchantId;
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
@XStreamAlias("merchant_trade_no")
|
||||
private String merchantTradeNo;
|
||||
/**
|
||||
* 支付成功时间,秒级时间戳
|
||||
*/
|
||||
@XStreamAlias("pay_time")
|
||||
private Long payTime;
|
||||
/**
|
||||
* 消息文本内容
|
||||
*/
|
||||
@XStreamAlias("msg")
|
||||
private String msg;
|
||||
/**
|
||||
* 发货时间,秒级时间戳
|
||||
*/
|
||||
@XStreamAlias("shipped_time")
|
||||
private Long shippedTime;
|
||||
/**
|
||||
* 预计结算时间,秒级时间戳。发货时推送才有该字段
|
||||
*/
|
||||
@XStreamAlias("estimated_settlement_time")
|
||||
private Long estimatedSettlementTime;
|
||||
/**
|
||||
* 确认收货方式:1. 手动确认收货;2. 自动确认收货。结算时推送才有该字段
|
||||
*/
|
||||
@XStreamAlias("confirm_receive_method")
|
||||
private Integer confirmReceiveMethod;
|
||||
/**
|
||||
* 确认收货时间,秒级时间戳。结算时推送才有该字段
|
||||
*/
|
||||
@XStreamAlias("confirm_receive_time")
|
||||
private Long confirmReceiveTime;
|
||||
/**
|
||||
* 订单结算时间,秒级时间戳。结算时推送才有该字段
|
||||
*/
|
||||
@XStreamAlias("settlement_time")
|
||||
private Long settlementTime;
|
||||
|
||||
/**
|
||||
* 不要直接使用这个字段,
|
||||
* 这个字段只是为了适配 SubscribeMsgPopupEvent SubscribeMsgChangeEvent SubscribeMsgSentEvent
|
||||
|
||||
@@ -34,7 +34,7 @@ public class WxMaExpressOrderCargo implements Serializable {
|
||||
* 描述: 单位是千克(kg)
|
||||
* </pre>
|
||||
*/
|
||||
private Double weight;
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 包裹长度
|
||||
@@ -44,7 +44,7 @@ public class WxMaExpressOrderCargo implements Serializable {
|
||||
* </pre>
|
||||
*/
|
||||
@SerializedName("space_x")
|
||||
private Double spaceLength;
|
||||
private Integer spaceLength;
|
||||
|
||||
/**
|
||||
* 包裹宽度
|
||||
@@ -54,7 +54,7 @@ public class WxMaExpressOrderCargo implements Serializable {
|
||||
* </pre>
|
||||
*/
|
||||
@SerializedName("space_y")
|
||||
private Double spaceWidth;
|
||||
private Integer spaceWidth;
|
||||
|
||||
/**
|
||||
* 包裹高度
|
||||
@@ -64,7 +64,7 @@ public class WxMaExpressOrderCargo implements Serializable {
|
||||
* </pre>
|
||||
*/
|
||||
@SerializedName("space_z")
|
||||
private Double spaceHeight;
|
||||
private Integer spaceHeight;
|
||||
|
||||
/**
|
||||
* 包裹中商品详情列表
|
||||
|
||||
@@ -8,7 +8,6 @@ import cn.binarywang.wx.miniapp.bean.WxMaKefuMessage;
|
||||
public class BaseBuilder<T> {
|
||||
protected String msgType;
|
||||
protected String toUser;
|
||||
protected String aiMsgContextMsgId;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public T toUser(String toUser) {
|
||||
@@ -16,12 +15,6 @@ public class BaseBuilder<T> {
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public T aiMsgContextMsgId(String msgId) {
|
||||
this.aiMsgContextMsgId = msgId;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造器方法.
|
||||
*/
|
||||
@@ -29,9 +22,6 @@ public class BaseBuilder<T> {
|
||||
WxMaKefuMessage m = new WxMaKefuMessage();
|
||||
m.setMsgType(this.msgType);
|
||||
m.setToUser(this.toUser);
|
||||
if (this.aiMsgContextMsgId != null) {
|
||||
m.setAiMsgContext(new WxMaKefuMessage.AiMsgContext(this.aiMsgContextMsgId));
|
||||
}
|
||||
return m;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,10 +116,10 @@ public class WxMaExpressServiceImplTest {
|
||||
goodsCount ++;
|
||||
}
|
||||
cargo.setCount(detailList.size());
|
||||
cargo.setWeight(1.2);
|
||||
cargo.setSpaceHeight(10.0);
|
||||
cargo.setSpaceLength(20.0);
|
||||
cargo.setSpaceWidth(15.0);
|
||||
cargo.setWeight(5);
|
||||
cargo.setSpaceHeight(10);
|
||||
cargo.setSpaceLength(10);
|
||||
cargo.setSpaceWidth(10);
|
||||
cargo.setDetailList(detailList);
|
||||
|
||||
|
||||
|
||||
@@ -66,14 +66,4 @@ public class WxMaKefuMessageTest {
|
||||
"\"link\":{\"title\":\"title\",\"description\":\"description\",\"url\":\"https://mp.weixin.qq.com/s?__biz=MzI0MDA2OTY5NQ==\",\"thumb_url\":\"thumbUrl\"}}");
|
||||
}
|
||||
|
||||
public void testTextBuilderWithAiMsgContext() {
|
||||
WxMaKefuMessage reply = WxMaKefuMessage.newTextBuilder()
|
||||
.toUser("OPENID")
|
||||
.content("回复内容")
|
||||
.aiMsgContextMsgId("MSG_ID_123")
|
||||
.build();
|
||||
assertThat(reply.toJson())
|
||||
.isEqualTo("{\"touser\":\"OPENID\",\"msgtype\":\"text\",\"text\":{\"content\":\"回复内容\"},\"aimsgcontext\":{\"msgid\":\"MSG_ID_123\"}}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
private static final long serialVersionUID = 4104022969945059126L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 业务申请编号
|
||||
@@ -78,7 +78,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class ContactInfo implements Serializable {
|
||||
private static final long serialVersionUID = -9087348002744428474L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 超级管理员类型
|
||||
@@ -211,7 +211,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class SubjectInfo implements Serializable {
|
||||
private static final long serialVersionUID = -6651911735969445765L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主体类型
|
||||
@@ -242,13 +242,6 @@ public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
@SerializedName("certificate_letter_copy")
|
||||
private String certificateLetterCopy;
|
||||
|
||||
/**
|
||||
* 小微辅助证明材料
|
||||
* 主体类型为小微商户时,小微辅助证明材料必填
|
||||
*/
|
||||
@SerializedName("micro_biz_info")
|
||||
private MicroBizInfo microBizInfo;
|
||||
|
||||
/**
|
||||
* 金融机构许可证信息
|
||||
*/
|
||||
@@ -400,212 +393,6 @@ public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
private List<String> financeLicensePics;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小微辅助证明材料
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class MicroBizInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2327302539406612422L;
|
||||
|
||||
/**
|
||||
* 小微经营类型
|
||||
* 枚举值:
|
||||
* MICRO_TYPE_STORE:门店场所
|
||||
* MICRO_TYPE_MOBILE:流动经营/便民服务
|
||||
* MICRO_TYPE_ONLINE:线上商品/服务交易
|
||||
* 示例值:MICRO_TYPE_STORE
|
||||
*/
|
||||
@SerializedName("micro_biz_type")
|
||||
private MicroBizTypeEnum microBizType;
|
||||
|
||||
/**
|
||||
* 【门店场所】 经营类型为“门店场所”时填写
|
||||
*/
|
||||
@SerializedName("micro_store_info")
|
||||
private MicroStoreInfo microStoreInfo;
|
||||
|
||||
/**
|
||||
* 【流动经营/便民服务】 经营类型为“流动经营/便民服务”时填写
|
||||
*/
|
||||
@SerializedName("micro_mobile_info")
|
||||
private MicroMobileInfo microMobileInfo;
|
||||
|
||||
/**
|
||||
* 【线上商品/服务交易】 经营场景为“线上商品/服务交易”时填写
|
||||
*/
|
||||
@SerializedName("micro_online_info")
|
||||
private MicroOnlineInfo microOnlineInfo;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class MicroOnlineInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4672635122639034459L;
|
||||
|
||||
/**
|
||||
* 【线上店铺名称】 填写商家的线上店铺名称
|
||||
* 1、长度为1-50个字符;
|
||||
* 2、前后不能有空格、制表符、换行符;
|
||||
* 3、不能仅含数字、特殊字符;
|
||||
* 4、仅能填写数字、英文字母、汉字及特殊字符;
|
||||
* 5、仅支持utf-8格式。
|
||||
*/
|
||||
@SerializedName("micro_online_store")
|
||||
private String microOnlineStore;
|
||||
|
||||
/**
|
||||
* 【电商平台名称】 填写电商平台名称
|
||||
* 1、长度为1-50个字符;
|
||||
* 2、前后不能有空格、制表符、换行符;
|
||||
* 3、不能仅含数字、特殊字符;
|
||||
* 4、仅能填写数字、英文字母、汉字及特殊字符;
|
||||
* 5、仅支持utf-8格式。
|
||||
*/
|
||||
@SerializedName("micro_ec_name")
|
||||
private String microEcName;
|
||||
|
||||
/**
|
||||
* 【店铺二维码】
|
||||
* 1、店铺二维码或店铺链接二选一必填;
|
||||
* 2、若为电商小程序,可上传店铺页面的小程序二维码;
|
||||
* 3、可上传1张图片,请填写通过图片上传API预先上传图片生成好的MediaID。
|
||||
*/
|
||||
@SerializedName("micro_qrcode")
|
||||
private String microQrcode;
|
||||
|
||||
/**
|
||||
* 【店铺链接】
|
||||
* 1、店铺二维码或店铺链接二选一必填;
|
||||
* 2、请填写店铺主页链接,需符合网站规范。
|
||||
*/
|
||||
@SerializedName("micro_link")
|
||||
private String microLink;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class MicroMobileInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4672635122639034460L;
|
||||
|
||||
/**
|
||||
* 【经营/服务名称】 请填写经营/服务名称
|
||||
* 1、长度为1-50个字符;
|
||||
* 2、前后不能有空格、制表符、换行符;
|
||||
* 3、不能仅含数字、特殊字符;
|
||||
* 4、仅能填写数字、英文字母、汉字及特殊字符;
|
||||
* 5、仅支持utf-8格式。
|
||||
*/
|
||||
@SerializedName("micro_mobile_name")
|
||||
private String microMobileName;
|
||||
|
||||
/**
|
||||
* 【经营/服务所在地省市】 请填写经营/服务所在地省市编码
|
||||
*/
|
||||
@SerializedName("micro_mobile_city")
|
||||
private String microMobileCity;
|
||||
|
||||
/**
|
||||
* 【经营/服务所在地(不含省市)】 填写“无"
|
||||
*/
|
||||
@SerializedName("micro_mobile_address")
|
||||
private String microMobileAddress;
|
||||
|
||||
/**
|
||||
* 【经营/服务现场照片】
|
||||
* 1、提交流动经营现场照片,如摊位场景应提交摊位全景照片+商品照片。
|
||||
* 2、可上传多张图片,请填写通过图片上传API预先上传图片生成好的MediaID。
|
||||
*/
|
||||
@SerializedName("micro_mobile_pics")
|
||||
private List<String> microMobilePics;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class MicroStoreInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4672635122639034461L;
|
||||
|
||||
/**
|
||||
* 【门店名称】
|
||||
* 请填写门店名称
|
||||
* 1、长度为1-50个字符;
|
||||
* 2、前后不能有空格、制表符、换行符;
|
||||
* 3、不能仅含数字、特殊字符;
|
||||
* 4、仅能填写数字、英文字母、汉字及特殊字符;
|
||||
* 5、仅支持utf-8格式。
|
||||
*/
|
||||
@SerializedName("micro_name")
|
||||
private String microName;
|
||||
|
||||
/**
|
||||
* 【门店省市编码】
|
||||
* 填写门店省市编码,只能由数字组成,详细参见微信支付提供的省市对照表
|
||||
*/
|
||||
@SerializedName("micro_address_code")
|
||||
private String microAddressCode;
|
||||
|
||||
/**
|
||||
* 【门店地址】
|
||||
* 请填写详细的经营场所信息,如有多个场所,选择一个主要场所填写即可。
|
||||
* 1、长度为4-512个字符;
|
||||
* 2、前后不能有空格、制表符、换行符;
|
||||
* 3、不能仅含数字、特殊字符;
|
||||
* 4、仅能填写数字、英文字母、汉字及特殊字符;
|
||||
* 5、仅支持utf-8格式。
|
||||
*/
|
||||
@SerializedName("micro_address")
|
||||
private String microAddress;
|
||||
|
||||
/**
|
||||
* 【门店门头照片】
|
||||
* 1、请上传门头正面照片(要求门店招牌、门框完整、清晰、可辨识);若为停车场等无固定门头照片的经营场所,可上传岗亭/出入闸口。
|
||||
* 2、可上传1张图片,请填写通过图片上传API预先上传图片生成好的MediaID。
|
||||
*/
|
||||
@SerializedName("store_entrance_pic")
|
||||
private String storeEntrancePic;
|
||||
|
||||
/**
|
||||
* 【店内环境照片】
|
||||
* 1、请上传门店内部环境照片(可辨识经营内容)。若为停车场等无固定门头的经营场所,可上传停车场内部照片。
|
||||
* 2、可上传1张图片,请填写通过图片上传API预先上传图片生成好的MediaID。
|
||||
*/
|
||||
@SerializedName("micro_indoor_copy")
|
||||
private String microIndoorCopy;
|
||||
|
||||
/**
|
||||
* 【门店经度】 数字或小数,商户自定义字段
|
||||
*/
|
||||
@SerializedName("store_longitude")
|
||||
private String storeLongitude;
|
||||
|
||||
/**
|
||||
* 【门店纬度】 纬度,商户自定义字段
|
||||
*/
|
||||
@SerializedName("store_latitude")
|
||||
private String storeLatitude;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@@ -816,7 +603,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class BusinessInfo implements Serializable {
|
||||
private static final long serialVersionUID = -8605049544105644011L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 商户简称
|
||||
@@ -1089,7 +876,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class SettlementInfo implements Serializable {
|
||||
private static final long serialVersionUID = -5025743467243760522L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 入驻结算规则ID
|
||||
@@ -1150,7 +937,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class BankAccountInfo implements Serializable {
|
||||
private static final long serialVersionUID = -5853122395888860086L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 账户类型
|
||||
@@ -1208,7 +995,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable {
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public static class AdditionInfo implements Serializable {
|
||||
private static final long serialVersionUID = -7526912529114022379L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 法人开户承诺函
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
package com.github.binarywang.wxpay.bean.applyment;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
public class WxPayApplyment4SubCreateRequestTest {
|
||||
|
||||
@Test
|
||||
public void testMicroBizInfoSerialization() {
|
||||
// 1. Test MicroStoreInfo
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo.MicroStoreInfo storeInfo =
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo.MicroStoreInfo.builder()
|
||||
.microName("门店名称")
|
||||
.microAddressCode("440305")
|
||||
.microAddress("详细地址")
|
||||
.storeEntrancePic("media_id_1")
|
||||
.microIndoorCopy("media_id_2")
|
||||
.storeLongitude("113.941046")
|
||||
.storeLatitude("22.546154")
|
||||
.build();
|
||||
|
||||
// 2. Test MicroMobileInfo
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo.MicroMobileInfo mobileInfo =
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo.MicroMobileInfo.builder()
|
||||
.microMobileName("流动经营名称")
|
||||
.microMobileCity("440305")
|
||||
.microMobileAddress("无")
|
||||
.microMobilePics(Arrays.asList("media_id_3", "media_id_4"))
|
||||
.build();
|
||||
|
||||
// 3. Test MicroOnlineInfo
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo.MicroOnlineInfo onlineInfo =
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo.MicroOnlineInfo.builder()
|
||||
.microOnlineStore("线上店铺名称")
|
||||
.microEcName("电商平台名称")
|
||||
.microQrcode("media_id_5")
|
||||
.microLink("https://www.example.com")
|
||||
.build();
|
||||
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo microBizInfo =
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo.builder()
|
||||
.microStoreInfo(storeInfo)
|
||||
.microMobileInfo(mobileInfo)
|
||||
.microOnlineInfo(onlineInfo)
|
||||
.build();
|
||||
|
||||
Gson gson = new GsonBuilder().create();
|
||||
String json = gson.toJson(microBizInfo);
|
||||
|
||||
// Verify MicroStoreInfo serialization
|
||||
assertTrue(json.contains("\"micro_name\":\"门店名称\""));
|
||||
assertTrue(json.contains("\"micro_address_code\":\"440305\""));
|
||||
assertTrue(json.contains("\"micro_address\":\"详细地址\""));
|
||||
assertTrue(json.contains("\"store_entrance_pic\":\"media_id_1\""));
|
||||
assertTrue(json.contains("\"micro_indoor_copy\":\"media_id_2\""));
|
||||
assertTrue(json.contains("\"store_longitude\":\"113.941046\""));
|
||||
assertTrue(json.contains("\"store_latitude\":\"22.546154\""));
|
||||
|
||||
// Verify MicroMobileInfo serialization
|
||||
assertTrue(json.contains("\"micro_mobile_name\":\"流动经营名称\""));
|
||||
assertTrue(json.contains("\"micro_mobile_city\":\"440305\""));
|
||||
assertTrue(json.contains("\"micro_mobile_address\":\"无\""));
|
||||
assertTrue(json.contains("\"micro_mobile_pics\":[\"media_id_3\",\"media_id_4\"]"));
|
||||
|
||||
// Verify MicroOnlineInfo serialization
|
||||
assertTrue(json.contains("\"micro_online_store\":\"线上店铺名称\""));
|
||||
assertTrue(json.contains("\"micro_ec_name\":\"电商平台名称\""));
|
||||
assertTrue(json.contains("\"micro_qrcode\":\"media_id_5\""));
|
||||
assertTrue(json.contains("\"micro_link\":\"https://www.example.com\""));
|
||||
|
||||
// Verify deserialization
|
||||
WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo deserialized =
|
||||
gson.fromJson(json, WxPayApplyment4SubCreateRequest.SubjectInfo.MicroBizInfo.class);
|
||||
|
||||
// Verify MicroStoreInfo deserialization
|
||||
assertEquals(deserialized.getMicroStoreInfo().getMicroName(), "门店名称");
|
||||
assertEquals(deserialized.getMicroStoreInfo().getMicroAddressCode(), "440305");
|
||||
assertEquals(deserialized.getMicroStoreInfo().getMicroAddress(), "详细地址");
|
||||
assertEquals(deserialized.getMicroStoreInfo().getStoreEntrancePic(), "media_id_1");
|
||||
assertEquals(deserialized.getMicroStoreInfo().getMicroIndoorCopy(), "media_id_2");
|
||||
assertEquals(deserialized.getMicroStoreInfo().getStoreLongitude(), "113.941046");
|
||||
assertEquals(deserialized.getMicroStoreInfo().getStoreLatitude(), "22.546154");
|
||||
|
||||
// Verify MicroMobileInfo deserialization
|
||||
assertEquals(deserialized.getMicroMobileInfo().getMicroMobileName(), "流动经营名称");
|
||||
assertEquals(deserialized.getMicroMobileInfo().getMicroMobileCity(), "440305");
|
||||
assertEquals(deserialized.getMicroMobileInfo().getMicroMobileAddress(), "无");
|
||||
assertEquals(deserialized.getMicroMobileInfo().getMicroMobilePics().size(), 2);
|
||||
assertEquals(deserialized.getMicroMobileInfo().getMicroMobilePics(), Arrays.asList("media_id_3", "media_id_4"));
|
||||
|
||||
// Verify MicroOnlineInfo deserialization
|
||||
assertEquals(deserialized.getMicroOnlineInfo().getMicroOnlineStore(), "线上店铺名称");
|
||||
assertEquals(deserialized.getMicroOnlineInfo().getMicroEcName(), "电商平台名称");
|
||||
assertEquals(deserialized.getMicroOnlineInfo().getMicroQrcode(), "media_id_5");
|
||||
assertEquals(deserialized.getMicroOnlineInfo().getMicroLink(), "https://www.example.com");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user