This commit is contained in:
2025-01-26 02:21:27 +08:00
parent 7bd9a7507f
commit 1b11342e5d
32 changed files with 310 additions and 133 deletions

View File

@ -70,8 +70,12 @@ public class DeviceRepository {
}
if (redisTemplate.hasKey(String.format(DEVICE_CACHE_KEY, deviceNo))) {
DeviceEntity device = getDeviceByDeviceNo(deviceNo);
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, device.getNo()));
clearDeviceCache(device.getId());
if (device != null) {
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, device.getNo()));
clearDeviceCache(device.getId());
} else {
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, deviceNo));
}
}
redisTemplate.delete(String.format(DEVICE_CACHE_KEY, deviceNo));
return true;

View File

@ -70,6 +70,9 @@ public class ScenicRepository {
return JSONObject.parseObject(redisTemplate.opsForValue().get(String.format(SCENIC_MP_NOTIFY_CACHE_KEY, scenicId)), ScenicMpNotifyVO.class);
}
MpConfigEntity mpConfig = getScenicMpConfig(scenicId);
if (mpConfig == null) {
return null;
}
ScenicMpNotifyVO mpNotifyConfig = new ScenicMpNotifyVO();
mpNotifyConfig.setAppId(mpConfig.getAppId());
mpNotifyConfig.setAppSecret(mpConfig.getAppSecret());

View File

@ -8,6 +8,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Objects;
@Component
public class SourceRepository {
@ -44,10 +45,16 @@ public class SourceRepository {
switch (type) {
case 1:
List<SourceEntity> videoSourceList = sourceMapper.listVideoByFaceRelation(userId, faceId);
return videoSourceList.stream().anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
if (videoSourceList == null || videoSourceList.isEmpty()) {
return false;
}
return videoSourceList.stream().filter(Objects::nonNull).anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
case 2:
List<SourceEntity> imageSourceList = sourceMapper.listImageByFaceRelation(userId, faceId);
return imageSourceList.stream().anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
if (imageSourceList == null || imageSourceList.isEmpty()) {
return false;
}
return imageSourceList.stream().filter(Objects::nonNull).anyMatch(item -> Integer.valueOf(1).equals(item.getIsBuy()));
default:
return false;
}