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
41bdc245
Commit
41bdc245
authored
Feb 07, 2021
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update id type
parent
757e8c9f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
Content.scala
src/main/scala/com.gmei.up/utils/Content.scala
+1
-1
ES.scala
src/main/scala/com.gmei.up/utils/ES.scala
+1
-1
Redis.scala
src/main/scala/com.gmei.up/utils/Redis.scala
+4
-3
No files found.
src/main/scala/com.gmei.up/utils/Content.scala
View file @
41bdc245
package
com.gmei.up.utils
case
class
Content
(
id
:
Long
,
index
:
String
,
serviceId
:
Option
[
Lo
ng
],
projects
:
String
)
case
class
Content
(
id
:
Long
,
index
:
String
,
serviceId
:
Option
[
Stri
ng
],
projects
:
String
)
src/main/scala/com.gmei.up/utils/ES.scala
View file @
41bdc245
...
...
@@ -57,7 +57,7 @@ object ES {
implicit
object
ContentHitReader
extends
HitReader
[
Content
]
{
override
def
read
(
hit
:
Hit
)
:
Try
[
Content
]
=
{
val
source
=
hit
.
sourceAsMap
val
serviceId
=
source
.
getOrElse
(
"service"
,
Map
[
String
,
Long
]()).
asInstanceOf
[
Map
[
String
,
Lo
ng
]].
get
(
"id"
)
val
serviceId
=
source
.
getOrElse
(
"service"
,
Map
[
String
,
String
]()).
asInstanceOf
[
Map
[
String
,
Stri
ng
]].
get
(
"id"
)
Try
(
Content
(
source
(
"id"
).
toString
.
toLong
,
hit
.
index
,
serviceId
,
source
(
"tags_v3"
).
toString
)
)
...
...
src/main/scala/com.gmei.up/utils/Redis.scala
View file @
41bdc245
...
...
@@ -71,10 +71,11 @@ object Redis {
case
Right
(
contentFuture
)
=>
pRc4
.
withClient
{
client
=>
contentFuture
.
foreach
{
seq
=>
val
idPaids
=
seq
.
map
(
c
=>
(
c
.
id
,
c
.
serviceId
.
getOrElse
(-
1L
)))
if
(
idPaids
.
size
>
0
)
{
val
idPairs
=
seq
.
map
(
c
=>
(
c
.
id
,
c
.
serviceId
.
getOrElse
(
"-1"
)))
println
(
idPairs
)
if
(
idPairs
.
size
>
0
)
{
client
.
del
(
key
)
idPai
d
s
.
foreach
{
pair
=>
idPai
r
s
.
foreach
{
pair
=>
client
.
rpush
(
key
,
pair
)
}
}
...
...
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