This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
.../missi/desarrollowebfullstack/bookabook/operador/controller/EurekaGreetingController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package net.unir.missi.desarrollowebfullstack.bookabook.operador.controller; | ||
|
||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
public interface EurekaGreetingController { | ||
|
||
String greeting(); | ||
} |
26 changes: 26 additions & 0 deletions
26
...si/desarrollowebfullstack/bookabook/operador/controller/EurekaGreetingControllerImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.unir.missi.desarrollowebfullstack.bookabook.operador.controller; | ||
|
||
import com.netflix.discovery.EurekaClient; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Lazy; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class EurekaGreetingControllerImpl implements EurekaGreetingController { | ||
|
||
@Autowired | ||
@Lazy | ||
private EurekaClient eurekaClient; | ||
|
||
@Value("${spring.application.name}") | ||
private String appName; | ||
|
||
@Override | ||
@RequestMapping("/greeting") | ||
public String greeting() { | ||
return String.format( | ||
"Hello from '%s'!", eurekaClient.getApplication(appName).getName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters