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
7ab85667
Commit
7ab85667
authored
Feb 05, 2021
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save info
parent
ddfba5cc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
Main.scala
src/main/scala/com.gmei.up/Main.scala
+7
-7
ES.scala
src/main/scala/com.gmei.up/utils/ES.scala
+14
-8
Redis.scala
src/main/scala/com.gmei.up/utils/Redis.scala
+1
-1
No files found.
src/main/scala/com.gmei.up/Main.scala
View file @
7ab85667
...
...
@@ -59,16 +59,16 @@ object Main {
println
(
deviceId
)
println
(
projects
.
mkString
(
" "
))
val
diaryReq
=
ES
.
generateDiaryRequest
(
projects
,
secondDemands
,
cityId
)
val
tractateReq
=
ES
.
generateTractateRequest
(
projects
,
secondDemands
)
val
answerReq
=
ES
.
generateAnswerRequest
(
projects
,
secondDemands
)
val
serviceDiaryReq
=
ES
.
generateServiceDiaryRequest
(
projects
,
secondDemands
,
cityId
)
val
a
=
ES
.
request
(
diaryReq
)
val
diaryReq
=
ES
.
generateDiaryRequest
(
projects
,
secondDemands
,
cityId
,
300
)
val
tractateReq
=
ES
.
generateTractateRequest
(
projects
,
secondDemands
,
300
)
val
answerReq
=
ES
.
generateAnswerRequest
(
projects
,
secondDemands
,
100
)
val
serviceDiaryReq
=
ES
.
generateServiceDiaryRequest
(
projects
,
secondDemands
,
cityId
,
100
)
Redis
.
save
(
ES
.
request
(
diaryReq
),
deviceId
,
"diary"
)
// ES.test(diaryReq, tractateReq, answerReq, serviceDiaryReq)
Redis
.
save
(
ES
.
request
(
tractateReq
),
deviceId
,
"tractate"
)
Redis
.
save
(
ES
.
request
(
answerReq
),
deviceId
,
"answer"
)
Redis
.
save
(
ES
.
request
(
serviceDiaryReq
),
deviceId
,
"service_diary"
)
println
(
"########################"
)
deviceId
}
...
...
src/main/scala/com.gmei.up/utils/ES.scala
View file @
7ab85667
...
...
@@ -107,9 +107,9 @@ object ES {
def
generateDiaryRequest
(
projects
:
List
[
String
],
secondDemands
:
List
[
String
],
cityId
:
Int
=
-
1
cityId
:
Int
=
-
1
,
size
:
Int
=
300
)
:
SearchRequest
=
{
val
size
=
15
val
includes
=
List
(
"id"
,
"tags_v3"
)
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
...
...
@@ -167,8 +167,11 @@ object ES {
res
}
def
generateTractateRequest
(
projects
:
List
[
String
],
secondDemands
:
List
[
String
])
:
SearchRequest
=
{
val
size
=
15
def
generateTractateRequest
(
projects
:
List
[
String
],
secondDemands
:
List
[
String
],
size
:
Int
=
300
)
:
SearchRequest
=
{
val
includes
=
List
(
"id"
,
"tags_v3"
)
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
...
...
@@ -212,8 +215,11 @@ object ES {
res
}
def
generateAnswerRequest
(
projects
:
List
[
String
],
secondDemands
:
List
[
String
])
:
SearchRequest
=
{
val
size
=
15
def
generateAnswerRequest
(
projects
:
List
[
String
],
secondDemands
:
List
[
String
],
size
:
Int
=
100
)
:
SearchRequest
=
{
val
includes
=
List
(
"id"
,
"tags_v3"
)
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
...
...
@@ -264,9 +270,9 @@ object ES {
def
generateServiceDiaryRequest
(
projects
:
List
[
String
],
secondDemands
:
List
[
String
],
cityId
:
Int
=
-
1
cityId
:
Int
=
-
1
,
size
:
Int
=
100
)
:
SearchRequest
=
{
val
size
=
15
val
includes
=
List
(
"id"
,
"tags_v3"
)
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
...
...
src/main/scala/com.gmei.up/utils/Redis.scala
View file @
7ab85667
...
...
@@ -18,7 +18,7 @@ object Redis {
if
(
ids
.
size
>
0
)
{
pRc4
.
del
(
key
)
ids
.
foreach
{
id
=>
println
(
id
)
//
println(id)
pRc4
.
rpush
(
key
,
id
)
}
pRc4
.
expire
(
key
,
60
*
60
*
24
*
15
)
...
...
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