This project is a Spring Boot application that demonstrates JWT authentication and includes endpoints for user authentication, auctions (subastas), and bids (ofertas).
The front end for this project is available in a separate repository. You can find it here.
Follow these steps to install and run the project:
- Clone the repository:
git clone https://github.com/Ceball0s/SpringSubastAll.git - Navigate to the project directory:
cd SpringSubastAll - Build the project using Maven:
mvn clean install - Run the project:
mvn spring-boot:run - Test the API Rest using Postman or another application at
http://localhost:8080.
- Login:
POST /auth/login- Request Body:
LoginRequest - Response:
AuthResponse
- Request Body:
- Register:
POST /auth/register- Request Body:
RegisterRequest - Response:
AuthResponse
- Request Body:
- Add Auction:
POST /api/subasta/agregar- Request Body:
AgregarRequest - Response:
SubastaDTO
- Request Body:
- Get Auction by ID:
GET /api/subasta/{subastaId}- Response:
SubastaDTO
- Response:
- Modify Auction:
PUT /api/subasta/{subastaId}- Request Body:
AgregarRequest - Response:
SubastaDTO
- Request Body:
- Close Auction:
PUT /api/subasta/finalizar/{subastaId}- Response:
SubastaDTO
- Response:
- Cancel Auction:
PUT /api/subasta/cancelar/{subastaId}- Response:
SubastaDTO
- Response:
- Get User Auctions:
GET /api/subasta/usuario- Response: List of
SubastaDTO
- Response: List of
- Get Auction Photo:
GET /api/subasta/foto/{nombreArchivo}- Response:
byte[]
- Response:
- Get Recommendations:
GET /api/subasta/recomendaciones- Response: List of
SubastaDTO
- Response: List of
- Create Bid:
POST /api/ofertas/crear- Request Body:
CrearOfertaRequest - Response:
OfertaDTO
- Request Body:
- Get Bid by ID:
GET /api/ofertas/{id}- Response:
OfertaDTO
- Response:
- Get User Bids:
GET /api/ofertas/usuario- Response: List of
OfertaDTO
- Response: List of
- Get Bids by Auction:
GET /api/ofertas/subasta/{subastaId}- Response: List of
OfertaDTO
- Response: List of
- Get Best Bid by Auction:
GET /api/ofertas/subasta/mejor/{subastaId}- Response:
OfertaDTO
- Response:
- Cancel Bid:
GET /api/ofertas/cancelar/{ofertaid}- Response:
void
- Response:
- Get User by ID:
GET /api/v1/user/{id}- Response:
UserDTO
- Response:
- Update User:
PUT /api/v1/user- Request Body:
UserRequest - Response:
UserResponse
- Request Body:
To run the tests, use the following command:
mvn testThe application properties are configured in the application.properties file. Update the database connection details as needed.
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:postgresql://localhost:5432/subasta
spring.datasource.username=administrador
spring.datasource.password=admin
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.show-sql=true
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect