Class RestAutoConfiguration

java.lang.Object
cn.herodotus.engine.rest.autoconfigure.RestAutoConfiguration
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@AutoConfiguration @EnableConfigurationProperties({cn.herodotus.engine.rest.condition.properties.EndpointProperties.class,cn.herodotus.engine.rest.condition.properties.PlatformProperties.class}) public class RestAutoConfiguration extends Object implements org.springframework.context.ApplicationContextAware

Description: Rest 自动注入

RestAutoConfiguration 注入的时机比较早,所以在此进行 ServiceContextHolder 的初始化。 如果在其它地方注入 ServiceContextHolder 因为时机过完,会导致未完成初始化即被使用,出现抛错的问题。
Author:
: gengwei.zheng
Date:
: 2022/1/19 23:16
  • Constructor Details

    • RestAutoConfiguration

      public RestAutoConfiguration(cn.herodotus.engine.rest.condition.properties.EndpointProperties endpointProperties, cn.herodotus.engine.rest.condition.properties.PlatformProperties platformProperties, org.springframework.boot.autoconfigure.web.ServerProperties serverProperties)
  • Method Details

    • setApplicationContext

      public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • xssObjectMapperBuilderCustomizer

      @Bean public org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer xssObjectMapperBuilderCustomizer()
    • restErrorCodeMapperBuilderCustomizer

      @Bean public cn.herodotus.engine.assistant.definition.function.ErrorCodeMapperBuilderCustomizer restErrorCodeMapperBuilderCustomizer()