1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

replace code properties that have expired

This commit is contained in:
冷冷
2019-12-03 21:36:21 +08:00
parent cc053a520a
commit ffb246829f
5 changed files with 17 additions and 28 deletions

View File

@@ -25,7 +25,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.server.ServerWebExchange;
import static org.springframework.web.reactive.function.BodyInserters.fromObject;
import static org.springframework.web.reactive.function.BodyInserters.fromValue;
/**
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
@@ -39,9 +39,8 @@ public class MySCGConfiguration {
@Override
public Mono<ServerResponse> handleRequest(ServerWebExchange exchange,
Throwable t) {
return ServerResponse.status(444)
.contentType(MediaType.APPLICATION_JSON_UTF8)
.body(fromObject("SCS Sentinel block"));
return ServerResponse.status(444).contentType(MediaType.APPLICATION_JSON)
.body(fromValue("SCS Sentinel block"));
}
};
}

View File

@@ -26,7 +26,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.server.ServerWebExchange;
import static org.springframework.web.reactive.function.BodyInserters.fromObject;
import static org.springframework.web.reactive.function.BodyInserters.fromValue;
/**
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
@@ -41,8 +41,7 @@ public class MyConfiguration {
public Mono<ServerResponse> handleRequest(ServerWebExchange exchange,
Throwable t) {
return ServerResponse.status(HttpStatus.TOO_MANY_REQUESTS)
.contentType(MediaType.APPLICATION_JSON_UTF8)
.body(fromObject("block"));
.contentType(MediaType.APPLICATION_JSON).body(fromValue("block"));
}
};
}