Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
streamingUserPortrait
Project
Project
Details
Activity
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
赵威
streamingUserPortrait
Commits
2d6e2c05
Commit
2d6e2c05
authored
Feb 07, 2021
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get data from redis
parent
6434b7b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
Redis.scala
src/main/scala/com.gmei.up/utils/Redis.scala
+16
-2
No files found.
src/main/scala/com.gmei.up/utils/Redis.scala
View file @
2d6e2c05
...
...
@@ -22,8 +22,22 @@ object Redis {
def
getRead
(
deviceId
:
String
,
contentType
:
String
)
:
List
[
Long
]
=
{
val
key
=
s
"doris:user_portrait:tag3:read_v2:device_id:${deviceId}:content_type:${contentType}"
val
today
=
java
.
time
.
LocalDate
.
now
.
toString
()
val
redisRes
=
pRc2
.
hget
(
key
,
today
)
redisRes
.
map
(
s
=>
JSON
.
parseArray
(
s
,
classOf
[
Long
]).
asScala
.
toList
).
getOrElse
(
List
.
empty
[
Long
])
try
{
val
redisRes
=
pRc2
.
hget
(
key
,
today
)
redisRes
.
map
(
s
=>
JSON
.
parseArray
(
s
,
classOf
[
Long
]).
asScala
.
toList
).
getOrElse
(
List
.
empty
[
Long
])
}
catch
{
case
e
:
Throwable
=>
DingTalk
.
send
(
Map
(
"method"
->
"Redis.getRead"
,
"deviceId"
->
deviceId
,
"contentType"
->
contentType
,
"error"
->
e
.
getStackTrace
.
mkString
(
"\n"
)
),
contentType
=
"exception"
)
List
.
empty
[
Long
]
}
}
def
save
(
...
...
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