Commit 7b4c62b2 authored by hezhen's avatar hezhen

123

parent ffa8b15d
......@@ -12,6 +12,7 @@ import cn.jpush.api.push.model.Platform;
import cn.jpush.api.push.model.PushPayload;
import cn.jpush.api.push.model.audience.Audience;
import cn.jpush.api.push.model.notification.AndroidNotification;
import cn.jpush.api.push.model.notification.IosNotification;
import cn.jpush.api.push.model.notification.Notification;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
......@@ -178,7 +179,7 @@ public class JPushBiz extends BaseBiz<MessagePushMapper, MessagePush> {
String [] userIdList=userIds.split(",");
audience=Audience.alias(userIdList);
}else {
if (debug){
if (!debug){
String [] userIdList=userIds.split(",");
audience=Audience.alias(userIdList);
}
......@@ -187,7 +188,7 @@ public class JPushBiz extends BaseBiz<MessagePushMapper, MessagePush> {
if (StringUtils.isNotBlank(messagePush.getIntent())){
intent= getJsonObject(messagePush.getIntent());
}
Map<String, String> extras = new HashMap<String, String>();
Map<String, String> extras = new HashMap<>();
extras.put("onclickType",messagePush.getJumpType()+"");
if (StringUtils.isNotBlank(orderNo)){
extras.put("orderNo",orderNo);
......@@ -206,13 +207,20 @@ public class JPushBiz extends BaseBiz<MessagePushMapper, MessagePush> {
.setIntent(intent)
.addExtras(extras)
.build())
.addPlatformNotification(IosNotification.newBuilder()
.setAlert(messagePush.getAlert())
.setBadge(1)
.setSound("default")
.setMutableContent(true)
.addExtras(setExtras(extras,messagePush))
.build())
.build();
return PushPayload.newBuilder()
.setPlatform(Platform.all())
.setAudience(audience)
.setNotification(notification)
.setOptions(Options.newBuilder()
.setApnsProduction(true)
.setApnsProduction(debug)
.setSendno(ServiceHelper.generateSendno())
.build())
.build();
......@@ -225,6 +233,21 @@ public class JPushBiz extends BaseBiz<MessagePushMapper, MessagePush> {
}
public Map<String, String> setExtras(Map<String, String> extras,MessagePush messagePush){
Integer style=messagePush.getStyle();
switch (style){
case 1:
extras.put("push_title",messagePush.getTitle());
case 2:
extras.put("push_title",messagePush.getTitle());
case 3:
extras.put("push_title",messagePush.getTitle());
extras.put("big_pic_path",messagePush.getBigPicPath());
}
return extras;
}
//编辑推送内容
public ObjectRestResponse updMessagePush(MessagePush messagePush){
Integer id= messagePush.getId();
......
......@@ -15,7 +15,7 @@ import java.util.concurrent.Executors;
@Service
public class MailServiceBiz {
@Autowired
//@Autowired
JavaMailSender mailSender;
public void sendSimpleMail(String to, String subject, String content) {
......
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