This commit is contained in:
parent
e9a95d468a
commit
c4b56fbda0
|
|
@ -90,8 +90,8 @@ public class UpdateUserAction {
|
||||||
AliyunDeviceInfo aliyunDeviceInfo = baseService.getAliyunDeviceInfoByUserId(userId);
|
AliyunDeviceInfo aliyunDeviceInfo = baseService.getAliyunDeviceInfoByUserId(userId);
|
||||||
if (aliyunDeviceInfo == null) {
|
if (aliyunDeviceInfo == null) {
|
||||||
aliyunDeviceInfo = new AliyunDeviceInfo();
|
aliyunDeviceInfo = new AliyunDeviceInfo();
|
||||||
aliyunDeviceInfo.setAliyunDeviceId(deviceId);
|
|
||||||
aliyunDeviceInfo.setUserId(userId);
|
aliyunDeviceInfo.setUserId(userId);
|
||||||
|
aliyunDeviceInfo.setAliyunDeviceId(deviceId);
|
||||||
aliyunDeviceInfo.setPhoneType(phoneType);
|
aliyunDeviceInfo.setPhoneType(phoneType);
|
||||||
aliyunDeviceInfo.setBindTime(new Date());
|
aliyunDeviceInfo.setBindTime(new Date());
|
||||||
aliyunDeviceInfo.setLastUpdateTime(new Date());
|
aliyunDeviceInfo.setLastUpdateTime(new Date());
|
||||||
|
|
@ -100,12 +100,15 @@ public class UpdateUserAction {
|
||||||
} else {
|
} else {
|
||||||
aliyunDeviceInfo.setType(0);
|
aliyunDeviceInfo.setType(0);
|
||||||
}
|
}
|
||||||
|
return baseService.saveAliyunDeviceInfo(aliyunDeviceInfo);
|
||||||
} else {
|
} else {
|
||||||
aliyunDeviceInfo.setUserId(userId);
|
aliyunDeviceInfo.setUserId(userId);
|
||||||
aliyunDeviceInfo.setPhoneType(phoneType);
|
aliyunDeviceInfo.setPhoneType(phoneType);
|
||||||
aliyunDeviceInfo.setLastUpdateTime(new Date());
|
aliyunDeviceInfo.setLastUpdateTime(new Date());
|
||||||
|
aliyunDeviceInfo.setAliyunDeviceId(deviceId);
|
||||||
|
return baseService.updateAliyunDeviceInfo(aliyunDeviceInfo);
|
||||||
}
|
}
|
||||||
return baseService.saveOrUpdateAliyunDeviceInfo(aliyunDeviceInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/userMessageIsRead.do")
|
@RequestMapping(value = "/userMessageIsRead.do")
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,14 @@ import java.util.Date;
|
||||||
@Table(name = "tbl_aliyun_device_info")
|
@Table(name = "tbl_aliyun_device_info")
|
||||||
public class AliyunDeviceInfo implements Serializable{
|
public class AliyunDeviceInfo implements Serializable{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
@Id
|
@Id
|
||||||
|
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||||
|
@Column(name="id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
@Column(name = "aliyun_device_id")
|
@Column(name = "aliyun_device_id")
|
||||||
private String aliyunDeviceId;
|
private String aliyunDeviceId;
|
||||||
|
|
||||||
|
|
@ -33,6 +40,14 @@ public class AliyunDeviceInfo implements Serializable{
|
||||||
@Column(name="last_update_time",columnDefinition="timestamp")
|
@Column(name="last_update_time",columnDefinition="timestamp")
|
||||||
private Date lastUpdateTime;
|
private Date lastUpdateTime;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAliyunDeviceId() {
|
public String getAliyunDeviceId() {
|
||||||
return aliyunDeviceId;
|
return aliyunDeviceId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,6 @@ public interface AliyunDeviceInfoService {
|
||||||
AliyunDeviceInfo getAliyunDeviceInfo(String deviceId);
|
AliyunDeviceInfo getAliyunDeviceInfo(String deviceId);
|
||||||
AliyunDeviceInfo getAliyunDeviceInfoByUserId(Integer userId);
|
AliyunDeviceInfo getAliyunDeviceInfoByUserId(Integer userId);
|
||||||
|
|
||||||
void saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo);
|
void saveAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo);
|
||||||
|
void updateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,14 @@ public interface BaseService {
|
||||||
* @param aliyunDeviceInfo
|
* @param aliyunDeviceInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Object saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo);
|
Object saveAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存或修改阿里云推送设备信息
|
||||||
|
* @param aliyunDeviceInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Object updateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户消息已读
|
* 用户消息已读
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,12 @@ public class AliyunDeviceInfoServiceImpl implements AliyunDeviceInfoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
public void saveAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
||||||
this.aliyunDeviceInfoDao.saveOrUpdate(aliyunDeviceInfo);
|
this.aliyunDeviceInfoDao.save(aliyunDeviceInfo);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void updateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
||||||
|
this.aliyunDeviceInfoDao.update(aliyunDeviceInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2056,8 +2056,14 @@ public class BaseServiceImpl implements BaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
public Object saveAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
||||||
this.aliyunDeviceInfoService.saveOrUpdateAliyunDeviceInfo(aliyunDeviceInfo);
|
this.aliyunDeviceInfoService.saveAliyunDeviceInfo(aliyunDeviceInfo);
|
||||||
|
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object updateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
||||||
|
this.aliyunDeviceInfoService.updateAliyunDeviceInfo(aliyunDeviceInfo);
|
||||||
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
return IfishUtil.returnJson(ResultEnum.success.getKey(), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue