#297 Create Spring Boot-backed Price microservice with an endpoint to retrieve a price
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
package com.iluwatar.price.microservice;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* PriceApplication starts up Spring Boot, exposing endpoints for the Price microservice through
|
||||
* the {@link PriceController}.
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class PriceApplication {
|
||||
|
||||
/**
|
||||
* Microservice entry point
|
||||
* @param args
|
||||
* command line args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PriceApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.iluwatar.price.microservice;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Exposes the Price microservice's endpoints
|
||||
*/
|
||||
@RestController
|
||||
public class PriceController {
|
||||
|
||||
/**
|
||||
* An endpoint for a user to retrieve a product's price
|
||||
* @return A product's price
|
||||
*/
|
||||
@RequestMapping(value = "/price", method = RequestMethod.GET)
|
||||
public String getPrice() {
|
||||
return "20";
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
server.port=50006
|
Reference in New Issue
Block a user