Browse Source

配置修改

chenweida 8 years ago
parent
commit
da7b8a8bee

+ 1 - 0
svr-configuration/src/main/resources/bootstrap.yml

@ -14,6 +14,7 @@ spring:
##git配置
  cloud:
    config:
      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
      server:
        git:
          uri: http://192.168.1.220:10080/chenweida/jw.config.git

+ 1 - 0
svr-dashboard/src/main/resources/bootstrap.yml

@ -3,6 +3,7 @@ spring:
  #从发现服务里面取配置服务的信息
  cloud:
    config:
      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
      username: jw
      password: jkzl
      discovery:

+ 1 - 0
svr-logServer/src/main/resources/bootstrap.yml

@ -3,6 +3,7 @@ spring:
  #从发现服务里面取配置服务的信息
  cloud:
    config:
      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
      username: jw
      password: jkzl
      discovery:

+ 5 - 0
svr/svr-base/src/main/java/com/yihu/jw/user/contorller/PatientController.java

@ -3,6 +3,8 @@ package com.yihu.jw.user.contorller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
/**
@ -12,12 +14,15 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/patient")
@Api(description = "患者")
public class PatientController {
    @Autowired
    private Tracer tracer;
    @ApiOperation(value = "根据code查找患者")
    @GetMapping(value = "findByCode")
    public String findByCode(
            @ApiParam(name = "code", value = "患者code", required = true)@RequestParam(value = "code", required = true) String code) {
      tracer.getCurrentSpan().logEvent("进入微服务查询患者");
       return "调用根据code查找患者";
    }
}

+ 1 - 0
svr/svr-base/src/main/resources/bootstrap.yml

@ -3,6 +3,7 @@ spring:
  #从发现服务里面取配置服务的信息
  cloud:
    config:
      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
      username: jw
      password: jkzl
      discovery:

+ 1 - 0
svr/svr-quota/src/main/resources/bootstrap.yml

@ -3,6 +3,7 @@ spring:
  #从发现服务里面取配置服务的信息
  cloud:
    config:
      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
      username: jw
      password: jkzl
      discovery:

+ 7 - 4
web-gateway/src/main/java/com/yihu/jw/controller/PatientController.java

@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
@ -27,6 +28,9 @@ public class PatientController {
    @Autowired
    private PatientFegin patientFegin;
    @Autowired
    private Tracer tracer;
    @ApiOperation(value = "根据code查找患者")
    @GetMapping(value = "findByCode")
    //配置HystrixProperty 则调用的方法和fallback是同一个线程 否则就不是
@ -37,11 +41,10 @@ public class PatientController {
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    public String findByCode(
            @ApiParam(name = "code", value = "患者code", required = true) @RequestParam(value = "code", required = true) String code) {
        logger.info("start");
        tracer.getCurrentSpan().logEvent("开始调用微服务查询患者");
        String text1 =patientFegin.findByCode(code);
        logger.info("text");
        String text2 =patientFegin.findByCode(code);
        return text1+text2;
        tracer.getCurrentSpan().logEvent("查询调用微服务找患者结束");
        return text1;
    }
//    /**

+ 1 - 0
web-gateway/src/main/resources/bootstrap.yml

@ -3,6 +3,7 @@ spring:
  #从发现服务里面取配置服务的信息
  cloud:
    config:
      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
      username: jw
      password: jkzl
      discovery: