Skip to content

Commit

Permalink
Merge pull request #228 from shiyindaxiaojie/feature
Browse files Browse the repository at this point in the history
Feature
  • Loading branch information
shiyindaxiaojie authored Feb 9, 2025
2 parents 8ffb299 + 8cc4a4e commit 09fa916
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.jetbrains.annotations.PropertyKey;
import org.ylzl.eden.extension.ExtensionLoader;
import org.ylzl.eden.extension.SPI;
import org.ylzl.eden.spring.framework.beans.ApplicationContextHelper;
import org.ylzl.eden.spring.framework.error.ErrorCodeLoader;

/**
Expand All @@ -31,6 +32,10 @@
public interface ResponseBuilder<T> {

static ResponseBuilder<?> builder() {
ResponseBuilder<?> builder = ApplicationContextHelper.getBean(ResponseBuilder.class);
if (builder != null) {
return builder;
}
return ExtensionLoader.getExtensionLoader(ResponseBuilder.class).getDefaultExtension();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class RestExceptionHandlerRegistrar implements ImportBeanDefinitionRegist
@Override
public void registerBeanDefinitions(@NotNull AnnotationMetadata metadata,
@NotNull BeanDefinitionRegistry registry) {

ApplicationContextHelper.registerBean(RestExceptionHandler.class, registry);
}
}

0 comments on commit 09fa916

Please sign in to comment.