Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 4 additions & 39 deletions src/main/java/com/gateway/fallback/FallbackController.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,14 @@
@RequestMapping("/fallback")
public class FallbackController {


@RequestMapping(value = "/{service}")
public ResponseEntity<String> genericServiceFallback(@PathVariable String service) {
String body = String.format("El servicio '%s' no está disponible en este momento. Por favor, inténtalo más tarde.", service);
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE).body(body);
}


@GetMapping("/billing")
public ResponseEntity<String> billingServiceFallback() {
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
.body("El servicio de facturación no está disponible en este momento. Por favor, inténtalo más tarde.");
}

@GetMapping("/chat")
public ResponseEntity<String> chatServiceFallback() {
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
.body("El servicio de chat no está disponible en este momento. Por favor, inténtalo más tarde.");
}

@GetMapping("/classes")
public ResponseEntity<String> classesServiceFallback() {
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
.body("El servicio de clases no está disponible en este momento. Por favor, inténtalo más tarde.");
}

@GetMapping("/members")
public ResponseEntity<String> membersServiceFallback() {
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
.body("El servicio de miembros no está disponible en este momento. Por favor, inténtalo más tarde.");
}

@GetMapping("/notifications")
public ResponseEntity<String> notificationsServiceFallback() {
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
.body("El servicio de notificaciones no está disponible en este momento. Por favor, inténtalo más tarde.");
@GetMapping("/{service}")
public ResponseEntity<String> specificServiceFallback(@PathVariable String service) {
return genericServiceFallback(service);
}

@GetMapping("/security")
public ResponseEntity<String> securityServiceFallback() {
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE)
.body("El servicio de autenticacion no está disponible en este momento. Por favor, inténtalo más tarde.");
}


}
}