File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed
ts-client-sdk/src/main/java/edu/fudan/common/client/config
ts-food-merchant-service/src/main/java/food/entity
ts-user-service/src/main/java/user Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 11package edu .fudan .common .client .config ;
22
3+ import org .springframework .boot .web .client .RestTemplateBuilder ;
34import org .springframework .cloud .client .loadbalancer .LoadBalanced ;
45import org .springframework .context .annotation .Bean ;
56import org .springframework .context .annotation .Configuration ;
@@ -13,7 +14,7 @@ public class ClientConfig {
1314
1415 @ Bean
1516 @ LoadBalanced
16- public RestTemplate restTemplate () {
17- return new RestTemplate ();
17+ public RestTemplate restTemplate (RestTemplateBuilder builder ) {
18+ return builder . build ();
1819 }
1920}
Original file line number Diff line number Diff line change 55import javax .persistence .Entity ;
66import javax .persistence .GeneratedValue ;
77import javax .persistence .Id ;
8- import javax .validation .constraints .NotNull ;
9- import java .util .UUID ;
108
119@ Entity
10+ @ GenericGenerator (name = "jpa-uuid" , strategy = "org.hibernate.id.UUIDGenerator" )
1211public class FoodMerchant {
13-
12+ @ Id
13+ @ GeneratedValue (generator = "jpa-uuid" )
14+ @ Column (length = 36 )
15+ private String id ;
16+
17+ public FoodMerchant () {
18+ // Default constructor
19+ }
1420}
Original file line number Diff line number Diff line change 22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
5- import org .springframework .boot .web .client .RestTemplateBuilder ;
65import org .springframework .cloud .client .discovery .EnableDiscoveryClient ;
7- import org .springframework .cloud .client .loadbalancer .LoadBalanced ;
8- import org .springframework .context .annotation .Bean ;
96import org .springframework .context .annotation .ComponentScan ;
107import org .springframework .context .annotation .EnableAspectJAutoProxy ;
118import org .springframework .integration .annotation .IntegrationComponentScan ;
129import org .springframework .scheduling .annotation .EnableAsync ;
13- import org .springframework .web .client .RestTemplate ;
1410import springfox .documentation .swagger2 .annotations .EnableSwagger2 ;
1511
1612/**
@@ -27,9 +23,4 @@ public class UserApplication {
2723 public static void main (String [] args ) {
2824 SpringApplication .run (UserApplication .class , args );
2925 }
30- @ LoadBalanced
31- @ Bean
32- public RestTemplate restTemplate (RestTemplateBuilder builder ) {
33- return builder .build ();
34- }
3526}
You can’t perform that action at this time.
0 commit comments