记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
047c734f
Commit
047c734f
authored
Oct 14, 2021
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交chime社交相关-屏蔽redis调用
parent
088c5337
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
55 deletions
+54
-55
RedisDataUtil.java
...java/com/liquidnet/service/chime/utils/RedisDataUtil.java
+54
-55
No files found.
liquidnet-bus-service/liquidnet-service-chime/liquidnet-service-chime-impl/src/main/java/com/liquidnet/service/chime/utils/RedisDataUtil.java
View file @
047c734f
package
com
.
liquidnet
.
service
.
chime
.
utils
;
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
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
...
...
@@ -32,31 +27,33 @@ public class RedisDataUtil {
*/
public
boolean
isPassedByPerformanceId
(
String
performanceId
){
log
.
info
(
"isPassedByPerformanceId param performanceId:{}"
,
performanceId
);
boolean
isPass
=
false
;
//允许的演出
Object
allowPerIds
=
redisUtil
.
getRedisTemplateByDb
(
250
).
opsForValue
().
get
(
ChimeConstant
.
REDIS_PERFORMANCE_IDS_ALLOW
);
log
.
info
(
"isPassedByPerformanceId allowPerIds:{}"
,
allowPerIds
);
if
(
StringUtil
.
isNotNull
(
allowPerIds
)){
String
perIds
=
(
String
)
allowPerIds
;
List
<
String
>
perIdsList
=
Arrays
.
asList
(
perIds
.
split
(
","
));
if
(
perIdsList
.
contains
(
performanceId
)){
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
)){
String
notPerIds
=
(
String
)
notAllowPerIds
;
List
<
String
>
notPerIdsList
=
Arrays
.
asList
(
notPerIds
.
split
(
","
));
if
(
notPerIdsList
.
contains
(
performanceId
)){
isPass
=
false
;
}
}
//设置为通过
boolean
isPass
=
true
;
// boolean isPass = false;
// //允许的演出
// Object allowPerIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_PERFORMANCE_IDS_ALLOW);
// log.info("isPassedByPerformanceId allowPerIds:{}",allowPerIds);
// if(StringUtil.isNotNull(allowPerIds)){
// String perIds = (String)allowPerIds;
// List<String> perIdsList = Arrays.asList(perIds.split(","));
// if(perIdsList.contains(performanceId)){
// 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)){
// String notPerIds = (String)notAllowPerIds;
// List<String> notPerIdsList = Arrays.asList(notPerIds.split(","));
// if(notPerIdsList.contains(performanceId)){
// isPass = false;
// }
// }
return
isPass
;
}
...
...
@@ -67,31 +64,33 @@ public class RedisDataUtil {
*/
public
boolean
isPassedByCityName
(
String
cityName
){
log
.
info
(
"isPassedByCityName param cityName:{}"
,
cityName
);
boolean
isPass
=
false
;
//允许的演出
Object
allowCityNameIds
=
redisUtil
.
getRedisTemplateByDb
(
250
).
opsForValue
().
get
(
ChimeConstant
.
REDIS_CITY_NAME_ALLOW
);
log
.
info
(
"isPassedByCityName allowCityNameIds:{}"
,
allowCityNameIds
);
if
(
StringUtil
.
isNotNull
(
allowCityNameIds
)){
String
perIds
=
(
String
)
allowCityNameIds
;
List
<
String
>
perIdsList
=
Arrays
.
asList
(
perIds
.
split
(
","
));
if
(
perIdsList
.
contains
(
cityName
)){
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
)){
String
notPerIds
=
(
String
)
notAllowCityNameIds
;
List
<
String
>
notPerIdsList
=
Arrays
.
asList
(
notPerIds
.
split
(
","
));
if
(
notPerIdsList
.
contains
(
cityName
)){
isPass
=
false
;
}
}
//设置为通过
boolean
isPass
=
true
;
// boolean isPass = false;
// //允许的演出
// Object allowCityNameIds = redisUtil.getRedisTemplateByDb(250).opsForValue().get(ChimeConstant.REDIS_CITY_NAME_ALLOW);
// log.info("isPassedByCityName allowCityNameIds:{}",allowCityNameIds);
// if(StringUtil.isNotNull(allowCityNameIds)){
// String perIds = (String)allowCityNameIds;
// List<String> perIdsList = Arrays.asList(perIds.split(","));
// if(perIdsList.contains(cityName)){
// 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)){
// String notPerIds = (String)notAllowCityNameIds;
// List<String> notPerIdsList = Arrays.asList(notPerIds.split(","));
// if(notPerIdsList.contains(cityName)){
// isPass = false;
// }
// }
return
isPass
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment