chenweida il y a 7 ans
Parent
commit
00e077de59

+ 12 - 12
svr-configuration/pom.xml

@ -40,18 +40,18 @@
            <!--<groupId>org.springframework.cloud</groupId>-->
            <!--<artifactId>spring-cloud-starter-bus-kafka</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>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>-->
    </dependencies>
</project>

+ 0 - 2
svr-configuration/src/main/resources/application.yml

@ -3,8 +3,6 @@ server:
---
spring:
  profiles: jwdev

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

@ -2,7 +2,10 @@ spring:
  application:
    name: svr-configurations
security:
  user:
    name: jw
    password:  jkzl
---
spring:
  profiles: jwdev

+ 6 - 1
web-gateway/readMe.MD

@ -8,4 +8,9 @@
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
    
    localhost:8088/health
    localhost:8088/health
    
刷新配置
在有需要刷新配置的地方的类加上注解
@RefreshScope
curl -X POST http://localhost:8088/refresh

+ 1 - 8
web-gateway/src/main/java/com/yihu/jw/controller/PatientController.java

@ -22,13 +22,10 @@ import org.springframework.web.context.annotation.SessionScope;
@RestController
@RequestMapping("/rest/patient")
@Api(description = "患者")
@RefreshScope
public class PatientController {
    private Logger logger= LoggerFactory.getLogger(PatientController.class);
    @Autowired
    private PatientFegin patientFegin;
    @Value("${test}")
    private  String test;
    @ApiOperation(value = "根据code查找患者")
    @GetMapping(value = "findByCode")
@ -46,11 +43,7 @@ public class PatientController {
        String text2 =patientFegin.findByCode(code);
        return text1+text2;
    }
    @ApiOperation(value = "测试配置刷新")
    @GetMapping(value = "test")
    public String test() {
        return test;
    }
//    /**
//     * 参数要一致 返回值类型也要一致
//     *

+ 5 - 0
web-gateway/src/main/resources/application.yml

@ -9,6 +9,11 @@ feign:
    enabled: true
management:
  security:
    enabled: false  ##关闭 refresh的权限认证
#zuul 默认会代理所有的微服务  路径 /{appliction.name}/**
zuul: