Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
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
openSource
apollo
Commits
8a0c7f3a
Commit
8a0c7f3a
authored
Jul 01, 2016
by
张乐
Committed by
GitHub
Jul 01, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #306 from lepdou/0627_0701
fix user search
parents
cd27534a
41b04ad1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
CtripUserService.java
.../ctrip/framework/apollo/portal/auth/CtripUserService.java
+12
-10
CtripUserServiceTest.java
...ip/framework/apollo/portal/auth/CtripUserServiceTest.java
+0
-2
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/auth/CtripUserService.java
View file @
8a0c7f3a
...
@@ -14,6 +14,7 @@ import org.springframework.http.HttpMethod;
...
@@ -14,6 +14,7 @@ import org.springframework.http.HttpMethod;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.client.ClientHttpRequestFactory
;
import
org.springframework.http.client.ClientHttpRequestFactory
;
import
org.springframework.http.client.SimpleClientHttpRequestFactory
;
import
org.springframework.http.client.SimpleClientHttpRequestFactory
;
import
org.springframework.http.converter.json.GsonHttpMessageConverter
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
...
@@ -44,6 +45,7 @@ public class CtripUserService implements UserService {
...
@@ -44,6 +45,7 @@ public class CtripUserService implements UserService {
SimpleClientHttpRequestFactory
factory
=
new
SimpleClientHttpRequestFactory
();
SimpleClientHttpRequestFactory
factory
=
new
SimpleClientHttpRequestFactory
();
factory
.
setConnectTimeout
(
getConnectTimeout
());
factory
.
setConnectTimeout
(
getConnectTimeout
());
factory
.
setReadTimeout
(
getReadTimeout
());
factory
.
setReadTimeout
(
getReadTimeout
());
return
factory
;
return
factory
;
}
}
...
@@ -140,10 +142,10 @@ public class CtripUserService implements UserService {
...
@@ -140,10 +142,10 @@ public class CtripUserService implements UserService {
int
limit
)
{
int
limit
)
{
UserServiceRequest
request
=
new
UserServiceRequest
();
UserServiceRequest
request
=
new
UserServiceRequest
();
request
.
setAccess_token
(
getUserServiceAccessToken
());
request
.
setAccess_token
(
getUserServiceAccessToken
());
request
.
setType
(
"emloyee"
);
UserServiceRequestBody
requestBody
=
new
UserServiceRequestBody
();
UserServiceRequestBody
requestBody
=
new
UserServiceRequestBody
();
requestBody
.
setIndexAlias
(
"itdb_emloyee"
);
requestBody
.
setIndexAlias
(
"itdb_emloyee"
);
requestBody
.
setType
(
"emloyee"
);
request
.
setRequest_body
(
requestBody
);
request
.
setRequest_body
(
requestBody
);
Map
<
String
,
Object
>
queryJson
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
queryJson
=
Maps
.
newHashMap
();
...
@@ -168,7 +170,6 @@ public class CtripUserService implements UserService {
...
@@ -168,7 +170,6 @@ public class CtripUserService implements UserService {
static
class
UserServiceRequest
{
static
class
UserServiceRequest
{
private
String
access_token
;
private
String
access_token
;
private
String
type
;
private
UserServiceRequestBody
request_body
;
private
UserServiceRequestBody
request_body
;
public
String
getAccess_token
()
{
public
String
getAccess_token
()
{
...
@@ -179,14 +180,6 @@ public class CtripUserService implements UserService {
...
@@ -179,14 +180,6 @@ public class CtripUserService implements UserService {
this
.
access_token
=
access_token
;
this
.
access_token
=
access_token
;
}
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
UserServiceRequestBody
getRequest_body
()
{
public
UserServiceRequestBody
getRequest_body
()
{
return
request_body
;
return
request_body
;
}
}
...
@@ -199,8 +192,17 @@ public class CtripUserService implements UserService {
...
@@ -199,8 +192,17 @@ public class CtripUserService implements UserService {
static
class
UserServiceRequestBody
{
static
class
UserServiceRequestBody
{
private
String
indexAlias
;
private
String
indexAlias
;
private
String
type
;
private
Map
<
String
,
Object
>
queryJson
;
private
Map
<
String
,
Object
>
queryJson
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getIndexAlias
()
{
public
String
getIndexAlias
()
{
return
indexAlias
;
return
indexAlias
;
}
}
...
...
apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/auth/CtripUserServiceTest.java
View file @
8a0c7f3a
...
@@ -70,7 +70,6 @@ public class CtripUserServiceTest {
...
@@ -70,7 +70,6 @@ public class CtripUserServiceTest {
ctripUserService
.
assembleSearchUserRequest
(
someKeyword
,
someOffset
,
someLimit
);
ctripUserService
.
assembleSearchUserRequest
(
someKeyword
,
someOffset
,
someLimit
);
assertEquals
(
someUserServiceToken
,
request
.
getAccess_token
());
assertEquals
(
someUserServiceToken
,
request
.
getAccess_token
());
assertEquals
(
"emloyee"
,
request
.
getType
());
CtripUserService
.
UserServiceRequestBody
requestBody
=
request
.
getRequest_body
();
CtripUserService
.
UserServiceRequestBody
requestBody
=
request
.
getRequest_body
();
...
@@ -94,7 +93,6 @@ public class CtripUserServiceTest {
...
@@ -94,7 +93,6 @@ public class CtripUserServiceTest {
CtripUserService
.
UserServiceRequest
request
=
ctripUserService
.
assembleFindUserRequest
(
userIds
);
CtripUserService
.
UserServiceRequest
request
=
ctripUserService
.
assembleFindUserRequest
(
userIds
);
assertEquals
(
someUserServiceToken
,
request
.
getAccess_token
());
assertEquals
(
someUserServiceToken
,
request
.
getAccess_token
());
assertEquals
(
"emloyee"
,
request
.
getType
());
CtripUserService
.
UserServiceRequestBody
requestBody
=
request
.
getRequest_body
();
CtripUserService
.
UserServiceRequestBody
requestBody
=
request
.
getRequest_body
();
...
...
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