| | |
| | | package com.java110.community; |
| | | |
| | | import com.java110.core.annotation.Java110ListenerDiscovery; |
| | | import com.java110.core.client.RestTemplate; |
| | | import com.java110.core.event.service.BusinessServiceDataFlowEventPublishing; |
| | | import com.java110.service.init.ServiceStartInit; |
| | | import org.slf4j.Logger; |
| | |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.nio.charset.Charset; |
| | | |
| | |
| | | * @tag |
| | | */ |
| | | @SpringBootApplication(scanBasePackages = {"com.java110.service", "com.java110.community", |
| | | "com.java110.core", "com.java110.config.properties.code","com.java110.db"}) |
| | | "com.java110.core", "com.java110.config.properties.code", "com.java110.db"}) |
| | | @EnableDiscoveryClient |
| | | @Java110ListenerDiscovery(listenerPublishClass = BusinessServiceDataFlowEventPublishing.class, |
| | | basePackages = {"com.java110.community.listener"}) |
| | | @EnableFeignClients(basePackages = {"com.java110.core.smo.user"}) |
| | | @EnableFeignClients(basePackages = {"com.java110.core.smo.user", "com.java110.intf.common"}) |
| | | public class CommunityServiceApplicationStart { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(CommunityServiceApplicationStart.class); |
| | |
| | | @LoadBalanced |
| | | public RestTemplate restTemplate() { |
| | | StringHttpMessageConverter m = new StringHttpMessageConverter(Charset.forName("UTF-8")); |
| | | RestTemplate restTemplate = new RestTemplateBuilder().additionalMessageConverters(m).build(); |
| | | RestTemplate restTemplate = new RestTemplateBuilder().additionalMessageConverters(m).build(RestTemplate.class); |
| | | return restTemplate; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | try{ |
| | | try { |
| | | ApplicationContext context = SpringApplication.run(CommunityServiceApplicationStart.class, args); |
| | | ServiceStartInit.initSystemConfig(context); |
| | | }catch (Throwable e){ |
| | | logger.error("系统启动失败",e); |
| | | } catch (Throwable e) { |
| | | logger.error("系统启动失败", e); |
| | | } |
| | | } |
| | | } |