Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-spark-tag-4.0
Overview
Overview
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
wangxiaokang
gic-spark-tag-4.0
Commits
32863a84
Commit
32863a84
authored
Sep 29, 2020
by
guos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
混合标签处理
parent
53178bd6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
1 deletions
+52
-1
TagProcessEntity.java
src/main/java/com/gic/spark/tag/TagProcessEntity.java
+1
-0
TagProcessManager.java
src/main/java/com/gic/spark/tag/TagProcessManager.java
+0
-0
EsRequestUtil.java
src/main/java/com/gic/spark/util/EsRequestUtil.java
+51
-1
No files found.
src/main/java/com/gic/spark/tag/TagProcessEntity.java
View file @
32863a84
...
@@ -12,6 +12,7 @@ import java.util.List;
...
@@ -12,6 +12,7 @@ import java.util.List;
public
class
TagProcessEntity
{
public
class
TagProcessEntity
{
int
enterpriseId
;
int
enterpriseId
;
long
tagGroupId
;
long
tagGroupId
;
Integer
realTime
;
int
level
;
int
level
;
List
<
TagConditionDTO
>
tagList
;
List
<
TagConditionDTO
>
tagList
;
}
}
src/main/java/com/gic/spark/tag/TagProcessManager.java
View file @
32863a84
This diff is collapsed.
Click to expand it.
src/main/java/com/gic/spark/util/EsRequestUtil.java
View file @
32863a84
...
@@ -2,7 +2,11 @@ package com.gic.spark.util;
...
@@ -2,7 +2,11 @@ package com.gic.spark.util;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.ClientProtocolException
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpPost
;
import
java.io.IOException
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -15,7 +19,7 @@ public class EsRequestUtil {
...
@@ -15,7 +19,7 @@ public class EsRequestUtil {
public
static
String
getESIindexName
(
Integer
enterpriseId
,
boolean
isProduction
)
{
public
static
String
getESIindexName
(
Integer
enterpriseId
,
boolean
isProduction
)
{
String
url
=
isProduction
?
"https://ideal.demogic.com/member-config/member/index-version/"
+
enterpriseId
String
url
=
isProduction
?
"https://ideal.demogic.com/member-config/member/index-version/"
+
enterpriseId
:
"https://four.gicdev.com/member-config/member/index-version/"
+
enterpriseId
;
:
"https://four.gicdev.com/member-config/member/index-version/"
+
enterpriseId
;
HttpResponse
response
=
HttpClient
.
getHttpResponseByGet
(
url
);
HttpResponse
response
=
getHttpResponseByGet
(
url
,
enterpriseId
);
int
responseCode
=
response
.
getStatusLine
().
getStatusCode
();
int
responseCode
=
response
.
getStatusLine
().
getStatusCode
();
if
(
responseCode
==
200
)
{
if
(
responseCode
==
200
)
{
return
HttpClient
.
getResponseString
(
response
);
return
HttpClient
.
getResponseString
(
response
);
...
@@ -23,4 +27,50 @@ public class EsRequestUtil {
...
@@ -23,4 +27,50 @@ public class EsRequestUtil {
return
null
;
return
null
;
}
}
public
static
HttpResponse
getHttpResponseByGet
(
String
url
,
Integer
enterpriseId
)
{
org
.
apache
.
http
.
client
.
HttpClient
httpClient
=
HttpClient
.
getHttpClient
();
HttpGet
get
=
new
HttpGet
(
url
);
get
.
setHeader
(
"sign"
,
""
+
enterpriseId
);
get
.
setHeader
(
"route"
,
"/spark"
);
get
.
setHeader
(
"project"
,
"memberfour"
);
get
.
setHeader
(
"isControl"
,
"true"
);
get
.
setHeader
(
"Refer"
,
url
);
try
{
HttpResponse
response
=
httpClient
.
execute
(
get
);
return
response
;
}
catch
(
ClientProtocolException
var4
)
{
var4
.
printStackTrace
();
}
catch
(
IOException
var5
)
{
var5
.
printStackTrace
();
}
return
null
;
}
public
static
String
getIndexParam
(
Integer
enterpriseId
,
Long
id
,
boolean
isProd
)
{
String
url
=
isProd
?
"https://four.gicdev.com/member-label/get-member-size-by-condition?sceneCrowdId="
+
id
+
"&enterpriseId="
+
enterpriseId
:
"https://four.gicdev.com/member-label/get-member-size-by-condition?sceneCrowdId="
+
id
+
"&enterpriseId="
+
enterpriseId
;
HttpPost
httpPost
=
new
HttpPost
(
url
);
httpPost
.
addHeader
(
"Content-Type"
,
"application/json;charset=UTF-8"
);
httpPost
.
addHeader
(
"project"
,
"member-tag"
);
httpPost
.
addHeader
(
"sign"
,
"1129"
);
httpPost
.
addHeader
(
"route"
,
"get-member-size-by-condition"
);
HttpResponse
response
=
null
;
try
{
response
=
HttpClient
.
getHttpClient
().
execute
(
httpPost
);
JSONObject
json
=
JSONObject
.
parseObject
(
HttpClient
.
getResponseString
(
response
));
return
json
.
getJSONObject
(
"result"
).
getJSONObject
(
"result"
).
toString
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
System
.
out
.
println
(
getIndexParam
(
1129
,
183676455182233606L
,
true
));
}
}
}
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