PC
2024-03-31 8c9ba6667b89cc0494d05b5da4355dde205b8d4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.qianwen.core.report.config;
 
import com.bstek.ureport.UReportPropertyPlaceholderConfigurer;
import com.bstek.ureport.console.UReportServlet;
import com.bstek.ureport.provider.report.ReportProvider;
import javax.servlet.Servlet;
import com.qianwen.core.report.props.ReportDatabaseProperties;
import com.qianwen.core.report.props.ReportProperties;
import com.qianwen.core.report.provider.DatabaseProvider;
import com.qianwen.core.report.provider.ReportPlaceholderProvider;
import com.qianwen.core.report.service.IReportFileService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.core.annotation.Order;
 
@EnableConfigurationProperties({ReportProperties.class, ReportDatabaseProperties.class})
@ImportResource({"classpath:ureport-console-context.xml"})
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(value = {"report.enabled"}, havingValue = "true", matchIfMissing = true)
@Order
/* loaded from: blade-starter-report-9.3.0.0-SNAPSHOT.jar:org/springblade/core/report/config/ReportConfiguration.class */
public class ReportConfiguration {
    @Bean
    public ServletRegistrationBean<Servlet> registrationBean() {
        return new ServletRegistrationBean<>(new UReportServlet(), new String[]{"/ureport/*"});
    }
 
    @Bean
    public UReportPropertyPlaceholderConfigurer uReportPropertyPlaceholderConfigurer(ReportProperties properties) {
        return new ReportPlaceholderProvider(properties);
    }
 
    @ConditionalOnMissingBean
    @Bean
    public ReportProvider reportProvider(ReportDatabaseProperties properties, IReportFileService service) {
        return new DatabaseProvider(properties, service);
    }
}