自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 自定义异常

public class HrWrapException extends RuntimeException { private static final long serialVersionUID = 1L; private int errorCode; private String msg; public HrWrapException(int errorCode, String msg) { super(msg); this.er.

2021-11-17 18:19:09 82

原创 feign调用拦截器

@Configurationpublic class TrackerFeignRequestInterceptor implements RequestInterceptor { @Override public void apply(RequestTemplate requestTemplate) { if (StringUtils.isBlank(traceId)) { traceId = TraceIdUtils.nextTraceIdHi.

2021-11-10 17:24:13 354

原创 springboot全局异常处理

@ControllerAdvice@ResponseBody@Slf4jpublic class GlobalExceptionHandler { @ExceptionHandler(value = Exception.class) public Result<?> exceptionHandler(HttpServletRequest request, Exception e) { Result<?> result = new Result&.

2021-10-14 09:50:48 100

原创 springboot配置redisTemplate

@Configurationpublic class RedisConfig { @Bean public RedisTemplate<String, Object> template(RedisConnectionFactory factory) { // 创建RedisTemplate<String, Object>对象 RedisTemplate<String, Object> template = new Re.

2021-10-14 09:47:51 900

原创 springboot如何配置跨域

@Configurationpublic class CorsConfig { private CorsConfiguration buildConfig(){ CorsConfiguration corsConfiguration = new CorsConfiguration(); corsConfiguration.addAllowedOrigin("*"); corsConfiguration.addAllowedMethod("*").

2021-10-14 09:46:37 111

原创 springboot线程池配置核心参数

@Configuration@EnableAsyncpublic class TaskExecutorConfig { @Bean public TaskExecutor taskExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); // 设置核心线程数 executor.setCorePoolSize(10); // .

2021-10-14 09:45:38 953

原创 springboot全局定义null字段返回和中文乱码处理

@Configuration@ComponentScan(value = {"com.echronos.*.controller"}, includeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, value = Controller.class)})public class WebConfig extends WebMvcAutoConfiguration { @Bean public F.

2021-10-14 09:37:37 334

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除