|
@@ -51,6 +51,14 @@ public class PushUtil {
|
|
|
log.error("用户id:{}没有推送id", userId);
|
|
log.error("用户id:{}没有推送id", userId);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 必须为true,否则无法推送
|
|
|
|
|
+ pushDto.setDev(true);
|
|
|
|
|
+ if (pushDto.getContent().length() > NumberEnum.FIFTY.number) {
|
|
|
|
|
+ pushDto.setContent(pushDto.getContent().substring(0, 50));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (pushDto.getTitle().length() > NumberEnum.TWENTY.number) {
|
|
|
|
|
+ pushDto.setTitle(pushDto.getTitle().substring(0, 20));
|
|
|
|
|
+ }
|
|
|
pushDto.setCId(userPush.getCid());
|
|
pushDto.setCId(userPush.getCid());
|
|
|
pushDto.setRequestId(IdUtil.getSnowflakeNextIdStr());
|
|
pushDto.setRequestId(IdUtil.getSnowflakeNextIdStr());
|
|
|
try {
|
|
try {
|
|
@@ -84,6 +92,9 @@ public class PushUtil {
|
|
|
if (pushDto.getContent().length() > NumberEnum.FIFTY.number) {
|
|
if (pushDto.getContent().length() > NumberEnum.FIFTY.number) {
|
|
|
pushDto.setContent(pushDto.getContent().substring(0, 50));
|
|
pushDto.setContent(pushDto.getContent().substring(0, 50));
|
|
|
}
|
|
}
|
|
|
|
|
+ if (pushDto.getTitle().length() > NumberEnum.TWENTY.number) {
|
|
|
|
|
+ pushDto.setTitle(pushDto.getTitle().substring(0, 20));
|
|
|
|
|
+ }
|
|
|
List<UserPushCid> userPushCidList = userPushCidMapper.selectList(new LambdaQueryWrapper<UserPushCid>().in(UserPushCid::getUserId, userIds).eq(UserPushCid::getStatus, 1));
|
|
List<UserPushCid> userPushCidList = userPushCidMapper.selectList(new LambdaQueryWrapper<UserPushCid>().in(UserPushCid::getUserId, userIds).eq(UserPushCid::getStatus, 1));
|
|
|
if (CollectionUtil.isEmpty(userPushCidList)) {
|
|
if (CollectionUtil.isEmpty(userPushCidList)) {
|
|
|
return null;
|
|
return null;
|