fix circular dep issue

This commit is contained in:
Jake Potrebic 2022-11-06 19:47:44 -08:00
parent b6c34e616d
commit 9f85cae252
No known key found for this signature in database
GPG Key ID: ECE0B3C133C016C5
4 changed files with 20 additions and 9 deletions

View File

@ -0,0 +1,18 @@
package io.papermc.hangar.config;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.expression.BeanFactoryResolver;
import org.springframework.expression.spel.support.StandardEvaluationContext;
@Configuration
public class SpELConfig {
@Bean
public StandardEvaluationContext standardEvaluationContext(final ApplicationContext applicationContext) {
final StandardEvaluationContext evaluationContext = new StandardEvaluationContext();
evaluationContext.setBeanResolver(new BeanFactoryResolver(applicationContext));
return evaluationContext;
}
}

View File

@ -189,11 +189,4 @@ public class WebConfig extends WebMvcConfigurationSupport {
return response;
}
}
@Bean
public StandardEvaluationContext standardEvaluationContext(ApplicationContext applicationContext) {
StandardEvaluationContext evaluationContext = new StandardEvaluationContext();
evaluationContext.setBeanResolver(new BeanFactoryResolver(applicationContext));
return evaluationContext;
}
}

View File

@ -20,7 +20,7 @@ public record ProjectsConfig( // TODO split into ProjectsConfig and VersionsConf
@DefaultValue("5") int maxChannels,
@DefaultValue("30000") int maxBBCodeLen,
@DefaultValue("25") int initLoad,
@DefaultValue("10") int initVersionLoad, // TODO implement (see @ConfigurePagination)
@DefaultValue("10") int initVersionLoad,
@DefaultValue("120") int maxDescLen,
@DefaultValue("500") int maxSponsorsLen,
@DefaultValue("5") int maxKeywords,

View File

@ -18,7 +18,7 @@ public @interface ConfigurePagination {
long maxLimit() default -1;
@Language("SpEL")
String maxLimitString() default ""; // TODO implement
String maxLimitString() default "";
long defaultLimit() default -1;