refactor(api): 统一 HTTP 200 响应契约
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.baiyue.common.web;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
* Registers the common servlet response contract even when an application only scans its own
|
||||
* package, such as audit-service and event-bridge-service.
|
||||
*/
|
||||
@AutoConfiguration
|
||||
public class CommonWebAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(GlobalExceptionHandler.class)
|
||||
GlobalExceptionHandler globalExceptionHandler() {
|
||||
return new GlobalExceptionHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(CorrelationIdFilter.class)
|
||||
CorrelationIdFilter correlationIdFilter() {
|
||||
return new CorrelationIdFilter();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user