Browse Source

新增i健康后台项目

chenweida 8 năm trước cách đây
mục cha
commit
f80157399f

+ 1 - 0
svr-lib-parent-pom/pom.xml

@ -30,6 +30,7 @@
        <!--业务微服务-->
        <module>../svr/svr-base</module><!--基础微服务-->
        <module>../svr/svr-quota</module><!--统计微服务-->
        <module>../svr/svr-wlyy</module><!--i健康微服务-->
        <!--网关-->

+ 2 - 1
svr/readme.MD

@ -1,4 +1,5 @@
svr 相关的db设计
    svn:https://192.168.1.103:888/svn/outwindow/基础开发部/doc/i健康2.0/db
    svr-base 基础扩展服务,部分基础服务用ehr的
    svr-quota 统计相关服务
    svr-quota 统计相关服务
    svr-wlyy i健康公共业务后台

+ 113 - 0
svr/svr-wlyy/pom.xml

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>svr-lib-parent-pom</artifactId>
        <version>1.0.0</version>
        <relativePath>../../svr-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-wlyy</artifactId>
    <version>1.0.0</version>
    <dependencies>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-swagger</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-mysql</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-log</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <!--zipkin支持分布式追踪系统-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
        </dependency>
    </dependencies>
</project>

+ 1 - 0
svr/svr-wlyy/readme.MD

@ -0,0 +1 @@
svr-wlyy i健康公共业务后台

+ 18 - 0
svr/svr-wlyy/src/main/java/com/yihu/jw/wlyy/SvrWlyyApplication.java

@ -0,0 +1,18 @@
package com.yihu.jw.wlyy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
 * Created by chenweida on 2017/5/10.
 * localhost:10020/refresh  刷新当个微服务的配置 可以在需要刷新的bean上面@RefreshScope
 */
@SpringBootApplication
@EnableDiscoveryClient//服务注册到发现服务
public class SvrWlyyApplication {
    public static void main(String[] args) {
        SpringApplication.run(SvrWlyyApplication.class, args);
    }
}

+ 21 - 0
svr/svr-wlyy/src/main/resources/application.yml

@ -0,0 +1,21 @@
##如果有配置服务的话,远程服务器和本地服务器配置不一致的情况下,优先远程的为主  git上 svr-base ->  git application ->本地 appliction ->本地 bootstarp
spring:
  application:
    name:  svr-wlyy  ##注册到发现服务的id 如果id一样 eurika会自动做负载
---
spring:
  profiles: dev
---
spring:
  profiles: test
---
spring:
  profiles: prod

+ 8 - 0
svr/svr-wlyy/src/main/resources/banner.txt

@ -0,0 +1,8 @@
  _____              __          ___
  / ____|             \ \        / / |
 | (_____   ___ __     \ \  /\  / /| |_   _ _   _
  \___ \ \ / / '__|     \ \/  \/ / | | | | | | | |
  ____) \ V /| |         \  /\  /  | | |_| | |_| |
 |_____/ \_/ |_|          \/  \/   |_|\__, |\__, |
                                       __/ | __/ |
                                      |___/ |___/

+ 46 - 0
svr/svr-wlyy/src/main/resources/bootstrap.yml

@ -0,0 +1,46 @@
##优先读取 boostarap配置 然后在读取application。yml的配置
spring:
  #从发现服务里面取配置服务的信息
  cloud:
    config:
      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
      username: jw
      password: jkzl
      discovery:
        enabled: true ##使用发现服务
        service-id: svr-configurations ##配置服务的名字
---
spring:
  profiles: dev
##发现服务的地址
eureka:
  client:
    serviceUrl:
      #http://账号:密码@127.0.0.1:8761/eureka/
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka/
---
spring:
  profiles: test
eureka:
  client:
    serviceUrl:
      #http://账号:密码@127.0.0.1:8761/eureka/
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka/
---
spring:
  profiles: prod
eureka:
  client:
    serviceUrl:
      #http://账号:密码@127.0.0.1:8761/eureka/
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka/

+ 33 - 0
web-gateway/src/main/java/com/yihu/jw/interceptors/PatientInterceptor.java

@ -0,0 +1,33 @@
package com.yihu.jw.interceptors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * Created by chenweida on 2017/5/23.
 */
@Component
public class PatientInterceptor implements HandlerInterceptor {
    private Logger logger = LoggerFactory.getLogger(PatientInterceptor.class);
    @Override
    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
        return false;
    }
    @Override
    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
    }
    @Override
    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
    }
}