Skip to content

Commit 6cafa3d

Browse files
TehreemNisaadamd1985
authored andcommitted
Spring Cloud Zookeeper Updated (eugenp#1626)
* Spring Cloud Zookeeper * Spring Cloud Zookeeper Updated * Spring Cloud Zookeeper Updated
1 parent 3fb4e03 commit 6cafa3d

5 files changed

Lines changed: 3 additions & 30 deletions

File tree

‎spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
<artifactId>spring-cloud-starter-feign</artifactId>
3636
<version>1.2.5.RELEASE</version>
3737
</dependency>
38-
<dependency>
39-
<groupId>org.springframework.boot</groupId>
40-
<artifactId>spring-boot-starter-thymeleaf</artifactId>
41-
<version>1.5.2.RELEASE</version>
42-
</dependency>
4338
<dependency>
4439
<groupId>junit</groupId>
4540
<artifactId>junit</artifactId>

‎spring-cloud/spring-cloud-zookeeper/Greeting/src/main/java/com/baeldung/spring/cloud/greeting/GreetingApplication.java‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@
55
*/
66
package com.baeldung.spring.cloud.greeting;
77

8-
import org.springframework.beans.factory.annotation.Autowired;
98
import org.springframework.boot.SpringApplication;
109
import org.springframework.boot.autoconfigure.SpringBootApplication;
1110
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
12-
import org.springframework.cloud.netflix.feign.EnableFeignClients;
13-
import org.springframework.stereotype.Controller;
14-
import org.springframework.ui.Model;
15-
import org.springframework.web.bind.annotation.RequestMapping;
16-
import org.springframework.web.bind.annotation.ResponseBody;
17-
import org.springframework.web.bind.annotation.RestController;
1811

1912
@SpringBootApplication
2013
@EnableDiscoveryClient

‎spring-cloud/spring-cloud-zookeeper/Greeting/src/main/java/com/baeldung/spring/cloud/greeting/GreetingController.java‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,21 @@
66
package com.baeldung.spring.cloud.greeting;
77

88
import org.springframework.beans.factory.annotation.Autowired;
9-
import org.springframework.cloud.netflix.feign.EnableFeignClients;
10-
import org.springframework.stereotype.Controller;
11-
12-
import org.springframework.ui.Model;
139
import org.springframework.web.bind.annotation.RequestMapping;
1410
import org.springframework.web.bind.annotation.RequestMethod;
15-
import org.springframework.web.bind.annotation.ResponseBody;
1611
import org.springframework.web.bind.annotation.RestController;
1712

18-
@Controller
13+
@RestController
1914
public class GreetingController {
2015

2116
@Autowired
2217
private HelloWorldClient helloWorldClient;
2318

2419
@RequestMapping(value = "/get-greeting", method = RequestMethod.GET)
2520

26-
public String greeting(Model model) {
21+
public String greeting() {
2722

28-
model.addAttribute("greeting", helloWorldClient.HelloWorld());
29-
return "greeting-view";
23+
return helloWorldClient.HelloWorld();
3024

3125
}
3226

‎spring-cloud/spring-cloud-zookeeper/Greeting/src/main/java/com/baeldung/spring/cloud/greeting/HelloWorldClient.java‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import org.springframework.cloud.netflix.feign.EnableFeignClients;
66
import org.springframework.cloud.netflix.feign.FeignClient;
77
import org.springframework.context.annotation.Configuration;
8-
import org.springframework.http.MediaType;
9-
import org.springframework.web.bind.annotation.RequestBody;
108
import org.springframework.web.bind.annotation.RequestMapping;
119
import org.springframework.web.bind.annotation.RequestMethod;
1210
import org.springframework.web.bind.annotation.ResponseBody;
@@ -36,12 +34,6 @@ interface TheClient {
3634
String HelloWorld();
3735
}
3836

39-
/**
40-
* Initiate call to Validation.
41-
*
42-
* @param name
43-
* @return the response
44-
*/
4537
public String HelloWorld() {
4638
return theClient.HelloWorld();
4739
}

‎spring-cloud/spring-cloud-zookeeper/HelloWorld/src/main/java/com/baeldung/spring/cloud/helloworld/HelloWorldController.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
package com.baeldung.spring.cloud.helloworld;
77

8-
import org.springframework.http.MediaType;
98
import org.springframework.web.bind.annotation.RequestMapping;
109
import org.springframework.web.bind.annotation.RequestMethod;
1110
import org.springframework.web.bind.annotation.RestController;

0 commit comments

Comments
 (0)