Created
March 19, 2024 04:16
-
-
Save alexjosesilva/5629286cecb4284fc656d990146a0fc5 to your computer and use it in GitHub Desktop.
ingle Entry Point (Ponto de Entrada Único)
This file contains hidden or 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
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
@RequestMapping("/api") | |
public class ApiController { | |
@GetMapping | |
public String singleEntryPoint() { | |
// Lógica para rotear solicitações para diferentes endpoints | |
return "Esta é a página inicial do API Gateway"; | |
} | |
@GetMapping("/produtos") | |
public String getProdutos() { | |
// Lógica para lidar com solicitações para o endpoint /produtos | |
return "Lista de produtos"; | |
} | |
@GetMapping("/clientes") | |
public String getClientes() { | |
// Lógica para lidar com solicitações para o endpoint /clientes | |
return "Lista de clientes"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment