记得上下班打卡 | git大法好,push需谨慎

Commit 047c734f authored by anjiabin's avatar anjiabin

提交chime社交相关-屏蔽redis调用

parent 088c5337
package com.liquidnet.service.chime.utils; package com.liquidnet.service.chime.utils;
import com.liquidnet.common.cache.redis.util.RedisUtil; import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.chime.constant.ChimeConstant;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0 * @version V1.0
...@@ -32,31 +27,33 @@ public class RedisDataUtil { ...@@ -32,31 +27,33 @@ public class RedisDataUtil {
*/ */
public boolean isPassedByPerformanceId(String performanceId){ public boolean isPassedByPerformanceId(String performanceId){
log.info("isPassedByPerformanceId param performanceId:{}",performanceId); log.info("isPassedByPerformanceId param performanceId:{}",performanceId);
boolean isPass = false; //设置为通过
//允许的演出 boolean isPass = true;
Object allowPerIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_PERFORMANCE_IDS_ALLOW); // boolean isPass = false;
log.info("isPassedByPerformanceId allowPerIds:{}",allowPerIds); // //允许的演出
if(StringUtil.isNotNull(allowPerIds)){ // Object allowPerIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_PERFORMANCE_IDS_ALLOW);
String perIds = (String)allowPerIds; // log.info("isPassedByPerformanceId allowPerIds:{}",allowPerIds);
List<String> perIdsList = Arrays.asList(perIds.split(",")); // if(StringUtil.isNotNull(allowPerIds)){
if(perIdsList.contains(performanceId)){ // String perIds = (String)allowPerIds;
isPass = true; // List<String> perIdsList = Arrays.asList(perIds.split(","));
} // if(perIdsList.contains(performanceId)){
//如果为-1 则全部允许 // isPass = true;
if(perIdsList.contains("-1")){ // }
isPass = true; // //如果为-1 则全部允许
} // if(perIdsList.contains("-1")){
} // isPass = true;
//演出黑名单 // }
Object notAllowPerIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_PERFORMANCE_IDS_NOT_ALLOW); // }
log.info("isPassedByPerformanceId notAllowPerIds:{}",notAllowPerIds); // //演出黑名单
if(StringUtil.isNotNull(notAllowPerIds)){ // Object notAllowPerIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_PERFORMANCE_IDS_NOT_ALLOW);
String notPerIds = (String)notAllowPerIds; // log.info("isPassedByPerformanceId notAllowPerIds:{}",notAllowPerIds);
List<String> notPerIdsList = Arrays.asList(notPerIds.split(",")); // if(StringUtil.isNotNull(notAllowPerIds)){
if(notPerIdsList.contains(performanceId)){ // String notPerIds = (String)notAllowPerIds;
isPass = false; // List<String> notPerIdsList = Arrays.asList(notPerIds.split(","));
} // if(notPerIdsList.contains(performanceId)){
} // isPass = false;
// }
// }
return isPass; return isPass;
} }
...@@ -67,31 +64,33 @@ public class RedisDataUtil { ...@@ -67,31 +64,33 @@ public class RedisDataUtil {
*/ */
public boolean isPassedByCityName(String cityName){ public boolean isPassedByCityName(String cityName){
log.info("isPassedByCityName param cityName:{}",cityName); log.info("isPassedByCityName param cityName:{}",cityName);
boolean isPass = false; //设置为通过
//允许的演出 boolean isPass = true;
Object allowCityNameIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_CITY_NAME_ALLOW); // boolean isPass = false;
log.info("isPassedByCityName allowCityNameIds:{}",allowCityNameIds); // //允许的演出
if(StringUtil.isNotNull(allowCityNameIds)){ // Object allowCityNameIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_CITY_NAME_ALLOW);
String perIds = (String)allowCityNameIds; // log.info("isPassedByCityName allowCityNameIds:{}",allowCityNameIds);
List<String> perIdsList = Arrays.asList(perIds.split(",")); // if(StringUtil.isNotNull(allowCityNameIds)){
if(perIdsList.contains(cityName)){ // String perIds = (String)allowCityNameIds;
isPass = true; // List<String> perIdsList = Arrays.asList(perIds.split(","));
} // if(perIdsList.contains(cityName)){
//如果为-1 则全部允许 // isPass = true;
if(perIdsList.contains("-1")){ // }
isPass = true; // //如果为-1 则全部允许
} // if(perIdsList.contains("-1")){
} // isPass = true;
//不允许的演出 // }
Object notAllowCityNameIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_CITY_NAME_NOT_ALLOW); // }
log.info("isPassedByCityName notAllowCityNameIds:{}",notAllowCityNameIds); // //不允许的演出
if(StringUtil.isNotNull(notAllowCityNameIds)){ // Object notAllowCityNameIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_CITY_NAME_NOT_ALLOW);
String notPerIds = (String)notAllowCityNameIds; // log.info("isPassedByCityName notAllowCityNameIds:{}",notAllowCityNameIds);
List<String> notPerIdsList = Arrays.asList(notPerIds.split(",")); // if(StringUtil.isNotNull(notAllowCityNameIds)){
if(notPerIdsList.contains(cityName)){ // String notPerIds = (String)notAllowCityNameIds;
isPass = false; // List<String> notPerIdsList = Arrays.asList(notPerIds.split(","));
} // if(notPerIdsList.contains(cityName)){
} // isPass = false;
// }
// }
return isPass; return isPass;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment