|
|
@@ -5,14 +5,11 @@ import com.nb.app.assistant.api.bean.DeviceAlarmBean;
|
|
|
import com.nb.app.assistant.api.feign.IAppIphoneClient;
|
|
|
import com.nb.app.assistant.dto.IphoneDeviceDTO;
|
|
|
import com.nb.app.assistant.utils.ApnsUtils;
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
import org.redisson.api.RSet;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
@@ -31,12 +28,12 @@ public class LocalAppIphoneService implements IAppIphoneClient {
|
|
|
private LocalAppIphoneService self;
|
|
|
|
|
|
public void addDeviceToken(IphoneDeviceDTO source){
|
|
|
- RSet<String> tenantSet = redissonClient.getSet(source.getTenantId());
|
|
|
+ RSet<String> tenantSet = redissonClient.getSet("ios:"+source.getTenantId());
|
|
|
tenantSet.add(source.getDeviceToken());
|
|
|
}
|
|
|
|
|
|
public void removeDeviceToken(IphoneDeviceDTO source){
|
|
|
- RSet<String> tenantSet = redissonClient.getSet(source.getTenantId());
|
|
|
+ RSet<String> tenantSet = redissonClient.getSet("ios:"+source.getTenantId());
|
|
|
tenantSet.remove(source.getDeviceToken());
|
|
|
}
|
|
|
|
|
|
@@ -46,7 +43,7 @@ public class LocalAppIphoneService implements IAppIphoneClient {
|
|
|
}
|
|
|
|
|
|
public void sendMsg(String tenantId, DeviceAlarmBean source){
|
|
|
- RSet<String> tenantSet = redissonClient.getSet(tenantId);
|
|
|
+ RSet<String> tenantSet = redissonClient.getSet("ios:"+tenantId);
|
|
|
Set<String> deviceTokenSet = tenantSet.readAll();
|
|
|
if (CollectionUtil.isNotEmpty(deviceTokenSet)) {
|
|
|
deviceTokenSet.parallelStream()
|