This commit is contained in:
parent
e9a95d468a
commit
c4b56fbda0
|
|
@ -90,8 +90,8 @@ public class UpdateUserAction {
|
|||
AliyunDeviceInfo aliyunDeviceInfo = baseService.getAliyunDeviceInfoByUserId(userId);
|
||||
if (aliyunDeviceInfo == null) {
|
||||
aliyunDeviceInfo = new AliyunDeviceInfo();
|
||||
aliyunDeviceInfo.setAliyunDeviceId(deviceId);
|
||||
aliyunDeviceInfo.setUserId(userId);
|
||||
aliyunDeviceInfo.setAliyunDeviceId(deviceId);
|
||||
aliyunDeviceInfo.setPhoneType(phoneType);
|
||||
aliyunDeviceInfo.setBindTime(new Date());
|
||||
aliyunDeviceInfo.setLastUpdateTime(new Date());
|
||||
|
|
@ -100,12 +100,15 @@ public class UpdateUserAction {
|
|||
} else {
|
||||
aliyunDeviceInfo.setType(0);
|
||||
}
|
||||
return baseService.saveAliyunDeviceInfo(aliyunDeviceInfo);
|
||||
} else {
|
||||
aliyunDeviceInfo.setUserId(userId);
|
||||
aliyunDeviceInfo.setPhoneType(phoneType);
|
||||
aliyunDeviceInfo.setLastUpdateTime(new Date());
|
||||
aliyunDeviceInfo.setAliyunDeviceId(deviceId);
|
||||
return baseService.updateAliyunDeviceInfo(aliyunDeviceInfo);
|
||||
}
|
||||
return baseService.saveOrUpdateAliyunDeviceInfo(aliyunDeviceInfo);
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/userMessageIsRead.do")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,14 @@ import java.util.Date;
|
|||
@Table(name = "tbl_aliyun_device_info")
|
||||
public class AliyunDeviceInfo implements Serializable{
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
@Column(name="id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "aliyun_device_id")
|
||||
private String aliyunDeviceId;
|
||||
|
||||
|
|
@ -33,6 +40,14 @@ public class AliyunDeviceInfo implements Serializable{
|
|||
@Column(name="last_update_time",columnDefinition="timestamp")
|
||||
private Date lastUpdateTime;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAliyunDeviceId() {
|
||||
return aliyunDeviceId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,6 @@ public interface AliyunDeviceInfoService {
|
|||
AliyunDeviceInfo getAliyunDeviceInfo(String deviceId);
|
||||
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
|
||||
* @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
|
||||
public void saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
||||
this.aliyunDeviceInfoDao.saveOrUpdate(aliyunDeviceInfo);
|
||||
public void saveAliyunDeviceInfo(AliyunDeviceInfo 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
|
||||
public Object saveOrUpdateAliyunDeviceInfo(AliyunDeviceInfo aliyunDeviceInfo) {
|
||||
this.aliyunDeviceInfoService.saveOrUpdateAliyunDeviceInfo(aliyunDeviceInfo);
|
||||
public Object saveAliyunDeviceInfo(AliyunDeviceInfo 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(), "");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue