推送修改
This commit is contained in:
parent
d70e2a6b8b
commit
c4dd411167
|
|
@ -24,7 +24,7 @@ public class Tbl_User implements java.io.Serializable {
|
||||||
/**
|
/**
|
||||||
* 版本号
|
* 版本号
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -3293426131332327827L;
|
private static final long serialVersionUID = -7318879296790573758L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户Id
|
* 用户Id
|
||||||
|
|
@ -99,6 +99,11 @@ public class Tbl_User implements java.io.Serializable {
|
||||||
@Column(name = "create_time", nullable = true)
|
@Column(name = "create_time", nullable = true)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* */
|
||||||
|
@Column(name = "phone_type", nullable = true, length = 10)
|
||||||
|
private String phoneType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登陆手机类型
|
* 登陆手机类型
|
||||||
*/
|
*/
|
||||||
|
|
@ -147,6 +152,11 @@ public class Tbl_User implements java.io.Serializable {
|
||||||
@Column(name = "jiguang_userid", nullable = true, length = 50)
|
@Column(name = "jiguang_userid", nullable = true, length = 50)
|
||||||
private String jiguangUserid;
|
private String jiguangUserid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* */
|
||||||
|
@Column(name = "token", nullable = true, length = 50)
|
||||||
|
private String token;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 经度
|
* 经度
|
||||||
*/
|
*/
|
||||||
|
|
@ -375,6 +385,25 @@ public class Tbl_User implements java.io.Serializable {
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getPhoneType() {
|
||||||
|
return this.phoneType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置
|
||||||
|
*
|
||||||
|
* @param phoneType
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setPhoneType(String phoneType) {
|
||||||
|
this.phoneType = phoneType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取登陆手机类型
|
* 获取登陆手机类型
|
||||||
*
|
*
|
||||||
|
|
@ -519,6 +548,25 @@ public class Tbl_User implements java.io.Serializable {
|
||||||
this.jiguangUserid = jiguangUserid;
|
this.jiguangUserid = jiguangUserid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getToken() {
|
||||||
|
return this.token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置
|
||||||
|
*
|
||||||
|
* @param token
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setToken(String token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取经度
|
* 获取经度
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,12 @@ package com.ifish.helper;
|
||||||
|
|
||||||
import cn.jpush.api.JPushClient;
|
import cn.jpush.api.JPushClient;
|
||||||
import cn.jpush.api.push.PushResult;
|
import cn.jpush.api.push.PushResult;
|
||||||
|
import cn.jpush.api.push.model.Message;
|
||||||
|
import cn.jpush.api.push.model.Options;
|
||||||
import cn.jpush.api.push.model.Platform;
|
import cn.jpush.api.push.model.Platform;
|
||||||
import cn.jpush.api.push.model.PushPayload;
|
import cn.jpush.api.push.model.PushPayload;
|
||||||
import cn.jpush.api.push.model.audience.Audience;
|
import cn.jpush.api.push.model.audience.Audience;
|
||||||
|
import cn.jpush.api.push.model.notification.IosNotification;
|
||||||
import cn.jpush.api.push.model.notification.Notification;
|
import cn.jpush.api.push.model.notification.Notification;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -46,6 +49,7 @@ public class JpushHelper implements JpushHelperI {
|
||||||
.setPlatform(Platform.android())
|
.setPlatform(Platform.android())
|
||||||
.setAudience(Audience.alias(userId))
|
.setAudience(Audience.alias(userId))
|
||||||
.setNotification(Notification.android(title, message, map))
|
.setNotification(Notification.android(title, message, map))
|
||||||
|
.setMessage(Message.newBuilder().setTitle(title).setMsgContent(message).addExtras(map).build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
PushResult result = jPushClient.sendPush(payload);
|
PushResult result = jPushClient.sendPush(payload);
|
||||||
|
|
@ -70,7 +74,9 @@ public class JpushHelper implements JpushHelperI {
|
||||||
PushPayload payload = PushPayload.newBuilder()
|
PushPayload payload = PushPayload.newBuilder()
|
||||||
.setPlatform(Platform.ios())
|
.setPlatform(Platform.ios())
|
||||||
.setAudience(Audience.alias(userId))
|
.setAudience(Audience.alias(userId))
|
||||||
.setNotification(Notification.ios(message, map))
|
.setNotification(Notification.newBuilder().addPlatformNotification(IosNotification.newBuilder().setSound("happy").setAlert(message).build()).build())
|
||||||
|
.setMessage(Message.newBuilder().setTitle(title).setMsgContent(message).addExtras(map).build())
|
||||||
|
.setOptions(Options.newBuilder().setApnsProduction(false).build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
PushResult result = jPushClient.sendPush(payload);
|
PushResult result = jPushClient.sendPush(payload);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue