File tree Expand file tree Collapse file tree 6 files changed +54
-6
lines changed 
src/main/java/org/aaron/ping 
src/main/java/org/aaron/pong 
sc-gateway/src/main/resources Expand file tree Collapse file tree 6 files changed +54
-6
lines changed Original file line number Diff line number Diff line change 3232
3333    <dependencyManagement >
3434        <dependencies >
35+             <dependency >
36+                 <groupId >org.projectlombok</groupId >
37+                 <artifactId >lombok</artifactId >
38+                 <version >1.18.2</version >
39+             </dependency >
40+ 
3541            <dependency >
3642                <groupId >org.springframework.boot</groupId >
3743                <artifactId >spring-boot-devtools</artifactId >
Original file line number Diff line number Diff line change 3434        <dependency >
3535            <groupId >org.projectlombok</groupId >
3636            <artifactId >lombok</artifactId >
37-             <version >1.18.2</version >
3837        </dependency >
3938
4039        <dependency >
Original file line number Diff line number Diff line change 44import  lombok .Builder ;
55import  lombok .Data ;
66import  lombok .NoArgsConstructor ;
7- import  org .springframework .beans .factory .annotation .Value ;
87import  org .springframework .web .bind .annotation .RequestMapping ;
98import  org .springframework .web .bind .annotation .RestController ;
109
Original file line number Diff line number Diff line change 3232            <scope >test</scope >
3333        </dependency >
3434
35+         <dependency >
36+             <groupId >org.projectlombok</groupId >
37+             <artifactId >lombok</artifactId >
38+         </dependency >
39+ 
3540        <dependency >
3641            <groupId >org.springframework.boot</groupId >
3742            <artifactId >spring-boot-devtools</artifactId >
43+             <optional >true</optional >
3844        </dependency >
3945    </dependencies >
4046
Original file line number Diff line number Diff line change 1+ package  org .aaron .pong ;
2+ 
3+ import  lombok .AllArgsConstructor ;
4+ import  lombok .Builder ;
5+ import  lombok .Data ;
6+ import  lombok .NoArgsConstructor ;
7+ import  org .springframework .web .bind .annotation .RequestMapping ;
8+ import  org .springframework .web .bind .annotation .RestController ;
9+ 
10+ import  java .util .Arrays ;
11+ 
12+ 
13+ @ Data 
14+ @ NoArgsConstructor 
15+ @ AllArgsConstructor 
16+ @ Builder 
17+ public  class  City  {
18+     private  Integer  id ;
19+     private  String  name ;
20+ }
21+ 
22+ @ RestController 
23+ class  CityController  {
24+ 
25+     @ RequestMapping ("/city/list" )
26+     public  Object  listCity () {
27+         return  Arrays .asList (City .builder ().id (1 ).name ("北京" ).build ()
28+                 , City .builder ().id (2 ).name ("上海" ).build ());
29+     }
30+ }
Original file line number Diff line number Diff line change @@ -7,11 +7,19 @@ spring:
77        locator :
88          enabled : true 
99      routes :
10-       - id : sc-bs-ping 
11-         uri : lb://sc-bs-ping 
12-         predicates :
13-         - Path=/ping/** 
10+         - id : sc-bs-ping 
11+           uri : lb://sc-bs-ping 
12+           predicates :
13+             - Path=/ping/** 
14+           filters :
15+             - RewritePath=/ping/(?<segment>.*), /$\{segment} 
1416
17+         - id : sc-bs-pong 
18+           uri : lb://sc-bs-pong 
19+           predicates :
20+             - Path=/pong/** 
21+           filters :
22+             - RewritePath=/pong/(?<segment>.*), /$\{segment} 
1523server :
1624  port : 8763 
1725
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments