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
4 years ago
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 {
...
@@ -59,16 +59,16 @@ object Main {
println
(
deviceId
)
println
(
deviceId
)
println
(
projects
.
mkString
(
" "
))
println
(
projects
.
mkString
(
" "
))
val
diaryReq
=
ES
.
generateDiaryRequest
(
projects
,
secondDemands
,
cityId
)
val
diaryReq
=
ES
.
generateDiaryRequest
(
projects
,
secondDemands
,
cityId
,
300
)
val
tractateReq
=
ES
.
generateTractateRequest
(
projects
,
secondDemands
)
val
tractateReq
=
ES
.
generateTractateRequest
(
projects
,
secondDemands
,
300
)
val
answerReq
=
ES
.
generateAnswerRequest
(
projects
,
secondDemands
)
val
answerReq
=
ES
.
generateAnswerRequest
(
projects
,
secondDemands
,
100
)
val
serviceDiaryReq
=
ES
.
generateServiceDiaryRequest
(
projects
,
secondDemands
,
cityId
)
val
serviceDiaryReq
=
ES
.
generateServiceDiaryRequest
(
projects
,
secondDemands
,
cityId
,
100
)
val
a
=
ES
.
request
(
diaryReq
)
Redis
.
save
(
ES
.
request
(
diaryReq
),
deviceId
,
"diary"
)
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
deviceId
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/com.gmei.up/utils/ES.scala
View file @
7ab85667
...
@@ -107,9 +107,9 @@ object ES {
...
@@ -107,9 +107,9 @@ object ES {
def
generateDiaryRequest
(
def
generateDiaryRequest
(
projects
:
List
[
String
],
projects
:
List
[
String
],
secondDemands
:
List
[
String
],
secondDemands
:
List
[
String
],
cityId
:
Int
=
-
1
cityId
:
Int
=
-
1
,
size
:
Int
=
300
)
:
SearchRequest
=
{
)
:
SearchRequest
=
{
val
size
=
15
val
includes
=
List
(
"id"
,
"tags_v3"
)
val
includes
=
List
(
"id"
,
"tags_v3"
)
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
...
@@ -167,8 +167,11 @@ object ES {
...
@@ -167,8 +167,11 @@ object ES {
res
res
}
}
def
generateTractateRequest
(
projects
:
List
[
String
],
secondDemands
:
List
[
String
])
:
SearchRequest
=
{
def
generateTractateRequest
(
val
size
=
15
projects
:
List
[
String
],
secondDemands
:
List
[
String
],
size
:
Int
=
300
)
:
SearchRequest
=
{
val
includes
=
List
(
"id"
,
"tags_v3"
)
val
includes
=
List
(
"id"
,
"tags_v3"
)
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
...
@@ -212,8 +215,11 @@ object ES {
...
@@ -212,8 +215,11 @@ object ES {
res
res
}
}
def
generateAnswerRequest
(
projects
:
List
[
String
],
secondDemands
:
List
[
String
])
:
SearchRequest
=
{
def
generateAnswerRequest
(
val
size
=
15
projects
:
List
[
String
],
secondDemands
:
List
[
String
],
size
:
Int
=
100
)
:
SearchRequest
=
{
val
includes
=
List
(
"id"
,
"tags_v3"
)
val
includes
=
List
(
"id"
,
"tags_v3"
)
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
scoreListBuffer
:
ListBuffer
[
ScoreFunction
]
=
ListBuffer
.
empty
[
ScoreFunction
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
...
@@ -264,9 +270,9 @@ object ES {
...
@@ -264,9 +270,9 @@ object ES {
def
generateServiceDiaryRequest
(
def
generateServiceDiaryRequest
(
projects
:
List
[
String
],
projects
:
List
[
String
],
secondDemands
:
List
[
String
],
secondDemands
:
List
[
String
],
cityId
:
Int
=
-
1
cityId
:
Int
=
-
1
,
size
:
Int
=
100
)
:
SearchRequest
=
{
)
:
SearchRequest
=
{
val
size
=
15
val
includes
=
List
(
"id"
,
"tags_v3"
)
val
includes
=
List
(
"id"
,
"tags_v3"
)
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
var
shouldListBuffer
:
ListBuffer
[
Query
]
=
ListBuffer
.
empty
[
Query
]
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/com.gmei.up/utils/Redis.scala
View file @
7ab85667
...
@@ -18,7 +18,7 @@ object Redis {
...
@@ -18,7 +18,7 @@ object Redis {
if
(
ids
.
size
>
0
)
{
if
(
ids
.
size
>
0
)
{
pRc4
.
del
(
key
)
pRc4
.
del
(
key
)
ids
.
foreach
{
id
=>
ids
.
foreach
{
id
=>
println
(
id
)
//
println(id)
pRc4
.
rpush
(
key
,
id
)
pRc4
.
rpush
(
key
,
id
)
}
}
pRc4
.
expire
(
key
,
60
*
60
*
24
*
15
)
pRc4
.
expire
(
key
,
60
*
60
*
24
*
15
)
...
...
This diff is collapsed.
Click to expand it.
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