java110
2022-01-17 28e7d3937f819a3486b22bfa1c84aee172aaccb4
service-job/src/main/java/com/java110/job/JobServiceApplication.java
old mode 100644 new mode 100755
@@ -5,7 +5,7 @@
import com.java110.core.event.service.BusinessServiceDataFlowEventPublishing;
import com.java110.service.init.ServiceStartInit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.java110.core.log.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
@@ -15,6 +15,7 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.nio.charset.Charset;
@@ -37,8 +38,13 @@
        "com.java110.intf.user",
        "com.java110.intf.order",
        "com.java110.intf.store",
        "com.java110.intf.report",
        "com.java110.intf.acct",
        "com.java110.intf.oa",
        "com.java110.intf.goods"
})
@EnableScheduling
@EnableAsync
public class JobServiceApplication {
    private static Logger logger = LoggerFactory.getLogger(JobServiceApplication.class);
@@ -48,6 +54,14 @@
    public RestTemplate outRestTemplate() {
        StringHttpMessageConverter m = new StringHttpMessageConverter(Charset.forName("UTF-8"));
        RestTemplate restTemplate = new RestTemplateBuilder().additionalMessageConverters(m).build(RestTemplate.class);
        return restTemplate;
    }
    @Bean
    //@LoadBalanced
    public RestTemplate formRestTemplate() {
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.getMessageConverters().add(new StringHttpMessageConverter(Charset.forName("UTF-8")));
        return restTemplate;
    }
@@ -65,6 +79,7 @@
    }
    public static void main(String[] args) throws Exception {
        ServiceStartInit.preInitSystemConfig();
        ApplicationContext context = SpringApplication.run(JobServiceApplication.class, args);
        ServiceStartInit.initSystemConfig(context);
        //加载业务侦听