Translations:
🔨 Basic Auction System (auction-go)
Welcome to the basic auction system developed in Go! This project allows you to create and consult auctions, users, and bids, as well as determine the winner of an auction.
📑 Table of Contents
📖 Introduction
This basic auction system is a project developed in Go that allows the creation and consultation of auctions, users, and bids. It provides a simple and efficient way to manage auctions and determine the winner based on received bids.
🛠 Prerequisites
Make sure you have the following items installed before continuing:
⚙️ Installation
-
Clone this repository:
git clone git@github.com:rodrigoachilles/auction-go.git
cd auction-go
-
Run Docker Compose:
docker-compose up -d
🚀 Usage
After starting Docker Compose, you can use the API to create and consult auctions, users, and bids.
🔧 Running Services
-
Navigate to the main project folder:
cd auction-go
-
Run the Go server:
go run cmd/auction/main.go
📚 Available Endpoints
Create User
POST /users
{
"name": "John Doe"
}
Get User
GET /users/{id}
List Users
GET /users
Create Auction
POST /auctions
{
"product_name": "Product Name",
"category": "Category",
"description": "Product Description",
"condition": 0
}
Get Auction
GET /auctions/{id}
List Auctions
GET /auctions?status=0&category=""&productName=""
Determine Auction Winner
GET /auctions/{id}/winner
Get Auction Bids
GET /auctions/{id}/bids
Create Bid
POST /bids
{
"user_id": 1,
"auction_id": 1,
"amount": 100.0
}
🔍 Examples
Here are some usage examples of the auction system endpoints:
- Create a new user and consult their information.
- Create a new auction and add bids.
- Consult all bids of a specific auction and determine the winner.
🤝 Contribution
Feel free to open issues or submit pull requests for improvements and bug fixes.
📜 License
This project is licensed under the MIT License.