Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
spring-boot-starter-dsp
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
shenjiaqing
spring-boot-starter-dsp
Commits
cef7a657
Commit
cef7a657
authored
Mar 31, 2022
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加传入template参数的方法
parent
c26127b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
RedisBloomHandler.java
...duiba/spring/boot/starter/dsp/util/RedisBloomHandler.java
+27
-0
No files found.
spring-boot-starter-dsp-util/src/main/java/cn/com/duiba/spring/boot/starter/dsp/util/RedisBloomHandler.java
View file @
cef7a657
...
@@ -139,6 +139,33 @@ public class RedisBloomHandler<K, V> {
...
@@ -139,6 +139,33 @@ public class RedisBloomHandler<K, V> {
},
true
);
},
true
);
}
}
public
boolean
exists
(
RedisTemplate
redisTemplate
,
K
key
,
V
value
)
{
byte
[]
rawKey
=
rawKey
(
key
);
byte
[]
rawValue
=
rawValue
(
value
);
return
(
boolean
)
redisTemplate
.
execute
(
connection
->
{
Long
l
=
(
Long
)
connection
.
execute
(
EXISTS
,
rawKey
,
rawValue
);
return
Objects
.
equals
(
l
,
1L
);
},
true
);
}
public
boolean
existsString
(
String
key
,
String
value
)
{
byte
[]
rawKey
=
rawString
(
key
);
byte
[]
rawValue
=
rawString
(
value
);
return
(
boolean
)
redisTemplate
.
execute
(
connection
->
{
Long
l
=
(
Long
)
connection
.
execute
(
EXISTS
,
rawKey
,
rawValue
);
return
Objects
.
equals
(
l
,
1L
);
},
true
);
}
public
boolean
existsString
(
RedisTemplate
redisTemplate
,
String
key
,
String
value
)
{
byte
[]
rawKey
=
rawString
(
key
);
byte
[]
rawValue
=
rawString
(
value
);
return
(
boolean
)
redisTemplate
.
execute
(
connection
->
{
Long
l
=
(
Long
)
connection
.
execute
(
EXISTS
,
rawKey
,
rawValue
);
return
Objects
.
equals
(
l
,
1L
);
},
true
);
}
public
Boolean
[]
existsMulti
(
K
key
,
V
...
values
)
{
public
Boolean
[]
existsMulti
(
K
key
,
V
...
values
)
{
byte
[][]
rawArgs
=
rawArgs
(
key
,
values
);
byte
[][]
rawArgs
=
rawArgs
(
key
,
values
);
return
(
Boolean
[])
redisTemplate
.
execute
(
connection
->
{
return
(
Boolean
[])
redisTemplate
.
execute
(
connection
->
{
...
...
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