Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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,6 +16,14 @@ public interface WxMpMemberCardService {
*/
WxMpService getWxMpService();

/**
* 会员卡创建接口
* @param createJson
* @return
* @throws WxErrorException
*/
String createMemberCard(String createJson) throws WxErrorException;

/**
* 会员卡创建接口
* @param createMessageMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ public WxMpService getWxMpService() {
return this.wxMpService;
}

/**
* 会员卡创建接口
*
* @param createJson 创建json
* @return 调用返回的JSON字符串。
* @throws WxErrorException 接口调用失败抛出的异常
*/
@Override
public String createMemberCard(String createJson) throws WxErrorException {
return this.wxMpService.post(MEMBER_CARD_CREAET, createJson);
}

/**
* 会员卡创建接口
*
Expand All @@ -57,9 +69,9 @@ public String createMemberCard(WxMpMemberCardCreateMessage createMessageMessage)
JsonObject cardJson = new JsonObject();
jsonObject.add("card", cardJson);
cardJson.addProperty("card_type","MEMBER_CARD");
cardJson.addProperty("member_card",createMessageMessage.toString());
cardJson.addProperty("member_card",GSON.toJson(createMessageMessage));

return this.wxMpService.post(MEMBER_CARD_CREAET, GSON.toJson(jsonObject));
return createMemberCard(GSON.toJson(jsonObject));
}

/**
Expand Down