记得上下班打卡 | 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
3fb3befc
Commit
3fb3befc
authored
Sep 22, 2021
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交chime社交相关
parent
583d48a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
3 deletions
+85
-3
ChimeUserBiz.java
...in/java/com/liquidnet/service/chime/biz/ChimeUserBiz.java
+15
-0
RedisDataUtil.java
...java/com/liquidnet/service/chime/utils/RedisDataUtil.java
+59
-2
TestRedis.java
...test/java/com/liquidnet/service/chime/test/TestRedis.java
+11
-1
No files found.
liquidnet-bus-service/liquidnet-service-chime/liquidnet-service-chime-impl/src/main/java/com/liquidnet/service/chime/biz/ChimeUserBiz.java
View file @
3fb3befc
...
@@ -14,6 +14,7 @@ import com.liquidnet.service.chime.dto.ChimeUserTagDto;
...
@@ -14,6 +14,7 @@ import com.liquidnet.service.chime.dto.ChimeUserTagDto;
import
com.liquidnet.service.chime.dto.PerformanceDto
;
import
com.liquidnet.service.chime.dto.PerformanceDto
;
import
com.liquidnet.service.chime.utils.DataUtils
;
import
com.liquidnet.service.chime.utils.DataUtils
;
import
com.liquidnet.service.chime.utils.ObjectUtil
;
import
com.liquidnet.service.chime.utils.ObjectUtil
;
import
com.liquidnet.service.chime.utils.RedisDataUtil
;
import
com.liquidnet.service.chime.vo.mongo.ChimeUserTagsMappingVo
;
import
com.liquidnet.service.chime.vo.mongo.ChimeUserTagsMappingVo
;
import
com.liquidnet.service.feign.adam.api.FeignAdamBaseClient
;
import
com.liquidnet.service.feign.adam.api.FeignAdamBaseClient
;
import
com.liquidnet.service.feign.kylin.api.FeignKylinForChimeClient
;
import
com.liquidnet.service.feign.kylin.api.FeignKylinForChimeClient
;
...
@@ -43,6 +44,9 @@ public class ChimeUserBiz {
...
@@ -43,6 +44,9 @@ public class ChimeUserBiz {
@Autowired
@Autowired
private
DataUtils
dataUtils
;
private
DataUtils
dataUtils
;
@Autowired
private
RedisDataUtil
redisDataUtil
;
@Autowired
@Autowired
private
FeignKylinForChimeClient
feignKylinForChimeClient
;
private
FeignKylinForChimeClient
feignKylinForChimeClient
;
...
@@ -122,6 +126,17 @@ public class ChimeUserBiz {
...
@@ -122,6 +126,17 @@ public class ChimeUserBiz {
List
<
ChimeJoinUserCountDto
>
joinUserCountDtoList
=
dataUtils
.
getJoinUserCountList
(
performancesIdList
);
List
<
ChimeJoinUserCountDto
>
joinUserCountDtoList
=
dataUtils
.
getJoinUserCountList
(
performancesIdList
);
for
(
KylinPerformanceVo
performanceVo:
performanceVoList
){
for
(
KylinPerformanceVo
performanceVo:
performanceVoList
){
/**
* 过滤演出
*/
boolean
perIsAllow
=
redisDataUtil
.
isPassedByPerformanceId
(
performanceVo
.
getPerformancesId
());
boolean
cityIsAllow
=
redisDataUtil
.
isPassedByCityName
(
performanceVo
.
getCityName
());
log
.
info
(
"buildPerformanceDtoList perIsAllow:{} "
,
perIsAllow
);
log
.
info
(
"buildPerformanceDtoList cityIsAllow:{} "
,
cityIsAllow
);
if
(!
perIsAllow
||!
cityIsAllow
){
continue
;
}
PerformanceDto
dto
=
PerformanceDto
.
getNew
();
PerformanceDto
dto
=
PerformanceDto
.
getNew
();
dto
.
setPerformancesId
(
performanceVo
.
getPerformancesId
());
dto
.
setPerformancesId
(
performanceVo
.
getPerformancesId
());
dto
.
setTitle
(
performanceVo
.
getTitle
());
dto
.
setTitle
(
performanceVo
.
getTitle
());
...
...
liquidnet-bus-service/liquidnet-service-chime/liquidnet-service-chime-impl/src/main/java/com/liquidnet/service/chime/utils/RedisDataUtil.java
View file @
3fb3befc
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
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
...
@@ -13,6 +19,7 @@ import org.springframework.stereotype.Component;
...
@@ -13,6 +19,7 @@ import org.springframework.stereotype.Component;
* @Copyright: LightNet @ Copyright (c) 2021
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/9/22 11:08
* @date 2021/9/22 11:08
*/
*/
@Slf4j
@Component
@Component
public
class
RedisDataUtil
{
public
class
RedisDataUtil
{
@Autowired
@Autowired
...
@@ -24,7 +31,32 @@ public class RedisDataUtil {
...
@@ -24,7 +31,32 @@ public class RedisDataUtil {
* @return
* @return
*/
*/
public
boolean
isPassedByPerformanceId
(
String
performanceId
){
public
boolean
isPassedByPerformanceId
(
String
performanceId
){
return
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
;
}
}
/**
/**
...
@@ -33,6 +65,31 @@ public class RedisDataUtil {
...
@@ -33,6 +65,31 @@ public class RedisDataUtil {
* @return
* @return
*/
*/
public
boolean
isPassedByCityName
(
String
cityName
){
public
boolean
isPassedByCityName
(
String
cityName
){
return
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
;
}
}
}
}
liquidnet-bus-service/liquidnet-service-chime/liquidnet-service-chime-impl/src/test/java/com/liquidnet/service/chime/test/TestRedis.java
View file @
3fb3befc
package
com
.
liquidnet
.
service
.
chime
.
test
;
package
com
.
liquidnet
.
service
.
chime
.
test
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.service.chime.constant.ChimeConstant
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
...
@@ -25,6 +26,15 @@ public class TestRedis {
...
@@ -25,6 +26,15 @@ public class TestRedis {
private
RedisUtil
redisUtil
;
private
RedisUtil
redisUtil
;
@Test
@Test
public
void
getPayCodeList
()
{
public
void
setCityName
()
{
String
allowCity
=
"山西|北京"
;
String
notAllowCity
=
"北京|天津"
;
redisUtil
.
getRedisTemplateByDb
(
250
).
opsForValue
().
set
(
ChimeConstant
.
REDIS_CITY_NAME_ALLOW
,
allowCity
);
redisUtil
.
getRedisTemplateByDb
(
250
).
opsForValue
().
set
(
ChimeConstant
.
REDIS_CITY_NAME_NOT_ALLOW
,
notAllowCity
);
String
allowPerIds
=
"3142303054611251275691230|3142303054611251275691231"
;
String
notAllowPerIds
=
"314230305461125127569123|14230305461125127569124"
;
redisUtil
.
getRedisTemplateByDb
(
250
).
opsForValue
().
set
(
ChimeConstant
.
REDIS_PERFORMANCE_IDS_ALLOW
,
allowPerIds
);
redisUtil
.
getRedisTemplateByDb
(
250
).
opsForValue
().
set
(
ChimeConstant
.
REDIS_PERFORMANCE_IDS_NOT_ALLOW
,
notAllowPerIds
);
}
}
}
}
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