Browse Source

# 消息推送bug

zhongwei
haungxing 2 years ago
parent
commit
1fa49d1398
  1. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessageService.java
  2. 4
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MailMessageServiceImpl.java
  3. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/PushMessageServiceImpl.java
  4. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java
  5. 4
      hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WebsocketServiceImpl.java

2
hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessageService.java

@ -17,6 +17,6 @@ public interface IMessageService {
*/
<T extends PushDto> R<String> send(T pushObject);
Boolean send(MessagePushRecordEntity request);
boolean send(MessagePushRecordEntity request);
}

4
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MailMessageServiceImpl.java

@ -77,8 +77,8 @@ public class MailMessageServiceImpl implements IMessageService {
}
@Override
public Boolean send(MessagePushRecordEntity request) {
return null;
public boolean send(MessagePushRecordEntity request) {
return false;
}
}

2
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/PushMessageServiceImpl.java

@ -85,7 +85,7 @@ public class PushMessageServiceImpl implements IMessageService {
}
@Override
public Boolean send(MessagePushRecordEntity request) {
public boolean send(MessagePushRecordEntity request) {
PushInfoVO pushInfoVO = new PushInfoVO();
pushInfoVO.setTenantId(Func.isNotEmpty(AuthUtil.getTenantId()) ? AuthUtil.getTenantId() : request.getTenantId());
ArrayList<PlatformType> platformTypes = Lists.newArrayList(PlatformType.Android, PlatformType.IOS);

2
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java

@ -47,7 +47,7 @@ public class SmsMessageServiceImpl implements IMessageService {
}
@Override
public Boolean send(MessagePushRecordEntity request) {
public boolean send(MessagePushRecordEntity request) {
R<SmsResponse> response = smsClient.sendMessage(
Func.isNotEmpty(AuthUtil.getTenantId()) ? AuthUtil.getTenantId() : request.getTenantId(),
request.getResourceCode(),

4
hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WebsocketServiceImpl.java

@ -86,7 +86,7 @@ public class WebsocketServiceImpl implements IMessageService {
}
@Override
public Boolean send(MessagePushRecordEntity request) {
public boolean send(MessagePushRecordEntity request) {
String userId = request.getAccount();
request.setPushTime(LocalDateTime.now());
WebSocketSession webSocketSession = SessionManager.SESSION_POOL.get(userId);
@ -104,6 +104,6 @@ public class WebsocketServiceImpl implements IMessageService {
redisTemplate.opsForList().leftPush(key,message);
redisTemplate.expire(key,24, TimeUnit.HOURS);
}
return null;
return true;
}
}

Loading…
Cancel
Save