记得上下班打卡 | git大法好,push需谨慎

Commit 86293e3b authored by jiangxiulong's avatar jiangxiulong

add phone

parent 60885c98
...@@ -41,8 +41,12 @@ public class SweetOpenSendMsgParam implements Serializable { ...@@ -41,8 +41,12 @@ public class SweetOpenSendMsgParam implements Serializable {
@ApiModelProperty(position = 17, value = "跳转小程序需要的某页地址", example = "pages/webview?query=lottery") @ApiModelProperty(position = 17, value = "跳转小程序需要的某页地址", example = "pages/webview?query=lottery")
private String jumpAppletPagePath; private String jumpAppletPagePath;
@ApiModelProperty(position = 18, required = true, value = "openId", example = "oUpkkuNe4yuVs77aaKFvuvpgNOSw") /*@ApiModelProperty(position = 18, required = true, value = "openId", example = "oUpkkuNe4yuVs77aaKFvuvpgNOSw")
@NotBlank(message = "openId不能为空") @NotBlank(message = "openId不能为空")
private String openId; private String openId;*/
@ApiModelProperty(position = 18, required = true, value = "phone", example = "15888888888")
@NotBlank(message = "phone不能为空")
private String phone;
} }
package com.liquidnet.service.consumer.sweet.service.impl; package com.liquidnet.service.consumer.sweet.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.consumer.sweet.config.wechat.WechatMaConfigure; import com.liquidnet.service.consumer.sweet.config.wechat.WechatMaConfigure;
import com.liquidnet.service.consumer.sweet.config.wechat.WechatMpConfigure; import com.liquidnet.service.consumer.sweet.config.wechat.WechatMpConfigure;
import com.liquidnet.service.consumer.sweet.param.SweetOpenSendMsgParam; import com.liquidnet.service.consumer.sweet.param.SweetOpenSendMsgParam;
...@@ -36,9 +35,9 @@ public class SweetWechatTemplateServiceImpl { ...@@ -36,9 +35,9 @@ public class SweetWechatTemplateServiceImpl {
public Boolean openSendMsg(SweetOpenSendMsgParam param) { public Boolean openSendMsg(SweetOpenSendMsgParam param) {
WxMpTemplateMessage templateMessage = null; WxMpTemplateMessage templateMessage = null;
if (param.getJumpType() == 5) { if (param.getJumpType() == 5) {
templateMessage = getTemplateMessage(param.getTemplateId(), param.getOpenId(), param.getJumpUrl()); templateMessage = getTemplateMessage(param.getTemplateId(), param.getPhone(), param.getJumpUrl());
} else { } else {
templateMessage = getTemplateMessage(param.getTemplateId(), param.getOpenId(), param.getJumpType(), param.getJumpAppletPagePath(), param.getJumpAppletUsePath()); templateMessage = getTemplateMessage(param.getTemplateId(), param.getPhone(), param.getJumpType(), param.getJumpAppletPagePath(), param.getJumpAppletUsePath());
} }
// 添加模板数据 // 添加模板数据
String templateData = param.getTemplateData(); String templateData = param.getTemplateData();
...@@ -62,15 +61,15 @@ public class SweetWechatTemplateServiceImpl { ...@@ -62,15 +61,15 @@ public class SweetWechatTemplateServiceImpl {
* @param url * @param url
* @return * @return
*/ */
private WxMpTemplateMessage getTemplateMessage(String templateId, String openId, String url) { private WxMpTemplateMessage getTemplateMessage(String templateId, String phone, String url) {
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder() WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
.toUser(openId) // 接收者openid // .toUser(openId) // 接收者openid
.templateId(templateId) // 模板id .templateId(templateId) // 模板id
.url(url) // 模板跳转链接 .url(url) // 模板跳转链接
.build(); .build();
return templateMessage; return templateMessage;
} }
private WxMpTemplateMessage getTemplateMessage(String templateId, String openId, Integer jumpType, String jumpAppletPagePath, Boolean jumpAppletUsePath) { private WxMpTemplateMessage getTemplateMessage(String templateId, String phone, Integer jumpType, String jumpAppletPagePath, Boolean jumpAppletUsePath) {
//配置小程序信息 //配置小程序信息
WxMpTemplateMessage.MiniProgram miniProgram = new WxMpTemplateMessage.MiniProgram(); WxMpTemplateMessage.MiniProgram miniProgram = new WxMpTemplateMessage.MiniProgram();
miniProgram.setAppid(wechatMaConfigure.getWxMaAppid(jumpType));//小程序appid miniProgram.setAppid(wechatMaConfigure.getWxMaAppid(jumpType));//小程序appid
...@@ -78,7 +77,7 @@ public class SweetWechatTemplateServiceImpl { ...@@ -78,7 +77,7 @@ public class SweetWechatTemplateServiceImpl {
miniProgram.setPagePath(jumpAppletPagePath);//用户点击时需要跳转的小程序页面 miniProgram.setPagePath(jumpAppletPagePath);//用户点击时需要跳转的小程序页面
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder() WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
.toUser(openId) // 接收者openid // .toUser(openId) // 接收者openid
.templateId(templateId) // 模板id .templateId(templateId) // 模板id
.miniProgram(miniProgram) // 模板跳转链接 .miniProgram(miniProgram) // 模板跳转链接
.build(); .build();
......
...@@ -38,8 +38,12 @@ public class SweetOpenSendMsgParam implements Serializable { ...@@ -38,8 +38,12 @@ public class SweetOpenSendMsgParam implements Serializable {
@ApiModelProperty(position = 17, value = "跳转小程序需要的某页地址", example = "pages/webview?query=lottery") @ApiModelProperty(position = 17, value = "跳转小程序需要的某页地址", example = "pages/webview?query=lottery")
private String jumpAppletPagePath; private String jumpAppletPagePath;
@ApiModelProperty(position = 18, required = true, value = "openId", example = "oUpkkuNe4yuVs77aaKFvuvpgNOSw") /*@ApiModelProperty(position = 18, required = true, value = "openId", example = "oUpkkuNe4yuVs77aaKFvuvpgNOSw")
@NotBlank(message = "openId不能为空") @NotBlank(message = "openId不能为空")
private String openId; private String openId;*/
@ApiModelProperty(position = 18, required = true, value = "phone", example = "15888888888")
@NotBlank(message = "phone不能为空")
private String phone;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment