| | |
| | | package com.java110.user; |
| | | |
| | | 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.user", "com.java110.core", "com.java110.config.properties.code", "com.java110.db"}, |
| | | excludeName = {"com.java110.core.smo.user"} |
| | | scanBasePackages = {"com.java110.service","com.java110.core", "com.java110.user", "com.java110.config.properties.code", "com.java110.db"}, |
| | | excludeName = {"com.java110.intf.user"} |
| | | ) |
| | | @EnableDiscoveryClient |
| | | @Java110ListenerDiscovery(listenerPublishClass = BusinessServiceDataFlowEventPublishing.class, |
| | | basePackages = {"com.java110.user.listener"}) |
| | | @EnableFeignClients(basePackages = {"com.java110.core.smo.community"}) |
| | | @EnableFeignClients(basePackages = {"com.java110.intf.community","com.java110.intf.common","com.java110.intf.store", |
| | | "com.java110.intf.fee","com.java110.intf.order"}) |
| | | public class UserServiceApplicationStart { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UserServiceApplicationStart.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(UserServiceApplicationStart.class, args); |
| | | ServiceStartInit.initSystemConfig(context); |
| | | //加载业务侦听 |
| | | // SystemStartLoadBusinessConfigure.initSystemConfig(LISTENER_PATH); |
| | | }catch (Throwable e){ |
| | | logger.error("系统启动失败",e); |
| | | } catch (Throwable e) { |
| | | logger.error("系统启动失败", e); |
| | | } |
| | | } |
| | | } |