mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
code format
This commit is contained in:
parent
92f728176a
commit
77ac9a9cd6
@ -38,42 +38,42 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public class SentinelClientHttpResponse extends AbstractClientHttpResponse {
|
public class SentinelClientHttpResponse extends AbstractClientHttpResponse {
|
||||||
|
|
||||||
private String blockResponse = "RestTemplate request block by sentinel";
|
private String blockResponse = "RestTemplate request block by sentinel";
|
||||||
|
|
||||||
public SentinelClientHttpResponse() {
|
public SentinelClientHttpResponse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SentinelClientHttpResponse(String blockResponse) {
|
public SentinelClientHttpResponse(String blockResponse) {
|
||||||
this.blockResponse = blockResponse;
|
this.blockResponse = blockResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRawStatusCode() throws IOException {
|
public int getRawStatusCode() throws IOException {
|
||||||
return HttpStatus.OK.value();
|
return HttpStatus.OK.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStatusText() throws IOException {
|
public String getStatusText() throws IOException {
|
||||||
return blockResponse;
|
return blockResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
// nothing do
|
// nothing do
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream getBody() throws IOException {
|
public InputStream getBody() throws IOException {
|
||||||
return new ByteArrayInputStream(blockResponse.getBytes());
|
return new ByteArrayInputStream(blockResponse.getBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpHeaders getHeaders() {
|
public HttpHeaders getHeaders() {
|
||||||
Map<String, List<String>> headers = new HashMap<>();
|
Map<String, List<String>> headers = new HashMap<>();
|
||||||
headers.put(HttpHeaders.CONTENT_TYPE,
|
headers.put(HttpHeaders.CONTENT_TYPE,
|
||||||
Arrays.asList(MediaType.APPLICATION_JSON_UTF8_VALUE));
|
Arrays.asList(MediaType.APPLICATION_JSON_UTF8_VALUE));
|
||||||
HttpHeaders httpHeaders = new HttpHeaders();
|
HttpHeaders httpHeaders = new HttpHeaders();
|
||||||
httpHeaders.putAll(headers);
|
httpHeaders.putAll(headers);
|
||||||
return httpHeaders;
|
return httpHeaders;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user