| | |
| | | import org.springframework.boot.web.client.RestTemplateBuilder; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.cloud.client.loadbalancer.LoadBalanced; |
| | | import org.springframework.cloud.netflix.feign.EnableFeignClients; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | |
| | | * @date 2016年8月6日 |
| | | * @tag |
| | | */ |
| | | @SpringBootApplication(scanBasePackages = {"com.java110.service.aop", |
| | | @SpringBootApplication(scanBasePackages = { |
| | | "com.java110.service.configuration", |
| | | "com.java110.service.controller", |
| | | "com.java110.service.filter", |
| | | "com.java110.service.init", |
| | | "com.java110.api", |
| | | "com.java110.core", |
| | | "com.java110.event.service.api", |
| | | "com.java110.config.properties.code", |
| | | "com.java110.cache"}) |
| | | @EnableDiscoveryClient |
| | | @Java110ListenerDiscovery(listenerPublishClass = ServiceDataFlowEventPublishing.class, |
| | |
| | | |
| | | /** |
| | | * swagger 插件 |
| | | * |
| | | * @return Docket 对象 |
| | | */ |
| | | @Bean |
| | |
| | | */ |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("Swagger2构建RESTful APIs") |
| | | .description("api信息") |
| | | .title("HC小区管理系统 APIs") |
| | | .description("HC小区管理系统提供的所有能力") |
| | | .termsOfServiceUrl("https://github.com/java110/MicroCommunity") |
| | | .contact("sunf") |
| | | .contact("吴学文") |
| | | .version("1.0") |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | ApplicationContext context = SpringApplication.run(ApiApplicationStart.class, args); |
| | | try{ |
| | | ApplicationContext context = SpringApplication.run(ApiApplicationStart.class, args); |
| | | |
| | | //服务启动加载 |
| | | ServiceStartInit.initSystemConfig(context); |
| | | //服务启动加载 |
| | | ServiceStartInit.initSystemConfig(context); |
| | | }catch (Throwable e){ |
| | | logger.error("系统启动失败",e); |
| | | } |
| | | } |
| | | |
| | | } |