Skip to content

Commit

Permalink
update spring boot 3.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vnobo committed Jan 8, 2024
1 parent 306e77c commit a10f5b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.platform.boot.commons;

import com.google.common.collect.Lists;
import com.platform.boot.commons.exception.ClientException;
import com.platform.boot.commons.exception.RestServerException;
import io.r2dbc.spi.R2dbcException;
import org.apache.commons.logging.Log;
Expand Down Expand Up @@ -73,17 +72,6 @@ public ResponseEntity<ErrorResponse> handleFailureException(ServerWebExchange ex
5070, "数据库操作错误!", errors));
}

@ExceptionHandler(ClientException.class)
public ResponseEntity<ErrorResponse> handleClientException(ServerWebExchange exchange, ClientException ex) {
log.error("%s内部服务访问错误! 信息: %s".formatted(exchange.getLogPrefix(), ex.getMessage()));
if (log.isDebugEnabled()) {
log.error("内部服务访问错误!", ex);
}
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).contentType(MediaType.APPLICATION_JSON)
.body(ErrorResponse.of(exchange.getRequest().getId(), exchange.getRequest().getPath().value(),
ex.getCode(), ex.getServiceId() + "内部服务访问错误!", ex.getMsg()));
}

@ExceptionHandler(RestServerException.class)
public ResponseEntity<ErrorResponse> handleRestServerException(ServerWebExchange exchange, RestServerException ex) {
log.error("%s服务器自定义错误! 信息: %s".formatted(exchange.getLogPrefix(), ex.getMessage()));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
* @see <a href="https://github.com/ulid/spec">ULID</a>
*/
public class ULID {

private static final SecureRandom SECURE_RANDOM = new SecureRandom();
/**
* ULID string length.
*/
Expand Down Expand Up @@ -148,8 +150,7 @@ public class ULID {
*/
public static String random() {
byte[] entropy = new byte[10];
SecureRandom random = new SecureRandom();
random.nextBytes(entropy);
SECURE_RANDOM.nextBytes(entropy);
return generate(System.currentTimeMillis(), entropy);
}

Expand Down

0 comments on commit a10f5b0

Please sign in to comment.