This commit is contained in:
TestAccountsUser 2018-03-22 01:32:36 +01:00
parent 000da31c1b
commit 63897863b3
15 changed files with 615 additions and 7 deletions

View file

@ -1,14 +1,16 @@
package com.clientui.proxies;
import com.clientui.beans.CommandeBean;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = "microservice-commandes", url = "localhost:9002")
@FeignClient(name = "zuul-server")
@RibbonClient(name = "microservice-commandes")
public interface MicroserviceCommandeProxy {
@PostMapping(value = "/commandes")
@PostMapping(value = "/microservice-commandes/commandes")
CommandeBean ajouterCommande(@RequestBody CommandeBean commande);
}

View file

@ -1,15 +1,17 @@
package com.clientui.proxies;
import com.clientui.beans.PaiementBean;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = "microservice-paiement", url = "localhost:9003")
@FeignClient(name = "zuul-server")
@RibbonClient(name = "microservice-paiement")
public interface MicroservicePaiementProxy {
@PostMapping(value = "/paiement")
@PostMapping(value = "/microservice-paiement/paiement")
ResponseEntity<PaiementBean> payerUneCommande(@RequestBody PaiementBean paiement);
}

View file

@ -9,17 +9,17 @@ import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
import java.util.Optional;
@FeignClient(name = "microservice-produits")
@FeignClient(name = "zuul-server")
@RibbonClient(name = "microservice-produits")
public interface MicroserviceProduitsProxy {
@GetMapping(value = "/Produits")
@GetMapping(value = "/microservice-produits/Produits")
List<ProductBean> listeDesProduits();
/*
* Notez ici la notation @PathVariable("id") qui est différente de celle qu'on utlise dans le contrôleur
**/
@GetMapping( value = "/Produits/{id}")
@GetMapping( value = "/microservice-produits/Produits/{id}")
ProductBean recupererUnProduit(@PathVariable("id") int id);