You've already forked FrameTour-BE
2
This commit is contained in:
@ -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;
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user