-
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.
Proyecto Backend Reto 3 misionTic USA
- Loading branch information
DanielaAvendano
committed
Nov 26, 2021
1 parent
c5ec857
commit 743b88c
Showing
32 changed files
with
856 additions
and
204 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
Library/src/test/java/gov/co/misiontic/ciclo3/usa/biblioteca/BibliotecaApplicationTests.java
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,59 @@ | ||
|
||
package gov.co.misiontic.ciclo3.usa.biblioteca.controladores; | ||
|
||
import gov.co.misiontic.ciclo3.usa.biblioteca.modelos.entidades.Admin; | ||
import gov.co.misiontic.ciclo3.usa.biblioteca.servicios.AdminServicio; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import java.util.List; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
|
||
/** | ||
* | ||
* @author Daniela Avendano | ||
*/ | ||
@RestController | ||
@RequestMapping("/api") | ||
public class ControladorAdmin { | ||
|
||
@Autowired | ||
AdminServicio adminServicio; | ||
|
||
@GetMapping("/Admin/all") | ||
public List<Admin> buscarTodoAdmin() { | ||
return adminServicio.buscarTodoAdmin(); | ||
} | ||
|
||
@GetMapping("/Admin/{id}") | ||
|
||
public Admin get(@PathVariable("id") Integer id) { | ||
return adminServicio.buscarporidAdmin(id); | ||
} | ||
|
||
@PostMapping("/Admin/save") | ||
public ResponseEntity <?> post(@RequestBody Admin admin) { | ||
adminServicio.guardarAdmin(admin); | ||
return ResponseEntity.status(201).build(); | ||
} | ||
|
||
@PutMapping("/Admin/update") | ||
public ResponseEntity <?> put(@RequestBody Admin admin) { | ||
adminServicio.guardarAdmin(admin); | ||
return ResponseEntity.status(201).build(); | ||
} | ||
|
||
|
||
@DeleteMapping("/Admin/{id}") | ||
public ResponseEntity <?> delete(@PathVariable("id") Integer id) { | ||
adminServicio.eliminaridAdmin(id); | ||
return ResponseEntity.status(204).build(); | ||
} | ||
|
||
} |
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,57 @@ | ||
|
||
package gov.co.misiontic.ciclo3.usa.biblioteca.controladores; | ||
|
||
import gov.co.misiontic.ciclo3.usa.biblioteca.modelos.entidades.Category; | ||
import gov.co.misiontic.ciclo3.usa.biblioteca.servicios.CategoryServicio; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import java.util.List; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
|
||
/** | ||
* | ||
* @author Daniela Avendano | ||
*/ | ||
@RestController | ||
@RequestMapping("/api") | ||
public class ControladorCategory { | ||
|
||
@Autowired | ||
CategoryServicio categoryServicio; | ||
|
||
@GetMapping("/Category/all") | ||
public List<Category> buscarCategory() { | ||
return categoryServicio.buscarTodoCategory(); | ||
} | ||
|
||
@GetMapping("/Category/{id}") | ||
public Category get(@PathVariable ("id") Integer id) { | ||
return categoryServicio.buscarporidCategory(id); | ||
} | ||
|
||
@PutMapping("/Category/update") | ||
public ResponseEntity<?> put(@RequestBody Category category) { | ||
categoryServicio.guardarCategory(category); | ||
return ResponseEntity.status(201).build(); | ||
} | ||
|
||
@PostMapping("/Category/save") | ||
public ResponseEntity<?> post(@RequestBody Category category) { | ||
categoryServicio.guardarCategory(category); | ||
return ResponseEntity.status(201).build(); | ||
} | ||
|
||
@DeleteMapping("/Category/{id}") | ||
public ResponseEntity<?> delete(@PathVariable ("id") Integer id){ | ||
categoryServicio.eliminaridCategory(id); | ||
return ResponseEntity.status(204).build(); | ||
} | ||
|
||
} |
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,62 @@ | ||
|
||
package gov.co.misiontic.ciclo3.usa.biblioteca.controladores; | ||
|
||
import gov.co.misiontic.ciclo3.usa.biblioteca.modelos.entidades.Client; | ||
import gov.co.misiontic.ciclo3.usa.biblioteca.servicios.ClientServicio; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import java.util.List; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
|
||
/** | ||
* | ||
* @author Daniela Avendano | ||
*/ | ||
@RestController | ||
@RequestMapping("/api") | ||
public class ControladorClient { | ||
@Autowired | ||
ClientServicio clientServicio; | ||
|
||
@GetMapping("/Client/all") | ||
public List<Client> buscarClient() { | ||
return clientServicio.buscarTodoClient(); | ||
} | ||
|
||
|
||
@GetMapping("/Client/{idClient}") | ||
|
||
public Client get(@PathVariable ("idClient")Long idClient) { | ||
return clientServicio.buscarporidClient(idClient); | ||
} | ||
|
||
@PutMapping("/Client/update") | ||
public ResponseEntity<?> put( @RequestBody Client cliente) { | ||
clientServicio.guardarClient(cliente); | ||
return ResponseEntity.status(201).build(); | ||
} | ||
|
||
|
||
@PostMapping("/Client/save") | ||
public ResponseEntity<?> post(@RequestBody Client cliente) { | ||
clientServicio.guardarClient(cliente); | ||
return ResponseEntity.status(201).build(); | ||
} | ||
|
||
|
||
@DeleteMapping("/Client/{idClient}") | ||
public ResponseEntity<?> delete(@PathVariable("idClient") Long idClient) { | ||
clientServicio.eliminaridClient(idClient); | ||
return ResponseEntity.status(204).build(); | ||
} | ||
|
||
} |
Oops, something went wrong.